httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Keith Mashinter <>
Subject [users@httpd] ENH 51247 - Enhance mod_proxy and _balancer with worker status flag to only accept sticky session routes
Date Tue, 24 May 2011 14:13:28 GMT

I've added a patch to the proxy/balancer to allow for route-only workers are only enabled
for sticky session routes, allowing for an even more 
graceful fade-out of a server than making its lbfactor=1 compared to 
lbfactor=100 for others.  

Please vote for it in bugzilla if you also think it's useful.
This enhancement, actually SVN Patched against 2.2.19, provides a worker status
flag to set a proxy worker as only accepting requests with sticky session
routes, e.g. only accept requests with a .route such as Cookie

This allows for a graceful fade-out of servers when their sessions are removed;
they continue to receive requests for their sticky session routes but are
passed over for requests with no specified route, just as if they were
disabled.  In other words, route-only workers are only enabled for sticky
session routes.

Intended use (Tomcat JSESSIONID noted here but could be PHPSESSIONID, Ruby
_session_id, or anything with cookie or request-parameter based session ids):
1. An Apache rev-proxy running for multiple Tomcats.
2. To fade-out a Tomcat for maintenance, set route-only enabled in
balancer-manager or reload the configuration with the worker status +R.
(This depends on Tomcat web-apps delete session cookies, see further below.)
3. Check on the balancer-manager or its Tomcat worker even a few minutes /
hours, and when it seems to have completed old sessions you can mark it fully
4. Once done maintenance, you can then set route-only disabled (status -R) and
fully enable the worker again.

To delete a JSESSIONID Cookie from a Servlet, you need to specify the same
Domain and Path as the original Cookie and setMaxAge=0 as in the typical
example below but you should check on your own Domain and Path when a Cookie is
created, e.g. watch the Cookie headers in Firefox Firebug.

// To delete a Cookie setMaxAge(0) and also any original domain and path if
Cookie ck = new Cookie("JSESSIONID", null);
\|/- Keith Mashinter
View raw message