tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Help with Tomcat 7 clustering using BIO receiver
Date Thu, 03 Jul 2014 21:51:15 GMT
Hash: SHA256


On 7/3/14, 2:19 PM, Mark Eggers wrote:
> João,
> This list has a convention of posting either inline or at the end
> of the message you're replying to.
> See here for mailing list notes:
> On 7/3/2014 10:24 AM, João Sávio wrote:
>> Hello
>> Some points below:
>> ** What is "on time"?* In my application, a group of users should
>>  always hit the same node after the first request. So, in first 
>> request each group of users will receive an specific cookie, and 
>> LB will perform the load balancing based on this cookie. In first
>>  request, a user can hit any node, but from the second, he or she
>>  should hit the same node.
> Hmm, so 'on time' really means that subsequent requests should hit
> the same server.
> If you're using sessions, Tomcat has an attribute on the Engine 
> element called jvmRoute. So depending on your load balancer (and
> if you use AJP), you can use Tomcat and AJP to route traffic. In
> that case, there's no need to write a special cookie.
> At any rate, this doesn't sound like a clustering error per se.

I wonder if the real problem is a race condition: the cluster can't
replicate fast enough to stabilize before the second request comes in,
plus the lb configuration might not be correct.

João, can you confirm that request #1 and #2 are definitely hitting
the same Tomcat instance?

If you connect to TomcatA, set a session attribute, then reconnect to
TomcatA and get that session attribute, then it should be the same
unless something is awfully wrong. You don't even need to have
clustering enabled to test the above.

However if you hit TomcatA, set a session attribute, then connect to
TomcatB and try to get that session attribute, your request may have
arrived too early for the cluster to have pushed-out the session
attribute change.

So, if you can prove that both requests have gone to TomcatA and you
are getting "errors", then there are several possibilities:

1. Tomcat has a huge bug and no web applications would work worldwide.
2. You are mishandling the "setting" of the session attribute
3. You are wrong about which server the client is hitting

- -chris
Version: GnuPG v1
Comment: GPGTools -
Comment: Using GnuPG with Thunderbird -


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

View raw message