Connections to backend not closing

Laurence Rowe l at lrowe.co.uk
Fri Feb 12 11:53:16 CET 2010


On 12 February 2010 00:12, Thimo E. <abc at digithi.de> wrote:
> Hello Poul, hello Michael,
>
>  >The impact [of sockets in FIN_WAIT2] should be no more than a bit of RAM.
> I disagree slightly :) The application which is waiting in FIN_WAIT2 has
> allocated structures, threads which (may or may not) consume CPU time,
> ... and last but not least the value of max opened sockets will be
> reduced by those dead sockets.
> And..as I wrote already..due to that many opened sockets my backend
> stops responding because of "Too many open connections".
>
>
> Situation after 2 days running varnish:
>
> netstat -p:
> 520 connections in FIN_WAIT2 state
>
> varnishstat:
> ...
>          438         0.00         0.01 Backend conn. reuses
>          547         0.00         0.01 Backend conn. was closed
>          988         0.00         0.02 Backend conn. recycles
> ...
>
>>If you look in varnishstat, does the number correlate to the
>>"Backend Conn." activity counters in any way ?
>
> Poul, the 547 closed backend connections are quite near to 520 FIN_WAIT2
> connections.
>
> Any suggestions ?

You might want to increase the ulimit -n for your backend server
process. With nginx set up as a proxy, each open connection consumed 4
file descriptors. (The default is normally 1024).

Laurence



More information about the varnish-misc mailing list