Continuous thread analysis
Multiple-thread architectures can easily scale, as the distribution of work allows CPUs to remain active and continue running code. However, when systems need to coordinate work across multiple threads, locks increase and reductions in code run might occur.
In Dynatrace, such behavior is automatically and continuously detected by OneAgent. With continuous thread analysis, data is continuously available, with historical context, and doesn’t need to be triggered if a problem occurs. You can receive alerts on trends, analyze thread dumps, and directly start improving code, when and where it's needed, to prevent bottlenecks.
Before you begin
To start using continuous thread analysis
-
In the Dynatrace menu, go to Settings > Preferences > OneAgent features.
-
Find and turn on the following OneAgent features for the technology you want to monitor:
Technology to monitor OneAgent features to turn on Java
Continuous thread analysis
Node.js
- Node.js worker threads monitoring
- Node.js code module preloading
Due to a known issue with Java 11, continuous thread analysis of JVM threads is only available for Java 8 and Java 17+ (based on the supported versions). Application and agent threads remain unaffected.
Thread analysis
To start analyzing thread dumps
-
In the Dynatrace menu, go to Profiling and optimization > Continuous CPU profiling.
-
For the process group that you want to analyze, select More (…) > Threads.
-
On the Thread analysis page, you can:
- Analyze the thread breakdown by thread states or by estimated CPU time.
- Include or exclude data on waiting threads at any time, by selecting the related checkbox.
- Filter the data
- By request type.
Select Filter requests > Type and choose an option. - By request thread-group name.
Select the thread-group name. The segmentation of thread groups takes into account the fact that they typically run different functionalities, and gives you quick means to identify CPU consumers.
- By request type.
- Analyze the method hotspots of a thread group.
In the thread group Actions column, select More (…) > Method hotspots.
Use cases
Threads are a source of scalability, as they enable your applications to carry out multiple tasks at once. In certain situations, this can become a source of performance bottlenecks. For example:
- High-load systems might experience thread-locking issues, which prevent the application from scaling.
- If the number of active threads is too high, CPU resources can be wasted due to over-utilization or to operating systems being forced to schedule thousands of threads on a limited set of cores.