Few days back we started facing problem with Tomcat server. The problem Tomcat was facing of abrupt hanging issue when application goes on peak on Sun Solaris.
So I would like to highlight the action taken to fix the issue.
1. Thread dumps : They have played a crucial part in identifying the Hang issue on Tomcat.
Please read the article to fecth Threads dumps on Tomcat.
2. Max Thread: The real problem I have identified was of Maximum Threads allocation was very less defined (40).
<Connector connectionTimeout=”20000″ maxThreads=”300″ port=”8080″ protocol=”HTTP/1.1″ redirectPort=”8444″/>
3. DBCP : Few connections were blocking the threads, statement timeout was -1. and plenty of leaked connections. And after that we have observed the issue on Tomcat got resolved.
4. Max Wait: Maximum time to wait for a dB connection to become available in ms, An Exception is thrown if
this timeout is exceeded. Set to -1 to wait indefinitely. And this was found to be the culprit. Again we have configured it to 10000 insted of -1 (But it always depend upon your requirements).
Set this in
<Tomcat home>/conf/server.xml [ context path ]
5. Disable SSLEngine in the AprLifecycleListener directive (server.xml)
<Listener className=”org.apache.catalina.core.AprLifecycleListener” SSLEngine=”off” />
Hope this helps.