Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tomcat on Solaris: slow first request after idle time

Status
Not open for further replies.

scsalmon

Programmer
Aug 25, 2004
1
US
We have a very simple J2EE application deployed on Tomcat 4.1.24 using j2sdk1.4.0_04 on Solaris (SunOS artsan 5.9 Generic_112233-11 sun4u sparc SUNW,Sun-Fire-480R). The server has 4 processors and 16GB RAM and is not used at all for any other applications.

After starting Tomcat, the application responds fine. However, the first request to the application AFTER SEVERAL HOURS OF IDLE TIME is very slow. For instance, Tomcat is restarted Monday 9AM. Throughout Monday, requests are handled fine. But when everyone leaves at 5pm, there are no requests until Tuesday at 9AM. And at Tuesday 9AM, the requests are really sluggish. Sometimes it takes 30 seconds, sometimes 2 minutes just to launch the login screen. There have been many occassions where the first request Tuesday 9AM results in Tomcat crashing, and we have to restart Tomcat manually, without any exceptions or problems noted in any of the logs.

Is Tomcat in general very slow on the first request after idle time, given the above platform specs? There is nothing in the Tomcat or application logs that indicates any problems.

I just wanted to get some feedback on certain tweeks that might need to be made possibly in the server.xml for optimizing performance after several hours if not days of idle, stagnant non-usage time. We even have the following set in the startup script:

-Xms2048M -Xmx2048M

Any help would be very appreciated, as I am a novice Solaris/UNIX user. Thanks!
 

The JVM is probably being paged out of memory and onto disk. The JVM is a memory pig and if it isn't being used will probably be first on the list to get swapped out and then it takes a significant amount of time to read back in.

I think there used to be directives under Solaris to pin pages in memory, I think we used them for Oracle, but I don't remember what they are.

Barring that, add more memory, take away the swap.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top