Varnish director stickyness expiry/timeout

Lasse Karstensen lasse.karstensen at
Thu Jul 26 11:49:32 CEST 2012

Stefan Pommerening:
> For a web shop project I am using varnish for loadbalancing (and
> caching of course) several web servers.
> When it comes to session stickyness I am using the client.ip
> stickyness of the backend director.
> It seems that when a customer resturns after approximately 30
> minutes the stickyness is lost and the customer needs to login
> again.

There is no state stored in the client director. client.identity is the only

> Is there any timeout / expiry value I can change in order to prolong
> the director stickyness?

The hashing done by the random and client directors are not consistent, so
if a backend of yours has gone away then all connections are reshuffled.

> What I've found is the sess_timeout value which is configured to be
> 5 seconds as a default value
> which doesn't fit our experience but still sounds somehow like the
> wrong place.

sess_timeout isn't related to this.

I would check that there are no such timeouts on any firewalls/
ssl-terminators in front of Varnish, or if your applications session cookies
expires after 30 minutes.

Lasse Karstensen
Varnish Software AS

More information about the varnish-misc mailing list