You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Patrick Wang <pw...@uclink.berkeley.edu> on 2006/08/16 00:09:45 UTC

Mod_jk sticky Session not working for distributed computer

Hi, All:

 

Here is the story, the vertical clustering seems working great, which means I
started two tomcat instances on the same machine and give them different worker
name.

Load balance/Sticky-NonSticky Session works like a charm.  I tried both sticky,
non-sticky session by open several browsers and kill one Tomcat Instance.

Sticky session will cause some client to die while the non-sticky session keep
all the clients happy. I am using the TOMCAT 5.0.28 and MOD_JK 1.2.18

 

Then I tried to run another Tomcat Instance on a separate machine with Tomcat
5.5 installed. If I only have one worker on this MACHINE, everything works
great. However

When I started the second worker on the original machine. Things happened
randomly, blank page will come up, then after a while some pages works again. So
it seems to me it was caused by

Sticky - session because if I removed some jsp pages on one application folder,
some error message will come up randomly in one's browser. It should not happen
because I turned on the sticky session.

 

Does anyone know why to display the worker name in the JSP or JAVA code so I can
show which worker service this request.

 

Thanks

Pat


RE: Mod_jk sticky Session not working for distributed computer

Posted by Patrick Wang <pw...@uclink.berkeley.edu>.
I have done further investigation by writing a simple diagnostic program to only
display the current JSP Session


<p>session is  <%=session.getId()%>, &nbsp;
Session MaxInactiveTime is <%=session.getMaxInactiveInterval()%>,&nbsp;
session creation time is <%=session.getCreationTime() %>, &nbsp;
Session last Access time is <%=session.getLastAccessedTime()%>
<%if (session.getAttribute("user")!=null)
 out.println(session.getAttribute("user")); 
 else out.println("No User"); %>
		</p>


I started 3 browser, verify that worker on 3 different workers, 

Then keep on hitting the IE browser, the 2 worker on the same machine is
consistent with the user and session id. Suddenly the browser with the worker on
the separate machine changed the SESSION.

The JVM on the remote machine is client, while the JVM on the local machine is
tuned for server.

Thanks
Pat

-----Original Message-----
From: Patrick Wang [mailto:pwang@uclink.berkeley.edu] 
Sent: Tuesday, August 15, 2006 3:10 PM
To: users@tomcat.apache.org
Subject: Mod_jk sticky Session not working for distributed computer

Hi, All:

 

Here is the story, the vertical clustering seems working great, which means I
started two tomcat instances on the same machine and give them different worker
name.

Load balance/Sticky-NonSticky Session works like a charm.  I tried both sticky,
non-sticky session by open several browsers and kill one Tomcat Instance.

Sticky session will cause some client to die while the non-sticky session keep
all the clients happy. I am using the TOMCAT 5.0.28 and MOD_JK 1.2.18

 

Then I tried to run another Tomcat Instance on a separate machine with Tomcat
5.5 installed. If I only have one worker on this MACHINE, everything works
great. However

When I started the second worker on the original machine. Things happened
randomly, blank page will come up, then after a while some pages works again. So
it seems to me it was caused by

Sticky - session because if I removed some jsp pages on one application folder,
some error message will come up randomly in one's browser. It should not happen
because I turned on the sticky session.

 

Does anyone know why to display the worker name in the JSP or JAVA code so I can
show which worker service this request.

 

Thanks

Pat



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org