On Mon, Dec 20, 2010 at 08:04:33AM +0100, Frank Helmschrott wrote:
> i wonder how the thing is with keep alive sessions from apache when
> using it behind a varnish cache server. Doesn't keep alive make sense
> here as all the connection come from the varnish cache (one source)
> instead of the users (many sources). I don't know how these sessions
> work in detail but thats what came to my tired mind on early monday
> morning :)

Varnish uses (and likes) keep-alive to the back-end. You want your backend
to support keep-alive, since there's little point in re-establishing
connections all the time. There's a "backend connections reused" counter
that'll tell indicate how efficient Varnish is at taking advantage of
keep-alive (and recycled, which is much the same thing).

There's one exception, though: When you are using pipe (not pass), you want
to set "connection: close" in vcl_pipe to disable keep-alive. This is
because Varnish only sees the first request in a piped session - if the
first request is piped, the next requests will be too. This is a problem
if you need different backends for the requests; have cached the
subsequent requests; or if you need the x-forwarded-for header or other
varnish-manipulated headers on the subsequent requests.

But other than pipe, you really want to use keep-alive.

- Kristian

Attachment: signature.asc
Description: Digital signature

_______________________________________________
varnish-misc mailing list
[email protected]
http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to