Solved

Tomcat High CPU Load

Posted on 2013-05-31
4
1,409 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

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…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

734 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