Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Standalone tomcat 9 spikes CPU to 50% every 10 seconds while my web application is idle

I am using Tomcat 9.0.0.M22 with jdk1.8.0_131 on Windows Server 2012 R2 and I have a Spring Boot web application deployed on it, the issue is that every 10 seconds the commons daemon service runner spikes the cpu to 50% although my deployed web application is idle then decreases to 0% and this behavior continue to happen every 10 seconds.

In my application I don't have any job that runs every 10 seconds, and also when I run my web application on Tomcat from Eclipse I didn't notice the same behavior, so I am guessing that this is a Tomcat built in thread.

like image 417
Mahmoud Saleh Avatar asked Nov 07 '22 17:11

Mahmoud Saleh


1 Answers

  • do a series of thread dumps as soon as cpu load spikes
  • you can use jdk/bin/jvisualvm to connect to your tomcat and repeatedly press thread dump button on upper right of threads tab or if you prefer command line (e.g. via script), you can also use jdk/bin/jcmd <pid-of-your-tomcat> Thread.Print >> dumps.txt
  • each dump shows all threads existing at that moment and a stack trace for each thread showing what is being executed
  • this should give you some hints what's involved creating that load
like image 198
Jörg Avatar answered Nov 15 '22 06:11

Jörg