Troubleshooting CPU bottlenecks on the Apache Tomcat application server can be challenging. Since Apache Tomcat is running as a Java Virtual Machine, understanding which JVM threads are consuming the overall Tomcat CPU can be a bit of a black box since this information is not easily accessible in regular monitoring tools. Recently, I have discovered a brilliant new tool called JVMTOP which provides direct insight into the performance of threads running on a Java Virtual Machine. Additionally, JVMTOP also shows in real-time which threads are blocked and also the id of the thread it is currently waiting on. In this article, I will provide a demonstration on how this tool works and what information you need to collect once you have identified the problematic Java thread(s) so that SAP can perform a deeper root cause analysis. Note that although this example is based on Apache Tomcat, JVMTOP will also work when troubleshooting CPU issues with the Adaptive Processing Server / Adaptive Job Server (child processes).
I have made some modifications to the JVMTOP application (updated the executable jar manifest for ease of use) and created a new batch file to launch the application. Download the version linked from this article when following this tutorial. Note, if your Apache Tomcat currently uses Oracle JVM, you should configure it to use SAP JVM instead. For instructions, refer to How to configure Tomcat to use SAP JVM instead of Oracle JVM - Business Intelligence (BusinessObject...
COLUMN | DESCRIPTION |
---|---|
TID | JVM thread ID |
NAME | Name of JVM thread |
STATE | The state that the thread is currently in |
CPU | Current CPU utilization (in ratio to available cpu time on all processors) |
TOTALCPU | CPU utilization (in ratio to process cpu consumption) since the thread is alive |
BLOCKEDBY | If this thread is blocked, this column shows the thread id which is blocking this thread |
Now that we have identified the offending thread, we need to generate a thread dump so that we can analyze the call stack of the code currently being executed by this thread. SAPJVM includes a utility called JVMMON which makes creating thread dumps very easy to do without a lot of additional configuration.
For more information about JVMTOP, you can visit the homepage at: Documentation - jvmtop - Java monitoring for the command-line - Google Project Hosting |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
27 | |
27 | |
13 | |
13 | |
12 | |
12 | |
10 | |
7 | |
7 | |
6 |