Solved

Tomcat High CPU Load

Posted on 2013-05-31
4
1,315 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 26

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 26

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now