Professional Documents
Culture Documents
Weblogic Troubleshooting Performance PDF
Weblogic Troubleshooting Performance PDF
Laurent Goldsztejn
Fusion Middleware Proactive Support
September 2014
@weblogicsupport
1 Performance issues
2 Best practices with server logs
3 Best practices with thread dumps
4 Deconstructing Java threads
5 Examples & Demo
Deadlock
WLDF to collect metrics, setup watch and notifications, and to define instrumentation
Check for
Check for Stuck Check for Too Many
OutOfMemory
Threads Open Files
messages
oracle.jdbc.driver.OracleStatement.getColumnIndex(OracleStatement.java:3288)
oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:1914)
oracle.jdbc.driver.OracleResultSet.getTimestamp(OracleResultSet.java:1661)
weblogic.jdbc.wrapper.ResultSet_oracle_jdbc_driver_OracleResultSetImpl.getTimestamp(Unknown Source)
com.foo.sqlmap.engine.type.DateTypeHandler.getResult(DateTypeHandler.java:44)
…
The thread is blocked and can't return to the thread pool in a given period of time
• A socket can remain in TIME_WAIT after they are closed to guarantee that delayed packets in the network reached
the corresponding socket
tcp_time_wait_interval on Linux (default 4 minutes)
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters on Windows (default 1 minute)
• If many connections are being opened and closed quickly then socket's in TIME_WAIT may begin to accumulate on
a system
– View sockets in TIME_WAIT using netstat
Support Pattern: How To Troubleshoot Too Many Open Files Problems [ID 867492.1]
• Memory Leak Detectors and heap dumps can be used to identify causes for leaks in applications
Support Pattern: Troubleshooting Out of Memory and Memory Leak Problems [ID 877172.1]
Stack Threads
• Classes • State
• Packages • Name,
• Method Calls Queue
• Locks • tid, nid, prio
jcmd <pid>
Remote Diagnostic Unix Command-line print_threads
WLST threadDump()
Agent (RDA) kill -3 <pid>
Hotspot JDK 7
jcmd
<pid> Thread.print
WLS Admin Console Jstack <pid> Java VisualVM
(Java 7 mission
control)
Tool Description
Samurai Light weight open source tool that extract
http://yusuke.homeip.net/samurai/en/index.ht thread dumps and GC stats from log files,
ml and presents them in different table views
with color code for easy visual analysis
Thread Dump Analyzer (TDA) Swing GUI for analyzing Thread Dumps and
http://java.net/projects/tda/pages/Home Heap Information
Thread Logic Built upon TDA by adding logic for common
http://java.net/projects/threadlogic/ patterns found in application servers
Identity the cause of stuck threads by looking at the last method and java class invoked
Check thread dumps from different managed servers to find potential relationships between
the stuck threads
In most cases, WLS internal threads, such as muxer and listen threads, can be ignored
NEW Available thread ready to process work request for any work manager
Thread blocked by another and waiting for the other thread to complete its operations and
release its locks. If more than one threads attempt to acquire the monitor of a particular
BLOCKED
object then only one thread (selected by the JVM scheduler) is granted the monitor and all
other threads are put into BLOCKED state
RUNNING Thread actively working processing a task and therefore using some CPU
Thread in sleep, wait, join or park method and in a state of monitoring (waiting on monitor
TIMED_WAITING condition) - waiting for another thread to perform an action for up to a specified waiting
time is in this state
The thread is waiting by using a wait, join or park method without any maximum - waiting
WAITING
indefinitely for another thread to perform a particular action is in this state
• Package java.util.concurrent
– Utility classes commonly useful in concurrent programming
Conditions provide a means for one thread to suspend execution and wait until
notified by another thread that some state condition may now be true
• Locks are used to prevent that more than one thread accesses and works the same
object
• If the lock is currently held then the thread requesting it joins the blocked list of
contenders for this lock
• Threads holding locks should relinquish them as soon as they stop needing them to
avoid impairing on other threads
• Deadlocks can occur when multiple threads need the same locks, at the same time, but
obtain them in different order
…
at javax/mail/Service.connect(Service.java:105)
at javax/mail/Transport.send0(Transport.java:168)
…
at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
-- end of trace
Join us for a relaxing Happy Hour after a busy day at Oracle OpenWorld!
•Take a break and unwind with your peers
•Get to know the Oracle support engineers you depend on
•Meet My Oracle Support executives and developers
•Enjoy drinks and hors d’oevres
•Admission is free with your Oracle OpenWorld badge
Event details at:
www.oracle.com/goto/mondaymix
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 35
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |