[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Tomcat High CPU Load

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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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 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 explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

649 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