4

We have a load balanced server farm using Tomcat 7. Once in a while (once a day, at least) a server's CPU load spikes way up. This appears to be legitimate server usage and not a fault, but I can't figure out how to identify what particular site usage is causing these CPU spikes.

Here are the tools we are using:

  • Javamelody, which shows long-running calls but not when they happened.
  • Zabbix, which shows CPU usage but not what's causing it.
  • The server logs, which, by management directive, only show the threads but not any statistics.

Is there some way to tie these together and find out what threads were running at the time of the spike?

Or is there a better tool we need to use?

ewwhite
  • 201,205

3 Answers3

2

Java Flight Recorder and Java Mission Control is worth a try if Oracle Hotspot Jdk 1.7u40+ runs Tomcat. Remember, you must run the JVM with the JVM argument -XX:+UnlockCommercialFeatures and provide JMX support to be able to connect to the Java process with JMC.

1

If this is reproducible or at least occurs daily, run NewRelic for a day (free tier) and try to capture this at the OS level... or integrate it into the application and obtain the detailed statistics. Very handy tool for something like this.


enter image description here

enter image description here

Edit:

Profiling is an option as well...

enter image description here

ewwhite
  • 201,205
1

We use a tool called psi-probe. It's more of a look at live data as opposed to looking back on a problem that occurred earlier. But it gives statistics for all your different webapps including connections, threads, traffic, etc.. It's decent for a free tool.

https://code.google.com/p/psi-probe/

Safado
  • 4,836