httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: load balancer and http(s) sticky sessions
Date Thu, 14 Sep 2006 19:50:30 GMT


On 09/14/2006 05:28 PM, Jim Jagielski wrote:
> There is a lot of confusion where the users think that
> simply adding the stickysession param to the http worker
> attribute *adds* the required sticky session info (cookie).
> 
> I'm looking into adding functionality that actually
> does that and therefore avoiding this large and common
> misconception.
> 
> Comments?

I guess this is nearly possible today, although it is not that easy to configure:

Header add Set-Cookie "MYCOOKIE=SOMEVALUE.%{BALANCER_WORKER_ROUTE}e; path=/;"
ProxyPass /test balancer://mycluster/test stickysession=MYCOOKIE nofailover=On

(which sets the cookie over and over again of course)

See also
http://mail-archives.apache.org/mod_mbox/httpd-dev/200606.mbox/%3c44A10328.7010601@apache.org%3e

What is currently missing from my perspective is to set an environment variable inside of
mod_proxy_balancer (e.g. BALANCER_ROUTE_CHANGED) if the supplied route and the chosen route
is different.

So we could do something like the following

SetEnvIf Cookie  MYCOOKIE HAVE_ROUTE
Header add Set-Cookie "MYCOOKIE=SOMEVALUE.%{BALANCER_WORKER_ROUTE}e; path=/;" env=!HAVE_ROUTE
Header add Set-Cookie "MYCOOKIE=SOMEVALUE.%{BALANCER_WORKER_ROUTE}e; path=/;" env=BALANCER_ROUTE_CHANGED
ProxyPass /test balancer://mycluster/test stickysession=MYCOOKIE nofailover=On

or even

Header add Set-Cookie "MYCOOKIE=SOMEVALUE.%{BALANCER_WORKER_ROUTE}e; path=/;" env=BALANCER_ROUTE_CHANGED
ProxyPass /test balancer://mycluster/test stickysession=MYCOOKIE nofailover=On

if BALANCER_ROUTE_CHANGED is also set if balancer->sticky is set and no route was found
in the request.

In general I would like to avoid that we reinvent the wheel for this, as nearly all ingredients
seem to be available right now. See also my comments in

http://mail-archives.apache.org/mod_mbox/httpd-dev/200606.mbox/%3c44A1494E.8000905@apache.org%3e


Regards

RĂ¼diger

Mime
View raw message