Theoretical connections/second limit using Varnish

Nick Loman nick at loman.net
Wed Apr 29 18:30:04 CEST 2009


Michael S. Fischer wrote:
> On Apr 29, 2009, at 9:22 AM, Poul-Henning Kamp wrote:
> 
>> In message <49F87DE4.3040300 at loman.net>, Nick Loman writes:
>>
>>> Has Varnish got a solution to this problem which does not involve
>>> time-wait recycling? One thing I've thought of is perhaps SO_REUSEADDR
>>> is used or could be used when Varnish makes connections to the backend?
>>
>> Varnish tries as hard as reasonable to reuse backend connections,
>> so you should be able to get multiple requests per backend connection.
>>
>> If this is not the case for you, you should find out why backend 
>> connections
>> are not reused.

Hi Poul-Henning, Michael,

I've configured Apache with KeepAlive off, so I expect the TCP 
connection to be closed after each request and Varnish won't be able to 
use it.

I've done that for a specific reason relating to backend PHP processes.

Is that what you mean?

I typically have thousands of connections in TIME_WAIT mode as a result, 
which is expected, but I wonder what the solution could be if I ever hit 
more connections than local ports available.

If I turned Keep Alive on with Apache, could Varnish multiplex different 
  requests from different TCP sockets to the same backend connection?

> The OP said he turned backend Keep-Alive off.  That's his problem.

Right, exactly, but I want it this way assuming that leaving it on means 
that each user connection translates to one backend connection to Apache 
- not desirable - but perhaps this is not how Varnish operates?

Cheers,

Nick.





More information about the varnish-misc mailing list