Solved

Tomcat High CPU Load

Posted on 2013-05-31
4
1,355 Views
Last Modified: 2013-06-03
I am running Tomcat 7 to use Jasper Reports on CentOS release 5.6 64 bit. Many times the CPU load avg on machine goes very high (above 4) and remains there unless I don't restart tomcat. Top shows java taking over 99% CPU.

This is only running Jasper Reports and no other Java apps are there. Is there a way to find out which report has made this running for that long?
0
Comment
Question by:sysautomation
  • 2
4 Comments
 
LVL 27

Accepted Solution

by:
mrcoffee365 earned 500 total points
ID: 39210880
Are you the developer?  If so, then put some logging in, or run Tomcat under Eclipse.

If you're not the developer, and you don't have a way to turn on more logging than you are getting, you'll have to check all the things which come by default with Tomcat and your dbms.

So -- check the Tomcat logs.  What requests came in when the system went up to 4?
Check your database.  Almost certainly the problem is a bad sql query, so you can look in the open queries in your database, if you have that capability.  The commercial databases have ways to do that built-in, ones like MySQL tend not to, so you'll have to get some tools to help you, or ask your DBA.

There's a trick to get the stack trace of a running JVM like Tomcat:
from the tomcat console, CTRL-BREAK dumps the current process stack.
Or
kill -3 1234 --> where 1234 is the process number
0
 
LVL 16

Expert Comment

by:Valeri
ID: 39215895
it could be problem with your connector. please check this:
http://www.coderanch.com/t/86515/Tomcat/Tomcat-Connector-high-cpu-usage
0
 
LVL 27

Expert Comment

by:mrcoffee365
ID: 39216130
Valeri - just be aware that that post is from 2004.  So it's for ... Tomcat 4?  In any case, Tomcat doesn't ship with the server.xml spec  shown in that question.  And there are not known problems with connectors going to 100% in Tomcat.  

As I said, the likelihood is high that this is a database problem.  Since the asker believes that the problem is in JasperReports, it could also be a problem with a bad report specification, but the db queries and handling is the place to start.  Naive users of databases and Jasper also have a tendency to never close db connections, which will also take the system to 100% after a while.
0
 

Author Closing Comment

by:sysautomation
ID: 39216184
Thanks.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Error in @AspectJ Based AOP with Spring 2 13
ifconfig 4 46
Android development question 2 37
winscp 000webhost.com 6 54
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This video teaches viewers about errors in exception handling.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question