wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Http sessions inactive in Tomcat 6.0.35 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Http sessions inactive in Tomcat 6.0.35" Watch "Http sessions inactive in Tomcat 6.0.35" New topic
Author

Http sessions inactive in Tomcat 6.0.35

Sen Velan
Greenhorn

Joined: Aug 06, 2012
Posts: 3
Hi,

We have tomcat 6.0.35 installed and our webapp is deployed with idle timeout of 90 mins. We see sessions idle for more than 8 hours and is causing performance issues. Checked couple of forums but could not find a solution.

session time out for the webapp is set in web.xml for 90 mins.

Below is the server.xml for the tomcat instance.

<Connector port="8009" maxHttpHeaderSize="8192" minSpareThreads="25" maxSpareThreads="75" acceptCount="100" disableUploadTimeout="true" enableLookups="false" emptySessionPath="true" maxThreads="400" connectionTimeout="600000" protocol="AJP/1.3" redirectPort="8443"/>

Appreciate if someone could help resolving the issue.

Regards,
Senthil
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

Welcome to the JavaRanch, Senthil!

When you say "performance issues", do you mean memory consumption? Idle sessions shouldn't be consuming any CPU.

Tomcat's normal housekeeping should be purging those timed-out sessions, so either something keeps bumping their keep-alive timers, or there are some sticky linkages that prevent them from being garbage-collected. I can't be more accurate than that without further details, though.


Customer surveys are for companies who didn't pay proper attention to begin with.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
We see sessions idle for more than 8 hours


Exactly how are you "see"ing these sessions?

Since Tomcat is allowed to serialize idle sessions to disk if it wants to, how can that consume resources?

Invalidation of a session proceeds by unlinking all references so I don't think a "sticky" linkage is possible.

Bill
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

William Brogden wrote:
Invalidation of a session proceeds by unlinking all references so I don't think a "sticky" linkage is possible.


Never underestimate the ability of people to stuff references to session objects into static variables.

True, the session will have been disconnected, but the referenced objects will live on. And since we don't have particulars so far, I'm not sure what the word "session" actually is considered to mean in this case.
Sen Velan
Greenhorn

Joined: Aug 06, 2012
Posts: 3

Thanks Tim/Bill. I am attaching the Http session screenshot to the post. Issue is that when the session reaches a threshold of 1000 the webapp doesn't respond. We manually expire the sessions in Tomcat manager every 90 mins so that users can access the app.

We have Apache as the load balancer for tomcat and have worker.router.sticky_session=true set.

From your comments is see that the Tomcat's house keeping job is not purging the expired sessions. If so how to enable the job or troubleshoot why the job is not working as expected.

Thanks,
Senthil



[Thumbnail for inactvity time.png]

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

Have you been using this as a reference: http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html ?

If I read it correctly, an improperly-configured session manager won't scan for expired sessions and therefore won't release them.
Sen Velan
Greenhorn

Joined: Aug 06, 2012
Posts: 3

It is a standard installation of Tomcat and SAP Business Objects webapp has been deployed on it. I am completely new to tomcat and assigned to handle administration tasks. Would setting the processExpiresFrequency value to 1 or 2 in server.xml be helpful?

Regards,
Senthil
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Http sessions inactive in Tomcat 6.0.35