Thread Pool ETW Events

.NET Framework (current version)
 

These events collect information about worker and I/O threads.

There are two groups of thread pool events:

  • Worker thread pool events, which provide information about how an application uses the thread pool, and the effect of workloads on concurrency control.

  • I/O thread pool events, which provide information about I/O threads that are created, retired, unretired, or terminated in the thread pool.

These events relate to the runtime's worker thread pool and provide notifications for thread events (for example, when a thread is created or stopped). The worker thread pool uses an adaptive algorithm for concurrency control, where the number of threads is calculated based on the measured throughput. Worker thread pool events can be used to understand how an application is using the thread pool, and the effect that certain workloads may have on concurrency control.

ThreadPoolWorkerThreadStart and ThreadPoolWorkerThreadStop

The following table shows the keyword and level for these events. (For more information, see CLR ETW Keywords and Levels.)

Keyword for raising the eventLevel
ThreadingKeyword (0x10000)Informational (4)

The following table shows the event information.

EventEvent IDRaised when
ThreadPoolWorkerThreadStart50A worker thread is created.
ThreadPoolWorkerThreadStop51A worker thread is stopped.
ThreadPoolWorkerThreadRetirementStart52A worker thread retires.
ThreadPoolWorkerThreadRetirementStop53A retired worker thread becomes active again.

The following table shows the event data.

Field nameData typeDescription
ActiveWorkerThreadCountwin:UInt32Number of worker threads available to process work, including those that are already processing work.
RetiredWorkerThreadCountwin:UInt32Number of worker threads that are not available to process work, but that are being held in reserve in case more threads are needed later.
ClrInstanceIDWin:UInt16Unique ID for the instance of CLR or CoreCLR.

ThreadPoolWorkerThreadAdjustment

These thread pool events provide information for understanding and debugging the behavior of the thread injection (concurrency control) algorithm. The information is used internally by the worker thread pool.

ThreadPoolWorkerThreadAdjustmentSample

The following table shows the keyword and level.

Keyword for raising the eventLevel
ThreadingKeyword (0x10000)Informational (4)

The following table shows the event information.

EventEvent IDDescription
ThreadPoolWorkerThreadAdjustmentSample54Refers to the collection of information for one sample; that is, a measurement of throughput with a certain concurrency level, in an instant of time.

The following table shows the event data.

Field nameData typeDescription
Throughputwin:DoubleNumber of completions per unit of time.
ClrInstanceIDWin:UInt16Unique ID for the instance of CLR or CoreCLR.

ThreadPoolWorkerThreadAdjustmentAdjustment

The following table shows the keyword and level.

Keyword for raising the eventLevel
ThreadingKeyword (0x10000)Informational (4)

The following table shows the event information.

EventEvent IDDescription
ThreadPoolWorkerThreadAdjustmentAdjustment55Records a change in control, when the thread injection (hill-climbing) algorithm determines that a change in concurrency level is in place.

The following table shows the event data.

Field nameData typeDescription
AverageThroughputwin:DoubleAverage throughput of a sample of measurements.
NewWorkerThreadCountwin:UInt32New number of active worker threads.
Reasonwin:UInt32Reason for the adjustment.

0x00 - Warmup.

0x01 - Initializing.

0x02 - Random move.

0x03 - Climbing move.

0x04 - Change point.

0x05 - Stabilizing.

0x06 - Starvation.

0x07 - Thread timed out.
ClrInstanceIDWin:UInt16Unique ID for the instance of CLR or CoreCLR.

ThreadPoolWorkerThreadAdjustmentStats

The following table shows the keyword and level.

Keyword for raising the eventLevel
ThreadingKeyword (0x10000)Informational (4)

The following table shows the event information.

EventEvent IDDescription
ThreadPoolWorkerThreadAdjustmentStats56Gathers data on the thread pool.

The following table shows the event data.

Field nameData typeDescription
Durationwin:DoubleAmount of time, in seconds, during which these statistics were collected.
Throughputwin:DoubleAverage number of completions per second during this interval.
ThreadWavewin:DoubleReserved for internal use.
ThroughputWavewin:DoubleReserved for internal use.
ThroughputErrorEstimatewin:DoubleReserved for internal use.
AverageThroughputErrorEstimatewin:DoubleReserved for internal use.
ThroughputRatiowin:DoubleThe relative improvement in throughput caused by variations in active worker thread count during this interval.
Confidencewin:DoubleA measure of the validity of the ThroughputRatio field.
NewcontrolSettingwin:DoubleThe number of active worker threads that will serve as the baseline for future variations in active thread count.
NewThreadWaveMagnitudeWin:UInt16The magnitude of future variations in active thread count.
ClrInstanceIDWin:UInt16Unique ID for the instance of CLR or CoreCLR.

Back to top

These thread pool events occur for threads in the I/O thread pool (completion ports), which is asynchronous.

IOThreadCreate_V1

The following table shows the keyword and level.

Keyword for raising the eventLevel
ThreadingKeyword (0x10000)Informational (4)

The following table shows the event information.

EventEvent IDRaised when
IOThreadCreate_V144An I/O thread is created in the thread pool.

The following table shows the event data.

Field nameData typeDescription
Countwin:UInt64Number of I/O threads, including the newly created thread.
NumRetiredwin:UInt64Number of retired worker threads.
ClrInstanceIDWin:UInt16Unique ID for the instance of CLR or CoreCLR.

IOThreadRetire_V1

The following table shows the keyword and level.

Keyword for raising the eventLevel
ThreadingKeyword (0x10000)Informational (4)

The following table shows the event information.

EventEvent IDRaised when
IOThreadRetire_V146An I/O thread becomes a retirement candidate.

The following table shows the event data.

Field nameData typeDescription
Countwin:UInt64Number of I/O threads remaining in the thread pool.
NumRetiredwin:UInt64Number of retired I/O threads.
ClrInstanceIDWin:UInt16Unique ID for the instance of CLR or CoreCLR.

IOThreadUnretire_V1

The following table shows the keyword and level.

Keyword for raising the eventLevel
ThreadingKeyword (0x10000)Informational (4)

The following table shows the event information.

EventEvent IDRaised when
IOThreadUnretire_V147An I/O thread is unretired because of I/O that arrives within a waiting period after the thread becomes a retirement candidate.

The following table shows the event data.

Field nameData typeDescription
Countwin:UInt64Number of I/O threads in the thread pool, including this one.
NumRetiredwin:UInt64Number of retired I/O threads.
ClrInstanceIDWin:UInt16Unique ID for the instance of CLR or CoreCLR.

IOThreadTerminate

The following table shows the keyword and level.

Keyword for raising the eventLevel
ThreadingKeyword (0x10000)Informational (4)

The following table shows the event information.

EventEvent IDRaised when
IOThreadTerminate45An I/O thread is created in the thread pool.

The following table shows the event data.

Field nameData typeDescription
Countwin:UInt64Number of I/O threads remaining in the thread pool.
NumRetiredwin:UInt64Number of retired I/O threads.
ClrInstanceIDWin:UInt16Unique ID for the instance of CLR or CoreCLR.

CLR ETW Events

Show: