tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Rifel <>
Subject Re: Session Clustering Monitoring
Date Mon, 12 Jan 2015 21:32:45 GMT

On 1/12/15, 11:36 AM, "Christopher Schultz" <>

>Hash: SHA256
>On 1/12/15 2:28 PM, Peter Rifel wrote:
>> Chris,
>> On 1/12/15, 11:08 AM, "Christopher Schultz"
>> <> wrote:
>> Peter,
>> On 1/12/15 12:51 PM, Peter Rifel wrote:
>>>>> I'm running Tomcat 8.0.15 with Java 1.8.0_25 on Ubuntu 14.04.
>>>>> We have 5 instances that are all setup with session
>>>>> clustering as follows:
>>>>> <Cluster
>>>>> className="org.apache.catalina.ha.tcp.SimpleTcpCluster">
>>>>> <Manager
>>>>> className="org.apache.catalina.ha.session.DeltaManager"
>>>>> stateTransferTimeout="5" /> <Channel
>>>>> className="">
>>>>> <Membership 
>>>>> className="org.apache.catalina.tribes.membership.McastService"
>address="${multicast}" /> </Channel> </Cluster>
>>>>> -Dmulticast=
>>>>> To help prevent accidental misconfigurations that have
>>>>> occurred in the past, I decided to implement monitoring on
>>>>> the session replication by checking the JMX mbean
>>>>> Catalina/Manager/<host>/<context>/activeSessions attribute.
>>>>> Most of the time the values for the 5 instances are all
>>>>> within 1 or 2 of each other. Over the weekend we consistently
>>>>> had one instance that had more sessions than the other 4. It
>>>>> began with 102 sessions where every other instance had 95.
>>>>> Over the next 36 hours as more sessions were expiring over
>>>>> the weekend, the difference grew to 49 vs 29. Eventually it
>>>>> resynced and now they all report the same active session
>>>>> count. My question is, does anyone know why this would
>>>>> happen, and if this can be expected is there a better way to
>>>>> monitor session replication to ensure that there isn't one
>>>>> instance that isn't being replicated to? I believe this only
>>>>> happens on weekends when most sessions are expiring and very
>>>>> few are being created but I may be wrong.
>> How is your load-balancer configured to distribute traffic?
>>> Two of the instances are behind one load balancer, and the other
>>> 3 are behind another.  They each provide a different service but
>>> are running the same war application and we want sessions
>>> clustered across both services. Each load balancer's initial
>>> distribution is based on the least number of connections, with
>>> persistence based on source IP.
>So basically all requests are randomly sent to back-end nodes? Or are
>you using session stickiness or anything like that?

Sorry, I should have clarified.  Stickiness is based on the source ip, so
requests from the same IP will be routed to the same instance.  With these
applications we don't expect sessions to change Ips very often if at all,
but if you think it would help I could stick based on the JSESSIONID

>- -chris
>Version: GnuPG v1
>Comment: GPGTools -
>To unsubscribe, e-mail:
>For additional commands, e-mail:


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

View raw message