Read Apache busy and idle worker metrics
Interpret worker usage in the context of the active MPM, request latency, asynchronous connections, and graceful restarts.
Apache's busy workers are occupied worker slots; idle workers are available to take work. The metrics help identify pressure on request-processing capacity, but they are not a direct count of connected clients. Interpret them alongside the active multi-processing module (MPM), traffic, and latency.
Read a restricted status endpoint
With mod_status loaded, expose its handler only to trusted monitoring clients:
<Location "/server-status">
SetHandler server-status
Require ip 127.0.0.1 ::1 192.0.2.0/24
</Location>
Replace the documentation subnet with the actual management range; do not leave a public status endpoint. Apply the location in the intended server or virtual-host context and check proxy access paths too. Detailed status can expose request URLs, client addresses, and virtual-host information.
For machine-readable metrics:
curl -fsS 'http://127.0.0.1/server-status?auto'
A sample includes:
BusyWorkers: 47
IdleWorkers: 28
The scoreboard adds state detail: _ indicates waiting for a connection, R reading a request, and W sending a reply. Do not classify every symbol other than _ as an actively executing request; empty slots, starting workers, and graceful shutdown states also exist.
Look for sustained pressure
| Pattern | What to investigate |
|---|---|
| Low busy count with spare idle capacity | Compare with normal traffic and latency before changing anything. |
| Busy count near capacity and idle near zero | Request queueing, latency, downstream capacity, and MPM limits. |
| Many busy workers but little CPU activity | Slow backends, client reads/writes, locks, or other waits. |
| Pressure after graceful restarts | Old processes draining connections and scoreboard slot usage. |
Exhausted workers can lead to queued connections and eventually timeouts or refused work as other limits are reached. They do not guarantee an immediate 502 response. High traffic and slower service time can both increase concurrency; the metrics alone do not prove which caused the rise.
Relate the numbers to the MPM
With prefork, workers are processes. With worker and event MPMs, request workers are threads. Event MPM can manage eligible keep-alive and other asynchronous connection states without occupying a worker thread for the entire connection lifetime. Consequently, open connections can exceed the busy-worker count.
An illustrative event-MPM configuration is:
<IfModule mpm_event_module>
StartServers 3
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestWorkers 400
</IfModule>
These are example values, not a sizing recommendation. ServerLimit, ThreadLimit, memory, and backend capacity constrain the valid and useful settings. MaxRequestWorkers limits simultaneous request service; it is not a promise that every status snapshot's busy-plus-idle count equals that value. Graceful process generations and asynchronous connections require additional interpretation.
Before increasing capacity, find where requests spend their time. Restarting Apache may temporarily reduce symptoms without identifying whether the underlying issue is a slow dependency, a resource leak, or ordinary traffic growth.
Guance's Apache collector can read a restricted server-status?auto endpoint. Compare its initial readings with the endpoint and correlate worker usage with request latency and error logs.
References: mod_status, event MPM, and MPM directives.
Contact us
Join the community
to join the community
Try Guance
Start online and pay only for what you use.
Get startedChoose a Guance plan