21
 IBM Software Group  ® WebSphere Application Server 6.1 Problem determination guide How to troubleshoot hangs  © 2009 IBM Corporation Updated November 24, 2009 4.0 This presentation will act as an introduction to troubleshooting hangs when using WebSphere  ® Application Server version 6.1 WA5716G07_Hangs.ppt Page 1 of 21

WA5716G07 Hangs

Embed Size (px)

Citation preview

Page 1: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 1/21

 

IBM Software Group

 ® 

WebSphere Application Server 6.1Problem determination guide

How to troubleshoot hangs 

 © 2009 IBM Corporation

Updated November 24, 2009

4.0

This presentation will act as an introduction to troubleshooting hangs when usingWebSphere ® Application Server version 6.1

WA5716G07_Hangs.ppt Page 1 of 21

Page 2: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 2/21

 

IBM Software Group

How to troubleshoot hangs  © 2009 IBM Corporation

Application server hang defined

�Clarify the nature and extent of the hang

�A “hang” is not the same as a “crash”�Is entire process is truly hung, or does it still respond to

some requests?

� Test with sample “Snoop” servlet, wsadmin commands, and so on.

�Deadlocks:

� Very often, one process fails to respond to a request because it has madea call to another process that is itself hung; sometimes is hard to find the

true culprit.

� Deadlocks also can occur within the same Java™ process, where onethread is deadlocked on another.

A hang can be defined as a process or thread which has become unresponsive while stillapparently alive. Contrast this with a crash, when a process abnormally ends with an errormessage.

WA5716G07_Hangs.ppt Page 2 of 21

Page 3: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 3/21

 

IBM Software Group

How to troubleshoot hangs  © 2009 IBM Corporation

WebSphere process hang detection steps

� Once a hang is suspected, obtain a thread dump or javacore

�If the process is still responsive to JMX commands (service threads), then

wsadmin to trigger the dump�Otherwise, trigger through lower-level OS functions

� On UNIX ® , send a “kill -3” signal

� If that fails, may need even lower-level functions (such as dbxtrace)or trigger a system core dump for analysis.

� For a typical hang, collect three dumps at a few minutes interval

�To see if anything is moving within the process (but slowly)

� Examine the thread dumps with Thread Analyzer or by hand

�Look for deadlocks

�Look for threads that are waiting after sending a request to some otherprocess, now awaiting a response

The basic problem determination method for hangs is to obtain one or, if possible, a seriesof thread dumps. If the process is still responsive to wsadmin commands, then thewsadmin command should be able to trigger the dump. Otherwise, depending upon youroperating system, certain signals will trigger a thread dump. For a typical hang, collectthree dumps at five minute intervals to determine if anything is moving within the process(albeit slowly). Examine the thread dumps with Thread Analyzer or by hand to look for

deadlocks or to see if threads are awaiting responses from other processes. In newerJVMs, the javacore or thread dump will automatically perform deadlock detection and tellyou if a deadlock has been detected. Look for the string "deadlock" in the javacore file.

WA5716G07_Hangs.ppt Page 3 of 21

Page 4: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 4/21

 

IBM Software Group

How to troubleshoot hangs  © 2009 IBM Corporation

Javacore hang indicators

� JVM monitor information�Shows synchronization locks

� Indicates blocked threads

�Look for the string “Deadlock detected”

� Active threads�Look for running threads indicated by state:R

"Servlet.Engine.Transports:239" (TID:0x34B94018, sys_thread_t:0x7CD4E008,state:R , native ID:0x10506) prio=5atjava.net.SocketInputStream.socketRead(Native Method)atjava.net.SocketInputStream.read(SocketInputStream.java(Compiled Code))atcom.ibm.ws.io.Stream.read(Stream.java(Compiled Code))atcom.ibm.ws.io.ReadStream.readBuffer(ReadStream.java(Compiled Code))

�This example shows that the thread is performing I/O. If this thread is performing thesame operation across multiple javacore files, there might be a network interface issue.

The monitor information in the javacore file shows what synchronization locks are held bywhich threads. It also shows which threads are blocked by monitors. This information isuseful for determining the cause of a deadlocked or hung JVM.

WA5716G07_Hangs.ppt Page 4 of 21

Page 5: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 5/21

 

IBM Software Group

How to troubleshoot hangs  © 2009 IBM Corporation

�WebSphere contains a built-in hung threaddetection function

�ThreadMonitor architecture was created to monitorthread pools within WebSphere

