Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Misc

Varnish director stickyness expiry/timeout

 

 

Varnish misc RSS feed   Index | Next | Previous | View Threaded


pom at dmsp

Jul 26, 2012, 2:02 AM

Post #1 of 2 (310 views)
Permalink
Varnish director stickyness expiry/timeout

Hello,

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.

In vcl_recv:

## Use ClientIP for loadbalancer stickyness (and regard SSL offloading)
if (req.http.X-Forwarded-Proto ~ "https") {
set req.http.X-Client-Identity = req.http.X-Forwarded-For;
if (req.http.X-Client-Identity ~ "\,") {
set req.http.X-Client-Identity =
regsuball(req.http.X-Client-Identity, "\s\,.*$", "");
}
}
else {
set req.http.X-Client-Identity = client.ip;
}
set client.identity = req.http.X-Client-Identity;

It seems that when a customer resturns after approximately 30 minutes
the stickyness is lost and the customer needs to login again.

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

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.

Any advice would be great. ;-)

Best regards,
Stefan

--

*Dipl.-Inform. Stefan Pommerening
Informatik-Büro: IT-Dienste & Projekte, Consulting & Coaching*
An der Kappe 171 B, 13583 Berlin, Germany, Email: pom [at] dmsp
<mailto:pom [at] dmsp>
Telephone(Office): +49-(0)30 / 375 84 888, Mobile: +49 - (0)179 / 394 80 72
Fax(Office): +49-(0)30 / 604 8594, http://www.dmsp.de <http://www.dmsp.de/>

Der Inhalt dieser E-Mail ist vertraulich und ausschließlich für den
bezeichneten Adressaten bestimmt. Wenn Sie nicht der vorgesehene
Adressat dieser E-Mail oder dessen Vertreter sein sollten, so beachten
Sie bitte, dass jede Form der Kenntnisnahme, Veröffentlichung,
Vervielfältigung oder Weitergabe des Inhalts dieser E-Mail unzulässig
ist. Wir bitten Sie, sich in diesem Fall mit dem Absender der E-Mail in
Verbindung zu setzen.


lasse.karstensen at gmail

Jul 26, 2012, 2:49 AM

Post #2 of 2 (309 views)
Permalink
Re: Varnish director stickyness expiry/timeout [In reply to]

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
input.

> 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
http://www.varnish-software.com/

_______________________________________________
varnish-misc mailing list
varnish-misc [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Varnish misc RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.