You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by royster <ro...@gmail.com> on 2014/03/27 11:04:44 UTC

[users@httpd] Session stickiness stops working for no reason

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://A2.xxx.net:8009 route=route1 keepalive=On ping=3
  BalancerMember ajp://A3.xxx.net:8009 route=route2 keepalive=On ping=3
  ProxySet stickysession=JSESSIONID|jsessionid lbmethod=byrequests
timeout=20
</Proxy>

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 10.28.72.2:24007] AH01176:
proxy_balancer_post_request for (balancer://mybalancer)
mod_proxy_balancer.c(292): [client 10.28.72.2:21164] AH01160: Found value
E8F368E83EF92643FAD57F210628437C.route1 for stickysession JSESSIONID
mod_proxy_balancer.c(303): [client 10.28.72.2:21164] AH01161: Found route
route1
mod_proxy_balancer.c(615): [client 10.28.72.2:21164] AH01172:
balancer://mybalancer: worker (ajp://A3.xxx.net:8009) rewritten to
ajp://A3.xxx.net:8009/

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: http://apache-http-server.18135.x6.nabble.com/Session-stickiness-stops-working-for-no-reason-tp5013169.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org