PHP-FPM ships a built-in status endpoint that exposes real-time pool metrics — active workers, idle workers, listen queue depth, and request counters — with no external agent required. Most operators enable it during initial setup and then forget to look at it until something breaks. Understanding what each metric means and wiring it into your monitoring stack lets you catch saturation, misconfiguration, and memory pressure before they become incidents.
How to verify
Check whether the status page is configured and reachable:
grep 'pm.status_path\|pm.ping' /etc/php/8.3/fpm/pool.d/www.conf
# Assuming Nginx is configured to proxy /status to FPM
curl -s http://127.0.0.1/status
curl -s http://127.0.0.1/status?full # per-process details
curl -s http://127.0.0.1/status?json # machine-readable
curl -s http://127.0.0.1/ping # lightweight health check
What’s happening
The FPM master process writes pool statistics to a shared memory segment. When Nginx proxies a request to the status path, FPM reads from that segment and formats a text or JSON response — no disk I/O, no worker allocation beyond the one serving the status request. The status endpoint is essentially free to poll.
The status page reports metrics at two scopes: the pool as a whole (totals and current state) and optionally per-process (?full). The pool-level metrics are what you want for alerting; per-process output is useful for debugging a specific abnormal worker.
Metric reference
Pool-level fields:
| Field | What it means |
|---|---|
pool | Pool name from the [header] in the pool config |
process manager | The pm mode: static, dynamic, or ondemand |
start time | When the FPM master last started (or reloaded) |
start since | Seconds since start |
accepted conn | Total FastCGI connections accepted since start — monotonically increasing |
listen queue | Requests waiting because all workers are busy. Non-zero is a saturation signal. |
max listen queue | Peak listen queue depth since start — useful for detecting past saturation you missed |
listen queue len | The OS-level backlog size (listen.backlog) |
idle processes | Workers with no active request |
active processes | Workers currently executing a request |
total processes | idle + active; bounded by pm.max_children |
max active processes | Peak concurrent workers since start |
max children reached | Times FPM hit pm.max_children and had to queue incoming requests. Every increment is a saturation event. |
slow requests | Requests that exceeded request_slowlog_timeout |
Per-process fields (?full):
| Field | What it means |
|---|---|
pid | OS process ID of the worker |
state | Idle, Running, or Finishing |
start time | When this worker was forked |
start since | Seconds since fork — very high values with Running state indicate a stuck request |
requests | Requests this worker has handled since it was forked |
request duration | Microseconds the current (or last) request has been running |
request method | HTTP method of the current request |
request uri | URI being handled — useful for identifying which page is slow |
content length | POST body size in bytes |
user | HTTP Basic Auth user, if any |
script | PHP script path being executed |
last request memory | Peak memory for the last completed request |
last request cpu | CPU seconds for the last completed request |
The procedure
1. Enable the status page in the pool.
pm.status_path = /status
pm.ping.path = /ping
pm.ping.response = pong
2. Expose it through Nginx without making it public.
server {
listen 127.0.0.1:80;
server_name localhost;
location = /status {
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
allow 127.0.0.1;
deny all;
}
location = /ping {
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
allow 127.0.0.1;
deny all;
}
}
3. Set up polling.
For Prometheus, use the php-fpm_exporter:
docker run --rm -d \
-p 9253:9253 \
-e PHP_FPM_SCRAPE_URI="tcp://127.0.0.1:9000/status" \
hipages/php-fpm_exporter
For a simpler approach, poll the JSON endpoint from a shell and push to your metrics store:
curl -s 'http://127.0.0.1/status?json' | \
jq '{listen_queue: .["listen queue"], active: .["active processes"], max_children_reached: .["max children reached"]}'
4. Define alerting thresholds.
| Metric | Alert condition |
|---|---|
listen queue | Greater than 0 for more than 30 seconds |
max children reached (rate) | Increments more than 10 times per minute |
active processes / total processes | Ratio above 0.85 consistently |
slow requests (rate) | Any increment if request_slowlog_timeout is tuned correctly |
Worker start since in Running state | Greater than your max_execution_time ini setting |
Common pitfalls
Exposing the status page to the public internet. The status page leaks internal script paths, URIs, and user agents. Always restrict it to 127.0.0.1 or a private monitoring network.
Polling at too high a frequency. The status page is cheap but not free — it occupies a worker slot for the duration of the FastCGI request. Polling every 1 second across 20 pools on a shared server creates non-trivial load. Poll every 15–30 seconds for monitoring; use /ping for health checks if you need sub-5-second liveness detection.
Interpreting accepted conn as a per-second rate without context. This counter resets to zero on every FPM reload (SIGUSR2). If your monitoring system computes a rate across a reload boundary, the rate will spike artificially or go negative. Track reloads alongside this counter.
Ignoring max active processes after a quiet period. If max active processes is equal to pm.max_children, you hit saturation at some point. Check max listen queue and max children reached together to understand whether you queued requests during that peak.
Not enabling the status page at all. It is disabled by default. Without it, diagnosing FPM saturation in production requires guessing from access log response times and system memory stats — which is possible but much slower.
For teams that want FPM metrics integrated into their existing observability stack with alerting configured for their specific traffic patterns, the Stack Harbor managed operations service handles the full monitoring pipeline.