|Figure 1: Thread pool|
The recently finalized sFlow Application Structures specification defines a standard set of metrics for reporting on thread pools:
- Active Threads The number of threads in the thread pool that are actively processing a request.
- Idle Threads The number of threads in the thread pool that are waiting for a request.
- Maximum Threads The maximum number of threads that can exist in the thread pool.
- Delayed Tasks The number of tasks that could not be served immediately, but spent time in the task queue.
- Dropped Tasks The number of tasks that were dropped because the task queue was full.
While the server-status page isn't designed to be machine readable, the information is critical and there are numerous performance monitoring tools that make HTTP requests and extract the worker pool statistics from the text. A much more efficient way to retrieve the information is to use the Apache sFlow module, which in addition to reporting the thread pool statistics will export HTTP counters, URLs, response times, status codes, etc.
The article, Using Ganglia to monitor web farms, describes how to use the open source Ganglia performance monitoring software to collect and report on web server clusters using sFlow. Ganglia now includes support for the sFlow thread pool metrics.
|Figure 2: Ganglia chart showing active threads from an Apache web server|
Monitoring thread pools using sFlow is very useful, but only scratches the surface of what is possible. The sFlow standard is widely support be network equipment vendors and can be combined with sFlow metrics from hosts, services and applications to provide a comprehensive view of data center performance.