�The ThreadMonitor monitors Web Container, ORB, andAsync Bean thread pools

�Enabled by default

�Unmanaged threads are not monitored.

�Upon notification of a hung thread:

�Obtain a javacore and see what the thread is doing�Investigate the nature of the thread

WebSphere hung thread detection

WebSphere Application Server contains a built-in hung thread detection function. Itmonitors the Web container, Object Requet Broker, and Asynchronous Bean thread pools,and is enabled by default. Note that unmanaged threads are not monitored. You canconfigure a hang detection policy to accommodate your applications and environment sothat potential hangs can be reported, providing earlier detection of failing servers.

WA5716G07_Hangs.ppt Page 5 of 21

Page 6: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 6/21

 

IBM Software Group

How to troubleshoot hangs  © 2009 IBM Corporation

Hung thread detection internals

�When the thread pool gives work to a thread, it

notifies the thread monitor�Thread monitor notes thread ID and timestamp

�Thread monitor compares active threads totimestamps

�Threads active longer than the time limit are marked

“potentially hung”

�Performance impact is minimal (< 1%)

When the thread pool issues work to a thread, it sends a notification to the thread monitor,which notes the thread identifier and the time in a list. At user-configurable intervals, thethread monitor looks at the active threads, and compares them to the list, to determinehow long each thread has been active. If a thread has been active longer than the user-specified threshold, the thread is marked as “potentially hung”, and notifications are sent.

WA5716G07_Hangs.ppt Page 6 of 21

Page 7: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 7/21

 

IBM Software Group

How to troubleshoot hangs  © 2009 IBM Corporation

Hung thread detection notification

�No action taken to kill the thread--only a notification

mechanism�When a thread is suspected to be hung, notification

is sent three ways:

�JMX notification for JMX listeners

�ThreadPool metric for PMI clients

� Counters are updated

�Message written to SystemOut.log:

[4/17/04 11:51:30:243 EST] 2d757854 ThreadMonitor W

CWWSR0605W: Thread Servlet.Engine.Transports : 0 has beenactive for 14,198 milliseconds and may be hung. There are

1 threads in total in the server that may be hung.

The thread monitor doesn’t try to deal with the hung threads, it just issues notifications, sothat the administrator or developer can deal with the issues. The message written to theSystemOut log has a message identifier of WSVR0605W, and shows the thread name,the approximate time that the thread has been active, and the total number of threadswhich may be hung.

WA5716G07_Hangs.ppt Page 7 of 21

Page 8: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 8/21

 

IBM Software Group

How to troubleshoot hangs  © 2009 IBM Corporation

Hung thread detection false alarms

�What about false alarms?

�For example: a thread that takes several minutes tocomplete a long-running query

� If a thread previously reported to be hungcompletes its work, a notification is sent:[2/17/04 11:51:47:210 EST] 76e0b856 ThreadMonitor W WSVR0606W:

Thread Servlet.Engine.Transports : 0 was previously reported to be

hung but has completed. It was active for approximately 31,166

milliseconds. There are 0 threads in total in the server that

still may be hung.

�The monitor has a self-adjusting system to make a

best effort to deal with false alarms.

It’s possible that a thread can run for longer than the specified threshold for legitimatereasons. When a thread that was previously marked as “potentially hung” completes itswork and exits, a notification is sent. After a certain number of false alarms, the thresholdis automatically increased by 50% to account for these long-running threads.

WA5716G07_Hangs.ppt Page 8 of 21

Page 9: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 9/21

 

IBM Software Group

How to troubleshoot hangs  © 2009 IBM Corporation

Hung thread detection configuration

�Create custom properties on the application server

Property Units Default Description

com.ibm.websphere.threadmonitor.interval secs. 180 The interval at which the thread poolsare polled for hung threads

com.ibm.websphere.threadmonitor.threshold secs. 600 The length of time that a thread can beactive before being marked as“potentially hung”

com.ibm.websphere.threadmonitor.false.alarm.threshold

N/A 100 The number of false alarms that canoccur before automatically increasingthe threshold by 50%.

The hang detection policy can be configured by creating custom properties for theapplication server.

WA5716G07_Hangs.ppt Page 9 of 21

Page 10: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 10/21

 

IBM Software Group

How to troubleshoot hangs  © 2009 IBM Corporation

Thread and Monitor Dump Analyzer

� A tech-preview tool to analyze thread dumps

�Available from the IBM Support Assistant

� Used for

�Analyzing threads and monitors in javacores

