Status Page

This page provides information on the setup and contents of the FPM status page. See also fpm_get_status().

Configuration

The FPM status page can be enabled by setting the pm.status_path configuration parameter in the FPM pool configuration.

Dikkat

For security the FPM status page should be restricted to internal requests or known client IPs only as the page reveals request URLs and information about available resources.

Depending on the web server configuration it might be needed to configure the web server to allow requests directly to this path, bypassing any PHP scripts. An example of a configuration for Apache with FPM listening on UDS and pm.status_path set to /fpm-status would look like:

<LocationMatch "/fpm-status">
 Order Allow,Deny
 Allow from 127.0.0.1
 ProxyPass "unix:/var/run/php-fpm.sock|fcgi://localhost/fpm-status"
</LocationMatch>

After reloading or restarting both FPM and the web server the status page will be accessible from the browser (as long as the request comes from an allowed IP address if the IP restriction was configured).

Query Parameters

The format of the status page output can be altered by specifying one of the following query parameters:

  • html
  • json
  • openmetrics
  • xml

Additional information can also be returned using the full query parameter.

Example status page URLs:

  • https://localhost/fpm-status - Brief output in the default text format
  • https://localhost/fpm-status?full - Full output in the default text format
  • https://localhost/fpm-status?json - Brief output in JSON format
  • https://localhost/fpm-status?html&full - Full output in HTML format

Displayed Information

Date/Time values use the unix timestamp format in JSON and XML output, otherwise they use the format resulting in the following example date "03/Jun/2021:07:21:46 +0100".

Basic information - Always displayed on the status page
Parameter Description
pool The name of the FPM process pool.
proccess manager The process manager type - static, dynamic or ondemand.
start time The date/time that the process pool was last started.
start since The time in seconds since the process pool was last started.
accepted conn The total number of accepted connections.
listen queue The number of requests (backlog) currently waiting for a free process.
max listen queue The maximum number of requests seen in the listen queue at any one time.
listen queue len The maximum allowed size of the listen queue.
idle processes The number of processes that are currently idle (waiting for requests).
active processes The number of processes that are currently processing requests.
total processes The current total number of processes.
max active processes The maximum number of concurrently active processes.
max children reached Has the maximum number of processes ever been reached? If so the displayed value is 1 otherwise the value is 0.
slow requests The total number of requests that have hit the configured request_slowlog_timeout.
Per-process information - only displayed in full output mode
Parameter Description
pid The system PID of the process.
state The state of the process - Idle, Running, ...
start time The date/time at which the process started.
start since The number of seconds since the process started.
requests The total number of requests served.
request duration The total time in microseconds spent serving last request.
request method The HTTP method of the last served request.
request uri The URI of the last served request (after webserver processing, it may always be /index.php if you use a front controller pattern redirect).
content length The length of the request body, in bytes, of the last request.
user The HTTP user (PHP_AUTH_USER) of the last request.
script The full path of the script executed by the last request. This will be '-' if not applicable (eg. status page requests).
last request cpu The %cpu of the last request. This will be 0 if the process is not Idle because the calculation is done when the request processing is complete. The value can exceed 100%, because metric will tell which percentage of the total cpu time was used in the last request - takes processes on all cores into account, whereas the 100% is for one core only.
last request memory The maximum amount of memory consumed by the last request. This will be 0 if the process is not Idle because the calculation is done when the request processing is complete.

Bilginize:

All values are specific to the pool and are reset when FPM is restarted.

Bilginize:

OpenMetrics format output uses different parameter types to better suit the OpenMetrics format. The parameters and descriptions of their values are included in the OpenMetrics format output.

Sürüm Bilgisi

Sürüm: Açıklama
8.1.0 The openmetrics format was added.
add a note

User Contributed Notes 3 notes

up
14
uwe at ohse dot de
1 year ago
Before someone else misunderstands that:
"request duration The total time in seconds spent serving requests."

This is not the total time of all requests done by that process, but either the time used by the last request done (idle state), or the current request (all other states).

And the number given is not in seconds, but in microseconds.

The fpm status documentation is a mess.
up
0
Mark Gooderum
1 month ago
Anonymous is correct.

So the URI has to match the pm.status_path in the pool configuration and in turn the Apache Location configuration. The same applies to ping.path.

Ergo If you want multiple PHP FPMs exposed on the same Apache each needs their own unique path. Also from experience Apache 8 FPM status_listen doesn't seem to work with the domain socket, only TCP. Obviously for 8.x you'll need unique port numbers for each PHP FPM and they need to match between the pm.status_listen and the Apache ProxyPass line.

So imagine I want FPM status and ping exposed for 7.4 and 8.2.

I then have an Apache config like:

<LocationMatch "/fpm-ping-74">
Order Deny,Allow
Require local
ProxyPass "unix:/run/php/php7.4-fpm.sock|fcgi://localhost"
</LocationMatch>
<LocationMatch "/fpm-status-74">
Order Deny,Allow
Require local
IncludeOptional trusted-ips.conf
ProxyPass "unix:/run/php/php7.4-fpm.sock|fcgi://localhost"
</LocationMatch>

<LocationMatch "/fpm-ping-82">
Order Deny,Allow
Require local
IncludeOptional trusted-ips.conf
ProxyPass "unix:/run/php/php8.2-fpm.sock|fcgi://localhost:9002"
</LocationMatch>
<LocationMatch "/fpm-status-82">
Order Deny,Allow
Require local
ProxyPass "unix:/run/php/php8.2-fpm.sock|fcgi://localhost:9002"
</LocationMatch>

Then in the respective pool config files:

7.4/fpm/pool.d/www.conf:

; status_listen default works in 7.4
pm.status_path = /fpm-status-74
ping.path = /fpm-ping-74

8.2/fpm/pool.d/www.conf:

; Need an explicit TCP listen in 8.x - why?
pm.status_listen = 127.0.0.1:9002
pm.status_path = /fpm-status-82
ping.path = /fpm-ping-82
up
0
Anonymous
7 months ago
there is an error in the docs, if you want to use with fastcgi, the correct link in ProxyPass is not

ProxyPass "unix:/var/run/php-fpm.sock|fcgi://localhost/fpm-status"

but only

ProxyPass "unix:/var/run/php-fpm.sock|fcgi://localhost"

otherwise the page says "File not found"
To Top