top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Why do sticky sessions matter when session replication turned on in Tomcat

0 votes

- Two physical servers each running Tomcat 7.0.42
- Brocade load balancer in front

The load balancer is set to source IP persistence for 5 minutes. This time can be changed of course.

The thing I don't understand is 5 minutes or 5 hours - at then end that time limit the user can be sent to the other server and lose data stored in the session.

So why do sticky sessions matter when session replication turned on in Tomcat? Is a performance issue?

posted Jul 24, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Sticky sessions aren't really necessary when session replication is on. On the other hand, session information takes non-zero time to propagate between the members of the cluster, so using session
stickiness may reduce the risk of out-of-date sessions when a user randomly switches servers in the middle of a series of high-rate requests.

I would recommend setting the stickiness timeout to the same as the session timeout, assuming that the lb is updating the last-touch time for every request mentioning the session. If that's not happening, then it probably doesn't really matter what you set your session stickiness timeout to be.

answer Jul 24, 2013 by anonymous
Similar Questions
+1 vote

What can be done to guarantee failover in below scenario:

2 tomcats behind cisco loadbalancer
1 http request can last very long about 50 seconds - response from webservice can take so long
load is 200 requests per second
I must response in max 4 seconds more than backing webservice

is there something like http request replication ?

50 s * 200 req/s = 10.000 pending requests

if one tomcat is eg killed, can in any way other tomcat serve his requests ?
Is there any out of the box solution, eg similar to session replication ?

+1 vote

I think we can do it through the web.xml file located in tomcatconfweb.xml and then restart Tomcat.

Is there a difference if I change it in the tomcatconf location versus tomcatwebapps[web app name] web-infweb.xml location?

If I change the web.xml file in the tomcatconfweb.xml location will it override the web app location?

+1 vote

I'm trying to figure out how I can create custom session cookies. I've found the Manager interface for creating the sessions, but there's nothing about the actual session cookie. I don't see anything in the Valve interface that will let me do this either. Is this possible in Tomcat 7 (or 8?).

0 votes

What is the procedure to disable entirely the session (JSESSIONID) within tomcat 7 ?

+3 votes

We have currently started using tomcat 7.0 in our development environment. Following are the configuration Details :

Tomcat Version : 7.0.55
Java Version :

We have a requirement to implement clustering for one of our applications . The same application's active but idle sessions need to be persisted to a JDBC store . We have a small cluster of just two nodes so as recommended we need to use DeltaManager but for session persistence we need to use PersistentManager . PersistentManager is not recommended for clustering as the session data is not swapped out in real time.As far as I understand , we can only use one of the manager configurations .

Can you please let me know if it is possible to achieve session persistence along with clustering , If yes how can we achieve the same ?