�Comparing multiple javacores from the same process

� Friendlier interface for novice thread dump readers

�Provides graphical interface to view contents of the thread dump

� Analyzes WebSphere Application Server thread dumps

� Used to analyze threads for

�Performance bottlenecks due to either WebSphere configuration orapplication problems

�Determining if deadlocks are being created

�Determining if threads are being blocked on monitors (may not be adeadlock)

The Thread and Monitor Dump Analyzer is an IBM Support tool designed to simplify theact of analyzing javacore files. It is designed so that novice troubleshooters and expertsalike can use the tool to analyze thread dumps. The tool is available through the IBMSupport Assistant workbench.

WA5716G07_Hangs.ppt Page 10 of 21

Page 11: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 11/21

 

IBM Software Group

How to troubleshoot hangs  © 2009 IBM Corporation

Opening a thread dump

You can search the local file system for one or more javacore files. Each file is loaded intothe tool and analyzed. The tool will provide a warning if any deadlocked threads are foundwithin the dumps. Additionally, the tool will display summary information from the javacorefile such as file name, cause of the dump, data, process identifier, Java version, Javaheap information, and much more.

WA5716G07_Hangs.ppt Page 11 of 21

Page 12: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 12/21

 

IBM Software Group

How to troubleshoot hangs  © 2009 IBM Corporation

Thread detail – Thread status analysis

The Analysis menu allows you to display thread and monitor details for a single javacore.If you open multiple javacores, you can display a comparative thread or monitor analysis.The thread detail analysis displays thread status analysis, thread method analysis, threadaggregation analysis, memory segment analysis. The thread status analysis shows thenumber of threads in each state: Deadlocked, Runnable, Blocked, and so forth. Threadsare sorted by thread name. Thread Detail View provides the thread name, the state of a

thread, the method name, the Java stack trace, and the native stack trace.

WA5716G07_Hangs.ppt Page 12 of 21

Page 13: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 13/21

 

IBM Software Group

How to troubleshoot hangs  © 2009 IBM Corporation

Thread detail – Thread method analysis

The thread method analysis view provides a summary of what all of the threads in theJVM were doing at the time the dump was taken.

WA5716G07_Hangs.ppt Page 13 of 21

Page 14: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 14/21

 

IBM Software Group

How to troubleshoot hangs  © 2009 IBM Corporation

Thread detail – Thread aggregation analysis

Thread aggregation analysis details the types of threads that were seen in the dump.

WA5716G07_Hangs.ppt Page 14 of 21

Page 15: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 15/21

 

IBM Software Group

How to troubleshoot hangs  © 2009 IBM Corporation

Thread detail – Memory segment analysis

This slide shows sample out for the memory segment analysis view. This view provideinformation regarding the amount of memory allocated and the number of memorysegments used by the server from which this dump was taken.

WA5716G07_Hangs.ppt Page 15 of 21

Page 16: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 16/21

 

IBM Software Group

How to troubleshoot hangs  © 2009 IBM Corporation

Easilycompare

several Javacores

Multiple dump comparative analysis

The Thread and Monitor Dump Analyzer tool can provide comparative analysis betweenone or more thread dumps taken from the same server. This is useful for determining ifthreads are truly hung or are just moving very slowly. The tool provides color highlightingto easily identify threads states.

WA5716G07_Hangs.ppt Page 16 of 21

Page 17: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 17/21

 

IBM Software Group

How to troubleshoot hangs  © 2009 IBM Corporation

Thread analysis: Deadlocked thread details

In the left pane, each thread name can be selected and the details of the thread aredisplayed in the right pane. Deadlocked threads appear in the thread listing with a state ofDeadlock or Blocked. They are also highlighted with a gray color and have a padlock iconon them for easy identification. By clicking on the thread in the left pane, one can see thethread waiting on this thread and the thread that is blocking the selected thread.

WA5716G07_Hangs.ppt Page 17 of 21

Page 18: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 18/21

 

IBM Software Group

How to troubleshoot hangs  © 2009 IBM Corporation

Thread analysis: Monitor details

The Monitor Detail view provides a hierarchical tree of the threads. By clicking each threadin the hierarchy you can see information about the monitor locks held by the thread andany monitor locks the thread is waiting for.

WA5716G07_Hangs.ppt Page 18 of 21

Page 19: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 19/21

 

IBM Software Group

How to troubleshoot hangs  © 2009 IBM Corporation

Unit summaryNow that you have completed this unit, you should be

able to:

