Call Me at +91 7798846928 for Trainings

My photo
I am a Middleware Trainer and Consultant for Websphere (WAS, MQ), Weblogic, SOA and JBOSS Administration. Drop a mail to kvn@live.in for trainings and videos or call on +91 7798846928 for details.

Monday, February 24, 2014

How to automate Thread Dumps in Websphere Application Server ?

WebSphere Application Server attempts to report potentially hung threads using the hung thread detector. Depending on how the hung thread detector policy is configured, a thread running for a certain interval (default 10 minutes) might be reported as hung and a WSVR0605W message is printed in the SystemOut.log file:
WSVR0605W: Thread <threadname> has been active for <time> and may be hung.  There are <totalthreads> in total in the server that may be hung.

By setting a WebSphere custom property, the hung thread detector will automatically generate a javacore, or print a thread dump in the native_stdout.log for Solaris and HP-UX, when a WSVR0605W message is written out to the SystemOut.log file. Javacores/thread dumps are needed for determining what code is running in the potentially hung thread, if the reported hung thread is blocked by other threads, and/or if bottlenecks exist in the JVM.
The com.ibm.websphere.threadmonitor.dump.java property was enabled in WebSphere Application Server V6.0.2.29, 6.1.0.19, 7.0, 8.0, 8.5 and later.
Set the com.ibm.websphere.threadmonitor.dump.java property to true. Where?

Detailed Steps:
1. Log on to the admin console of Deployment Manager (DMGR).
2. Go to Servers > Application Servers > server_name > Server Infrastructure > Administration > Custom Properties
3.   Click New and add the following property:
Name: com.ibm.websphere.threadmonitor.dump.java
Value: true

4.   Click Apply. Click OK and save the configuration changes.
5.   Restart the Application Server for the changes to take effect.

Do the same with Node Agent:
  1. From the DMGR administrative console, click System Administration > Node Agents > nodeagent_name > Additional Properties > Administration Services > Additional Properties > Custom Properties
  2. Click New and add the following property:
    Name: com.ibm.websphere.threadmonitor.dump.java
    Value: true
  3. Click Apply. Click OK and save the configuration changes.
  4. Restart the Node Agent for the changes to take effect.
 Starting in WebSphere Application Server 7.0.0.25, 8.0, 8.5, and later you can now specify an integer in the 'Value' field of this custom property, making it possible to limit the number of javacores/thread dumps produced. For example, setting "20" as the value, it will only generate javacores on the first 20 hung thread messages reported.
 

No comments:

Post a Comment