my dog learned polymorphism*
The moose likes Tomcat and the fly likes Tomcat 6.0.16 using 100% of CPU? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat 6.0.16 using 100% of CPU?" Watch "Tomcat 6.0.16 using 100% of CPU?" New topic
Author

Tomcat 6.0.16 using 100% of CPU?

M Burke
Ranch Hand

Joined: Jun 25, 2004
Posts: 388
Tomcat 6.0.16 running on JVM 1.6 Windows 2003 occasionally uses 100% of CPU(sometimes during off peak hours) .Is there any way to find out which thread is consuming the most CPU ? How can we do a thread dump if needed.Though I have specified a timeout in my config file, I see some request threads(like for a image) with enormous processing times.Could this be the culprit.How can we go about resolving this issue.

These are the configurations in server.xml

<Connector port="8080" protocol="HTTP/1.1" redirectPort="8443" address="localhost"

enableLookups="false" disableUploadTimeout="true"

maxThreads="200" acceptCount="100" connectionTimeout="120000" maxHttpHeaderSize="4096" />

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"

maxThreads="150" scheme="https" secure="true"

clientAuth="false" sslProtocol="TLS" />

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"

enableLookups="false" disableUploadTimeout="true"

>
Kees Jan Koster
JavaMonitor Support
Rancher

Joined: Mar 31, 2009
Posts: 251
    
    5
Dear Burke,

Here is how to make and analyse thread dumps: http://java-monitor.com/forum/showthread.php?t=317 http://java-monitor.com/forum/showthread.php?t=616

You will need to translate the way of working to match your specific question, but I am sure you will manage.

Let us know what you find.

Kees Jan


Java-monitor, JVM monitoring made easy <- right here on Java Ranch
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16158
    
  21

jconsole may help.

I've been known to actually pause each running thread in Tomcat using a debugger in some obscure cases, though, just to look at what was on the procedure stack.


Customer surveys are for companies who didn't pay proper attention to begin with.
sateesh narahari
Greenhorn

Joined: Jan 11, 2010
Posts: 3
M Burke wrote:Tomcat 6.0.16 running on JVM 1.6 Windows 2003 occasionally uses 100% of CPU(sometimes during off peak hours) .Is there any way to find out which thread is consuming the most CPU ? How can we do a thread dump if needed.Though I have specified a timeout in my config file, I see some request threads(like for a image) with enormous processing times.Could this be the culprit.How can we go about resolving this issue.

These are the configurations in server.xml

<Connector port="8080" protocol="HTTP/1.1" redirectPort="8443" address="localhost"

enableLookups="false" disableUploadTimeout="true"

maxThreads="200" acceptCount="100" connectionTimeout="120000" maxHttpHeaderSize="4096" />

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"

maxThreads="150" scheme="https" secure="true"

clientAuth="false" sslProtocol="TLS" />

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"

enableLookups="false" disableUploadTimeout="true"

>


You can download Tcat Server ( Disclaimer: I work on the product), which shows you the CPU and memory utilization and also shows you the current status of all threads running in Tomcat. That would be another way to look at threads ( in addition to what Tim and others suggested ).

Best Regards,
Sateesh

 
jQuery in Action, 2nd edition
 
subject: Tomcat 6.0.16 using 100% of CPU?