From: "Caldarale, Charles R" <[EMAIL PROTECTED]>
To: Tomcat Users List <users@tomcat.apache.org>
Subject: RE: Session timeout related fixes between Tomcat 5.0 and Tomcat
5.5.x?
> From: andre John Mas [mailto:[EMAIL PROTECTED]
> Subject: Session timeout related fixes between Tomcat 5.0 and
> Tomcat 5.5.x?
>
> Basically what is happening is that, despite the idle
> time-out being set for 20 minutes we are seeing sessions
> that have been idle (have not been accessed) for over
> 3 hours.
Do you have keep alives enabled? Look at the maxKeepAliveRequests
attribute:
http://tomcat.apache.org/tomcat-5.5-doc/config/http.html#Standard%20Implementation
Is your webapp caching sessions for any reason? Can you implement a
SessionListener to see if expiration events are occurring?
> The net result is that the Tomcat server needs to get restarted.
Why? Are you running out of heap space? Do you have a memory leak
elsewhere as well?
> One parallel line of analysis is to find out if there were
> any fixes between 5.0.x and 5.5.x, that are related to
> sessions not timing out.
The changelog is here for your perusal:
http://tomcat.apache.org/tomcat-5.5-doc/changelog.html
I have implemented a session listener and also activated access logs. The
session listener adds a list with sessionCreated() and removes them with
sessionDestroyed(). I then have a JSP that displays the list, along with
when the session was created, using getCreationTime(), and when the session
was last accessed, using getLastAccessedTime(). If a session has already
been invalidated by the container I will get a IllegalStateException when I
call getCreationTime() on the session I am getting the information from. An
example output of my tool is:
<sessioninfo count="581" maxLife="657.410" maxIdle="636.710" >
<session id="54D57E020A2791CDDDE6307E7565C328" life="657.410"
idle="632.789" />
<session id="6EE000B43250CC6CEDCD3B2D95A5A79B" life="657.039"
idle="616.064" />
<session id="8CE0C68E1098C291D69F70FEB4EFC631" life="641.774"
idle="636.710" />
<session id="10C182293F0CBA68291AF2C439E6058A" life="104.579"
idle="65.900" />
<session id="F62A60B0037D09D44B7F27E549A4D6B1" life="104.336"
idle="74.971" />
<session id="CAC0CA3066737D8316CBABB7E960EDBC" life="104.195"
idle="98.052" />
<session id="FD8CCFF63428DE1C50A668DF27C2865D" life="103.911"
idle="64.812" />
<session id="874032F034F3E12C911C9152632C5D7D" life="101.407"
idle="99.031" />
</sessioninfo>
- life is current time - creation time.
- idle is current time - last accessed time.
When I speak to our operations team they tell me that the server crashes
because it is unable to create any more sessions, so it is possible we are
out of heap space. The logs show me that at least half of the sessions are
idle for more than 30min. I could probably add more information to the tool
to display memory usage.
The other issue is that we are having trouble reproducing this in a
development environment, so it is making our life just a bit harder.
The changelog that you pointed me to only seems to cover changes from 5.5
onwards. There is nothing there covering 5.x previous to that. Are there any
older logs available anywhere?
Andre
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]