How do we determine which WebLogic thread is causing CPU contention using PsList?

Posted: April 21st, 2008 | Author: TnT Admin | Filed under: Analyze | Tags: , | No Comments »

As mentioned in the title, this is specified to WebLogic application instance. The purpose of doing this is to find out which thread is consuming the most CPU usage and what it is doing at that point of time. This is especially useful when your instance is running at 100% utilization and you want to troubleshoot the problem.

To do that, you have to download the utility, PsTools from Microsoft Sysinternals. PsTools has a command, PsList that can look at the thread level on the OS.

Pslist


Follow the instructions to install the utility.

1. Open command prompt, get the Process ID of the running application instance:

pslist processname -x

Where “Process Name” is usually java.exe. There should be more than one java.exe due to the application instance and the WebLogic instance. So you have to be sure of which console the application is on. The results returned should be the memory consumed and the amount of CPU utilization.

Pslist java

Pslist java -x


2. With returned results, look at the User Time (which represent the amount of application time consumed on the processor). Take note of the highest timing and the Thread ID also abbreviated as TID.

3. Go to the application instance console, perform a thread dump (Press “Crtl-Break”) and observe the dump. In JRockit JVM, you should be able to see a similar tid in decimals. While in Sun HotSpot JVM, it is called nid, in hexadecimal format which required you to perform conversion to decimal (use the scientific calculator to do it). (Prior to that, I would also redirect the console output to a log in the startup script.)

Thread Dump

4. Ok, now search for the Tid from Pslist in the thread dump. Recall the Tid that was output from pslist java -x, the values for Tid and tid are the same and nid in decimal format. Remember for Sun HotSpot, you need to convert the Tid from Pslist into hexadecimal to do the search. You should be able to find out the specified thread and drill down to the activity the thead is performing at that point of time. From there, it’s your call on the follow up actions such as reviewing the codes or examining the database for remedy.

Scientific Caculator

Related Posts



Leave a Reply