tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juha Laiho <Juha.La...@iki.fi>
Subject Re: CPU utilization and Tomcat 5.5.20
Date Fri, 03 Oct 2008 20:39:38 GMT
Reis, Tom wrote:
> We are running Tomcat 5.5.20 with jvm 1.5.0_14. Tomcat utilization goes
> to 100 percent being used by Tomcat. Any ideas why the utilization would
> go so high. Thanks. 

Please let us have more infromation.

Upon startup, it is typical of Tomcat to be very CPU-intensive for a while
(length of the time is of course dependent on the CPU power available
and application workload placed on the server).

Other than that, the JVM running Tomcat will be largely idle, unless it is
serving requests (with the exception of running the JVM to a memory
exhaustion state, in which case the JVM can pretty much sit in a loop
running garbage collection).


So, clarifying questions;
- are you referring to the 100% CPU usage right after startup
  (could take 10 seconds; could take a couple of minutes, depending
   on details)
- is your Tomcat JVM running at its allocated heap limit
- are there requests being served while the CPU is fully utilized
- are you seeing this on a Tomcat with none of your own applications
  installed, or on a Tomcat having your applications deployed

Depending on your OS platform, you might be able to look at CPU usage
in individual threads within the JVM, and combine this knowledge with
a thread dump from the Tomcat JVM instance, in order to see which are
the busy threads (GC thread, worker thread, something else), and also
to see at least a momentary stack dump of the busy thread (in other
words, you might be able to see what code is running in the busy
thread). You could also enable GC logging, to see whether there is
excess garbage collection activity within the JVM (which would indicate
either a memory leak or a too small JVM heap allocation).

My first two claims would be:
- it is caused by your application code (or libraries brought in with
  your application code)
- it could be that your application code (or libraries...) is running
  against the JVM memory limit, making it run garbage collection in
  an endless loop (and if you let it stay that way long enough, it'll
  crash with an OutOfMemoryError)

but I could just as well be wrong. It could also be some code in
Tomcat getting stuck in an endless loop. It's just that bugs seem
to be less common in Tomcat than in the typical webapps I see.
-- 
..Juha

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message