1

I am trying to understand how the session details are maintained for a JavaEE based web application that is deployed in a cluster of servers. I am new to clustering concepts so I am not clear on how it actually works.

I have gone through this SO post "How do servlets work? Instantiation, session variables and multithreading", where it says that the session details are maintained by the server where my web application is running and client is provided with JSESSIONID. Now suppose if I have a load balancer and my application is deployed to a cluster of servers say 3 servers, now if my first request is handled by Server1 and the Server1 has stored the session details on its RAM, then what happens to my subsequent request? Will load balancer still direct the request to Server1 or will it be handled by Server2/Server3?

Community
  • 1
  • 1
Chaitanya
  • 15,403
  • 35
  • 96
  • 137
  • It will be rely on the implementation of the application server. Tomcat 6 can use a shared file system, shared data base or a in memory with a TCP protocol with "automagical" propagation. More here: https://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html#Overview – André Mar 18 '14 at 20:10
  • More Tomcat info here: http://people.apache.org/~markt/presentations/2013-02-Apache-Tomcat-Clustering.pdf – Mark Thomas Mar 19 '14 at 09:23

0 Answers0