httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From royster <>
Subject [users@httpd] Session stickiness stops working for no reason
Date Thu, 27 Mar 2014 10:04:44 GMT
We're running Apache 2.4.7, fronting Tomcat app servers.

We are noticing that often mod_proxy_balancer completely ignores the tomcat
route id and hands the inbound http request to the other node.  Hence, new
JSESSIONID is assigned and user loses their session.

Here's the relevant apache configs (both nodes have same config):

<Proxy balancer://mybalancer>
  BalancerMember ajp:// route=route1 keepalive=On ping=3
  BalancerMember ajp:// route=route2 keepalive=On ping=3
  ProxySet stickysession=JSESSIONID|jsessionid lbmethod=byrequests

And tomcat configs:

<Engine name="Catalina" defaultHost="localhost" jvmRoute="route1">
<Engine name="Catalina" defaultHost="localhost" jvmRoute="route2">

I enabled debug for proxy_balancer and here's what I see:

mod_proxy_balancer.c(668): [client] AH01176:
proxy_balancer_post_request for (balancer://mybalancer)
mod_proxy_balancer.c(292): [client] AH01160: Found value
E8F368E83EF92643FAD57F210628437C.route1 for stickysession JSESSIONID
mod_proxy_balancer.c(303): [client] AH01161: Found route
mod_proxy_balancer.c(615): [client] AH01172:
balancer://mybalancer: worker (ajp:// rewritten to

You can see here A3 was selected, despite the fact that route1 is mapped to
A2 and should have been selected instead!  What gives?  There's no error
reported WRT A2 (above is the error log), so what could it be?

A quick fix may be to turn set nofailover=ON, but I really want to
investigate why it's doing this.  It happens frequently, and it may be
correlated to when the tomcat node may be under moderate load, but I'm not
entirely sure.  During these times, I've checked the number of connections
in Tomcat (via netstat) and they're well under the maxThreads setting for
AJP connector.

The docs also state fail over can happen if the targeted worker is in
"error" state.  But I can see it service unrelated requests right after. 
Besides nothing in the log to indicate so...I am really at a loss here.

Any advice on troubleshooting this would be appreciated!

View this message in context:
Sent from the Apache HTTP Server - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message