Controlling connection pooling

Dan thelogix at
Fri May 6 14:15:35 CEST 2011

Hi all.

Is there any way to control how connections to backends are reused?

I would very much like to have (at least) one TCP connection per vhost and
have clients only reusing a connection that fits the Host header they are
trying to reach (and create a new one, if no one fits)

Im thinking, somthing like:

sub vcl_recv {
   set backend.connection_pool = req.http.Host;

It might seem like a strange question, but its a question of "misbehaving"

9 months ago i tried to fix it with the "retry patch" here:

Not really well thought trough, since a race-condition occurs with 2+
clients on the same connection at the same time trying to get 2 different
vhosts. They will, in effect "kill" each other's apache process by trying to
go to another vhost. Then they will both retry.. The one that retries first
will loose and get the 503 and the other will get its page.

So is it possible to control the pools? Or disable reuse/pooling completely?

 - Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list