� Define a JVM hang� Be able to identify a JVM hang

� Be able to capture a javacore and use it to troubleshoota hang condition

� Configure and use the WebSphere Application ServerHung Thread Detection function

� Understand base use cases for the IBM Thread andMonitor Dump Analyzer tool

Now that you have completed this unit, you should be able to define and identify a JVMhang, be able to capture a Java core and use it to troubleshoot a hang condition, configureand use the WebSphere Application Server Hung Thread Detection function, andunderstand base use cases for the IBM Thread and Monitor Dump Analyzer tool.

WA5716G07_Hangs.ppt Page 19 of 21

Page 20: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 20/21

 

IBM Software Group

20

How to troubleshoot hangs  © 2009 IBM Corporation

Feedback

Your feedback is valuable

You can help improve the quality of IBM Education Assistant content to bettermeet your needs by providing feedback.

� Did you find this module useful?

� Did it help you solve a problem or answer a question?

� Do you have suggestions for improvements?

Click to send e-mail feedback:

mailto:[email protected]?subject=Feedback_about_WA5716G07_Hangs.ppt

This module is also available in PDF format at: ../WA5716G07_Hangs.pdf

You can help improve the quality of IBM Education Assistant content by providingfeedback.

WA5716G07_Hangs.ppt Page 20 of 21

Page 21: WA5716G07 Hangs

8/3/2019 WA5716G07 Hangs

http://slidepdf.com/reader/full/wa5716g07-hangs 21/21

 

IBM Software Group

21

How to troubleshoot hangs  © 2009 IBM Corporation

Trademarks, copyrights, and disclaimersIBM, the IBM logo, ibm.com, and the following terms are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both:

WebSphere

If these and other IBM trademarked terms are marked on their first occurrence in this information with a trademark symbol (® or ™), these symbols indicate U.S. registered or common lawtrademarks owned by IBM at the time this information was published. Such trademarks may also be registered or common law trademarks in other countries. A current list of other IBMtrademarks is available on the Web at "Copyright and trademark information" at http://www.ibm.com/legal/copytrade.shtml

UNIX is a registered trademark of The Open Group in the United States and other countries.

Java, JMX, JVM, and all Java-based trademarks and logos are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.

Other company, product, or service names may be trademarks or service marks of others.

Product data has been reviewed for accuracy as of the date of initial publication. Product data is subject to change without notice. This document could include technical inaccuracies ortypographical errors. IBM may make improvements or changes in the products or programs described herein at any time without notice. Any statements regarding IBM's future directionand intent are subject to change or withdrawal without notice, and represent goals and objectives only. References in this document to IBM products, programs, or services does not implythat IBM intends to make such products, programs or services available in all countries in which IBM operates or does business. Any reference to an IBM Program Product in thisdocument is not intended to state or imply that only that program product may be used. Any functionally equivalent program, that does not infringe IBM's intellectual property rights, may beused instead.

THE INFORMATION PROVIDED IN THIS DOCUMENT IS DISTRIBUTED "AS IS" WITHOUT ANY WARRANTY, EITHER EXPRESS OR IMPLIED. IBM EXPRESSLY DISCLAIMS ANYWARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. IBM shall have no responsibility to update this information. IBM productsare warranted, if at all, according to the terms and conditions of the agreements (for example, IBM Customer Agreement, Statement of Limited Warranty, International Program LicenseAgreement, etc.) under which they are provided. Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or otherpublicly available sources. IBM has not tested those products in connection with this publication and cannot confirm the accuracy of performance, compatibility or any other claims relatedto non-IBM products.

IBM makes no representations or warranties, express or implied, regarding non-IBM products and services.

The provision of the information contained herein is not intended to, and does not, grant any right or license under any IBM patents or copyrights. Inquiries regarding patent or copyrightlicenses should be made, in writing, to:

IBM Director of LicensingIBM CorporationNorth Castle DriveArmonk, NY 10504-1785U.S.A.

Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. All customer examples described are presented as illustrations ofhow those customers have used IBM products and the results they may have achieved. The actual throughput or performance that any user will experience will vary depending uponconsiderations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurancecan be given that an individual user will achieve throughput or performance improvements equivalent to the ratios stated here.

 © Copyright International Business Machines Corporation 2009. All rights reserved.

Note to U.S. Government Users - Documentation related to r estricted rights-Use, duplication or disclosure is subject to restrictions set forth in GSA ADP Schedule Con tract and IBM Corp.

WA5716G07_Hangs.ppt Page 21 of 21