httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: [users@httpd] Load balancing problem
Date Tue, 08 Jan 2008 17:09:59 GMT
Hi again,

        I tried your suggestion but couldn't get it working for me.   It 
got me thinking, though, and what I did was add a different JSP page to 
the application that sets a cookie, correctly formatted (you're right it 
expects the cookie to be 'value.route') to indicate the server that it 
came from, and then redirects to the start page of the application.  That 
works a treat for our purposes.

        Thanks for your help!


"Axel-Stephane  SMORGRAV" <> 
08/01/2008 12:45
Please respond to


RE: [users@httpd] Load balancing problem

Hello there,

Although I am not very experienced in using proxy_balancer, I did 
experiment with it a little bit a while ago.

>From what I remember, it expects the route to be appended to the balancer 
cookie value. In your example it is expecting a cookie of 
JSESSIONID=0000K8zpkCtCy6l9Y91Q86bETpX:-1.1 or 

If a valid route is not found in the cookie, it will not apply stickiness.

Unless you can actually yourself determine part of the value of JSESSIONID 
in order to include a route which can be interpreted by proxy_balancer, 
JSESSIONID is not a good balancer cookie. What I did myself was to set a 
cookie on the browser whenever I detected a request not containing a 
balancer cookie.

        RewriteMap  bID rnd:/path/

        RewriteCond %{HTTP_COOKIE}      !BALANCER=route
        RewriteRule . - [CO=BALANCER:route.${bID:rand}:%{ENV:domain}]

The file may contain:

rnd              1|2|3|4

Another way of setting the cookie would be to direct a request not 
containing a cookie to a specific path on the application server, let the 
balancer determine which application server that should be, and let the 
application server set a cookie corresponding to itself.

        RewriteCond %{HTTP_COOKIE}      !BALANCER=route
        RewriteRule . /myapp/setbalancercookieandcreatesessionobject

or something like that.

It would be interesting to know what others are doing on that subject.



De : [] 
Envoyé : mardi 8 janvier 2008 13:06
À :
Objet : [users@httpd] Load balancing problem


        I am running httpd version 2.2.6 on Windows XP SP2.  I am trying 
to use sticky sessions to route users to a server, based on the value of 
the JSESSIONID cookie in their request.  While the load balancing does 
appear to work, the sticky sessions don't appear to be working.  My 
configuration looks like this: 

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:

View raw message