Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Which webapp is eating cpu cycles?

 
Ranch Hand
Posts: 37
Oracle Tomcat Server Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One of the tomcat instances on the server here will occasionally start using all available CPU cycles. This happens irregularly, about once a week.

I haven't found anything in the log files to indicate anything irregular. Is there some generic way to figure out which application is causing the problem?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unless you are doing something tricky and creating extra threads, what you describe is a request Thread getting into a loop. First you need to locate the application that is getting the long running thread.

If this was my problem I would get the latest JAMON and start with the simple servlet filter monitor to locate that long running request.

Bill
 
Eli Wood
Ranch Hand
Posts: 37
Oracle Tomcat Server Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

William Brogden wrote:Unless you are doing something tricky and creating extra threads, what you describe is a request Thread getting into a loop. First you need to locate the application that is getting the long running thread.

If this was my problem I would get the latest JAMON and start with the simple servlet filter monitor to locate that long running request.

Bill


Thanks for the idea.

After reading up on JAMon and filters, I think/hope I understand how this process would work. To use the servlet filter would require changes in web.xml of each application and probably redeployment. I think the HTTP Monitoring is another solution that might work without having to reconfigure and redeploy all the apps.

But I have a concern that may just be caused by thinking too much and understanding too little: if a request thread gets into an infinite loop, and I kill Tomcat to stop it, the request will have never been completed. In this case, will the logging event be processed, and will JAMon be able to help identify the problem?
 
JavaMonitor Support
Posts: 251
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Eli,

Try taking thread dumps when Tomcat is eating all cpu. Use kill -3 or jstack.

Kees Jan
 
Eli Wood
Ranch Hand
Posts: 37
Oracle Tomcat Server Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kees Jan Koster wrote:Dear Eli,

Try taking thread dumps when Tomcat is eating all cpu. Use kill -3 or jstack.

Kees Jan


Thanks for the idea! I haven't had to deal with this in a while (lucky I guess ) but I'll definitely take a look at your suggestions.
 
Kees Jan Koster
JavaMonitor Support
Posts: 251
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Eli,

I write a little piece on how to use stack dumps. It's a simple starter, but maybe you find it interesting nonetheless.

http://java-monitor.com/forum/showthread.php?t=317
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic