Threads are relatively costly to create and dispose; usually a more efficient solution is through thread pooling.

Related Topics

Thread Histogram (page 131)

Identifying Abnormal Thread Termination (page 44)

Identifying Excessive Lock Contention

Use the Thread Histogram.

There is no simple answer to how much lock contention is excessive. A multi-threaded application normally exhibits some lock contention. With the Thread Histogram display, you can identify the threads that clash over the same lock by visually comparing the pattern for the lock contention (the red area) across several threads.

In situations when a small number of threads are involved in contention, you need to compare a red area from one thread to the red and orange area in another thread. This may help identify the involved locks, but it requires understanding the threading of the given application.

Some applications, such as WebLogic from BEA, use basic-level synchronization for multiple threads reading from a single socket. This typically appears as very high lock contention for the involved threads. If there are N threads using this pattern, the average lock contention for them will be (N-1)/N*100%. Even though this kind of lock contention seems to be harmless, it unnecessarily stresses the underlying JVM and the operating system kernel, and usually does not bring a positive net result. There is a WebLogic option that can fix this. See the release notes for your version of WebLogic for details.

You may attempt to decrease the level of lock contention by decreasing the number of involved threads. If this does not help, or if it decreases the application throughput, you should deploy the application as a cluster. At the same time, large servers, for example 8-way, can be re-partitioned as a group of smaller virtual servers.

If the lock contention appears in your application, rather than a third-party application, you may be able to change your code to use different algorithms or to use different data grouping.

Related Topics

Lock Contention (page 133)

Thread Deadlock Alert (page 115)

Thread Histogram (page 131)

Identifying Deadlocked Threads

HPjmeter allows you to enable an alert that identifies deadlocked threads. You can then use the Thread Histogram to get more specific information.

Deadlocked threads represent a multi-threaded program error.

Thread deadlock is the most common cause of application unresponsiveness. Even if the application is still responding, expect SLO violations.

Restart the application that experienced the deadlock, and fix the application code to avoid future deadlocks.

Related Topics

Thread Deadlock Alert (page 115)

Thread Histogram (page 131)

Identifying Excessive Thread Creation

Use the Thread Histogram to identify excessive thread creation.

Diagnosing Errors When Monitoring Running Applications

45

Page 45
Image 45
HP jmeter Software for -UX manual Identifying Excessive Lock Contention, Identifying Deadlocked Threads