[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Tomcat High CPU Load

Posted on 2013-05-31
4
Medium Priority
?
1,544 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 1000 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month18 days, 5 hours left to enroll

830 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