Sorry for the list noise. It was an error in some of my code. I added some code in cache_center.c to function cnt_fetch to stop varnish from caching 401 Unauthorized returns. Anyway, I didn't know varnish's code very well and wasn't aware that the variable I found that returned me the information I needed was infact also returning me an fd. Anyway, for those interested here is my code that I added with the fix VBE_ClosedFd()
<br>------------<br>cnt_fetch(struct sess *sp)<br>{<br>...<br> vc = VBE_GetFd(sp);<br><br> if (http_GetStatus(vc->http) == 401)<br> sp->handling = VCL_RET_PASS;<br> VBE_ClosedFd(sp->wrk, vc, 0);
<br>...<br><br> if (sp->handling == VCL_RET_ERROR)<br> INCOMPL();<br><br>-------------------------<br><div><span class="gmail_quote">On 5/22/07, <b class="gmail_sendername">Dag-Erling Smørgrav</b>
<<a href="mailto:des@linpro.no">des@linpro.no</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">cripy <<a href="mailto:ccripy@gmail.com">
ccripy@gmail.com</a>> writes:<br>> Hello, varnish suddenly dies after awhile with this message:<br>><br>>>><br>> Child said (2, 25657): <<Assert error in wrk_thread(), cache_pool.c line<br>> 213:
<br>> Condition((pipe(w->pipe)) == 0) not true.<br>> errno = 24 (Too many open files)<br>>>><br>><br>><br>> I have set the following in /etc/sysconfig/varnish:<br>> ulimit -n 131072<br>> NFILES=131072
<br><br>Can you verify that the limit is actually applied? e.g. add 'ulimit -a'<br>to /etc/init.d/varnish, right before where it starts varnishd, run<br>'/etc/init.d/varnish restart', and check that the file descriptor limit
<br>really is 131072.<br><br>Can you also show us the result of typing 'param.show' in the management<br>interface?<br><br>DES<br>--<br>Dag-Erling Smørgrav<br>Senior Software Developer<br>Linpro AS - <a href="http://www.linpro.no">
www.linpro.no</a><br></blockquote></div><br>