PHP-FPM
Bleemeo monitors PHP-FPM through automatic service detection and built-in metrics gathered from the PHP-FPM status page.
Auto-Detection
Section titled “Auto-Detection”Glouton automatically detects PHP-FPM instances running on the host. To enable metrics gathering, PHP-FPM must expose its status page. Add the following to your pool configuration:
pm.status_path = /statusBy default, Glouton accesses the status page at fcgi://<fpm-address>:<fpm-port>/status using FastCGI over the TCP port PHP-FPM listens on.
If using a UNIX socket, ensure the Glouton user has permission to access the socket. On Debian/Ubuntu, add the Glouton user to the www-data group:
sudo adduser glouton www-dataIf the auto-detected parameters are incorrect or the default status URL does not match your configuration, you can override them manually.
sudo tee /etc/glouton/conf.d/99-php-fpm.conf > /dev/null << 'EOF'service: # For a PHP-FPM running outside a container - type: "phpfpm" address: "127.0.0.1" port: 9000 stats_url: "fcgi://127.0.0.1:9000/status" # For UNIX socket access, use: # stats_url: "/var/run/php5-fpm.sock"
# For an additional PHP-FPM running outside a container - type: "phpfpm" instance: "NAME_ASSOCIATED_WITH_YOUR_ADDITIONAL_SERVICE" address: "127.0.0.1" port: 9001 stats_url: "fcgi://127.0.0.1:9001/status" # For UNIX socket access, use: # stats_url: "/var/run/php5-fpm2.sock"
# For a PHP-FPM running in a Docker container - type: "phpfpm" instance: "CONTAINER_NAME" port: 9000 stats_url: "fcgi://my-server:9000/status"EOFCreate or edit C:\ProgramData\glouton\conf.d\99-php-fpm.conf:
service: # For a PHP-FPM running outside a container - type: "phpfpm" address: "127.0.0.1" port: 9000 stats_url: "fcgi://127.0.0.1:9000/status" # For UNIX socket access, use: # stats_url: "/var/run/php5-fpm.sock"
# For an additional PHP-FPM running outside a container - type: "phpfpm" instance: "NAME_ASSOCIATED_WITH_YOUR_ADDITIONAL_SERVICE" address: "127.0.0.1" port: 9001 stats_url: "fcgi://127.0.0.1:9001/status" # For UNIX socket access, use: # stats_url: "/var/run/php5-fpm2.sock"
# For a PHP-FPM running in a Docker container - type: "phpfpm" instance: "CONTAINER_NAME" port: 9000 stats_url: "fcgi://my-server:9000/status"Built-in Metrics
Section titled “Built-in Metrics”| Metric | Description |
|---|---|
service_status | Status of PHP-FPM |
phpfpm_accepted_conn | Number of requests per second |
phpfpm_active_processes | Number of active processes |
phpfpm_idle_processes | Number of idle processes |
phpfpm_listen_queue | Number of requests in the queue of pending connections |
phpfpm_listen_queue_len | Size of the queue of pending connections |
phpfpm_max_active_processes | Maximum number of active processes since FPM started |
phpfpm_max_children_reached | Number of times the process limit has been reached |
phpfpm_max_listen_queue | Maximum number of requests in the queue of pending connections since FPM started |
phpfpm_slow_requests | Number of slow requests per second |
phpfpm_start_since | Time spent since PHP-FPM start in seconds |
phpfpm_total_processes | Number of idle and active processes |
Monitoring Troubleshooting
Section titled “Monitoring Troubleshooting”See Troubleshoot a Service Check or Missing Metrics for what applies to every service: finding the address and port Glouton really uses, what each check message means, and how to read the collection error — which does not appear in the agent logs at the default level.
The Service Check is not OK
Section titled “The Service Check is not OK”The check only opens the TCP port PHP-FPM listens on. A pool that listens on a UNIX socket has no TCP port, so there is nothing to check: the service stays OK as long as it is detected, and only the absence of metrics tells you something is wrong.
| Status text | Cause | Fix |
|---|---|---|
TCP port 9000, Connection refused |
The pool listens on another port or on a socket | Set port, or rely on stats_url for the metrics |
TCP port N, connection timed out after 10 seconds |
A firewall drops the packets | Open the port for the agent |
Metrics are Missing
Section titled “Metrics are Missing”Glouton queries the FastCGI status page — stats_url if you set one, otherwise
fcgi://<address>:<port>/status. Both the pool and the path have to cooperate:
Query the status page the way Glouton does, with cgi-fcgi from the
libfcgi-bin package:
SCRIPT_NAME=/status SCRIPT_FILENAME=/status REQUEST_METHOD=GET cgi-fcgi -bind -connect 127.0.0.1:9000Replace 127.0.0.1:9000 with the socket path for a socket-based pool.
| What you see | Cause | Fix |
|---|---|---|
| a FastCGI error, or an empty response | pm.status_path not enabled in the pool |
Add pm.status_path = /status to the pool configuration and reload PHP-FPM |
| a FastCGI error | The status path is not /status |
Set stats_url to the real path, for example fcgi://127.0.0.1:9000/fpm-status |
| no address to connect to | The pool listens on a UNIX socket | Set stats_url to the socket path, for example /var/run/php/php8.2-fpm.sock |
permission denied |
The agent cannot read the socket | Add the Glouton user to the socket’s group: sudo adduser glouton www-data |
| metrics for one pool only | Several pools on the same host | Declare one service entry per pool, each with its own instance and stats_url |