Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat consuming high CPU

Tomcat.exe is consuming 75% of CPU. Is anyone having any idea why it happens and how can that be decreased?

I am using Tomcat5.5 & J2SDK v 1.4.2_12

like image 912
Miral Avatar asked Apr 22 '09 16:04

Miral


People also ask

Why is CPU usage so high in Tomcat?

High CPU usage appeared after a system update that can change permissions to access folders and files. Thus the reason for high CPU usage can be external to the web application and also external to Tomcat container.

Is Apache Tomcat running at 98% CPU?

Apache Tomcat - Performance Issue (CPU Usage at 98%!) Since 13.2, we have had a performance issue. Twice now I’ve found tomcat9.exe process using more than 50% CPU on this server. Right now, it’s using >97% CPU continuously.

How to monitor Tomcat performance?

Lambda Probe is a very handy tool for monitoring Tomcat. Are you using a quad CPU system? Probably Tomcat is running 100% in 3 of them. I would first test for an infinite loop or something like that in an application.

Why is my Tomcat running at 100%?

Probably Tomcat is running 100% in 3 of them. I would first test for an infinite loop or something like that in an application. Show activity on this post. First of all (this applies to all java applications) you must pin down which thread is using CPU.


1 Answers

If you're using 75% CPU and dont understand why, I suggest you issue a kill -3 to the tomcat process (ctrl-break if you have a console) to get a thread dump (when the load is high!). In my experience most threads should either be idle or in io-wait. Look for any single branch of code that has repeated occurences in the stack traces and that's your likely culprit (non-io waits!). This is the "poor man's profiler" that is quite often the best and most efficient way to solve these problems.

like image 196
krosenvold Avatar answered Sep 20 '22 02:09

krosenvold