Mailing List Archive

Too many open files?
Hello, varnish suddenly dies after awhile with this message:

>>
Child said (2, 25657): <<Assert error in wrk_thread(), cache_pool.c line
213:
Condition((pipe(w->pipe)) == 0) not true.
errno = 24 (Too many open files)
>>


I have set the following in /etc/sysconfig/varnish:
ulimit -n 131072
NFILES=131072
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.linpro.no/pipermail/varnish-misc/attachments/20070521/d0d6f42d/attachment.htm
Too many open files? [ In reply to ]
cripy <ccripy at gmail.com> writes:
> Hello, varnish suddenly dies after awhile with this message:
>
>>>
> Child said (2, 25657): <<Assert error in wrk_thread(), cache_pool.c line
> 213:
> Condition((pipe(w->pipe)) == 0) not true.
> errno = 24 (Too many open files)
>>>
>
>
> I have set the following in /etc/sysconfig/varnish:
> ulimit -n 131072
> NFILES=131072

Can you verify that the limit is actually applied? e.g. add 'ulimit -a'
to /etc/init.d/varnish, right before where it starts varnishd, run
'/etc/init.d/varnish restart', and check that the file descriptor limit
really is 131072.

Can you also show us the result of typing 'param.show' in the management
interface?

DES
--
Dag-Erling Sm?rgrav
Senior Software Developer
Linpro AS - www.linpro.no
Too many open files? [ In reply to ]
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()
------------
cnt_fetch(struct sess *sp)
{
...
vc = VBE_GetFd(sp);

if (http_GetStatus(vc->http) == 401)
sp->handling = VCL_RET_PASS;
VBE_ClosedFd(sp->wrk, vc, 0);
...

if (sp->handling == VCL_RET_ERROR)
INCOMPL();

-------------------------
On 5/22/07, Dag-Erling Sm?rgrav <des at linpro.no> wrote:
>
> cripy <ccripy at gmail.com> writes:
> > Hello, varnish suddenly dies after awhile with this message:
> >
> >>>
> > Child said (2, 25657): <<Assert error in wrk_thread(), cache_pool.c line
> > 213:
> > Condition((pipe(w->pipe)) == 0) not true.
> > errno = 24 (Too many open files)
> >>>
> >
> >
> > I have set the following in /etc/sysconfig/varnish:
> > ulimit -n 131072
> > NFILES=131072
>
> Can you verify that the limit is actually applied? e.g. add 'ulimit -a'
> to /etc/init.d/varnish, right before where it starts varnishd, run
> '/etc/init.d/varnish restart', and check that the file descriptor limit
> really is 131072.
>
> Can you also show us the result of typing 'param.show' in the management
> interface?
>
> DES
> --
> Dag-Erling Sm?rgrav
> Senior Software Developer
> Linpro AS - www.linpro.no
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.linpro.no/pipermail/varnish-misc/attachments/20070522/0b425f3e/attachment.htm