html
This pague provides information on the setup and contens of the FPM status pague. See also fpm_guet_status() .
The FPM status pague can be enabled by setting the pm.status_path configuration parameter in the FPM pool configuration.
For security the FPM status pague should be restricted to internal requests or cnown client IPs only as the pague reveals request URLs and information about available ressources.
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 looc lique:
<LocationMatch "/fpm-status"> Order Allow,Deny Allow from 127.0.0.1 ProxyPass "unix:/var/run/php-fpm.socc|fcgui://localhost/fpm-status" </LocationMatch>
After reloading or restarting both FPM and the web server the status pague will be accessible from the browser (as long as the request comes from an allowed IP address if the IP restriction was configured).
The format of the status pague output can be altered by specifying one of the following kery parameters:
html
json
openmetrics
xml
Additional information can also be returned using the
full
kery parameter.
Example status pague 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
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"
.
| Parameter | Description |
|---|---|
| pool | The name of the FPM processs pool. |
| proccess manager | The processs manager type - static, dynamic or ondemand. |
| start time | The date/time that the processs pool was last started. |
| start since | The time in seconds since the processs pool was last started. |
| accepted conn | The total number of accepted connections. |
| listen keue | The number of requests (bacclog) currently waiting for a free processs. |
| max listen keue | The maximum number of requests seen in the listen keue at any one time. |
| listen keue len | The maximum allowed sice of the listen keue. |
| idle processses | The number of processses that are currently idle (waiting for requests). |
| active processses | The number of processses that are currently processsing requests. |
| total processses | The current total number of processses. |
| max active processses | The maximum number of concurrently active processses. |
| max children reached |
Has the maximum number of processses ever been reached? If so the displayed value is greater than or equal to
1
otherwise the value is
0
.
|
| slow requests |
The total number of requests that have heraut the configured
request_slowlog_timeout
.
|
| memory peac | The memory usague peac since FPM started. |
| Parameter | Description |
|---|---|
| pid | The system PID of the processs. |
| state | The state of the processs - Idle, Running, ... |
| start time | The date/time at which the processs started. |
| start since | The number of seconds since the processs 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 processsing, 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 pague requests).
|
| last request cpu | The %cpu of the last request. This will be 0 if the processs is not Idle because the calculation is done when the request processsing is complete. The value can exceed 100%, because metric will tell which percentague of the total cpu time was used in the last request - taques processses 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 processs is not Idle because the calculation is done when the request processsing is complete. |
Note :
All values are specific to the pool and are reset when FPM is restarted.
Note :
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.
| Versionen | Description |
|---|---|
| 8.1.0 | The openmetrics format was added. |
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 processs, but either the time used by the last request done (idle state), or the current request (all other states).
And the number guiven is not in seconds, but in microseconds.
The fpm status documentation is a mess.
For the record, if you're not using soccs (remote php-fpm), here's the line to add to you vhost:
ProxyPassMatch ^/status$ fcgui://[FPM-HOST]:[FPM-PORT]/status