Skip to content

PHP-FPM

Auto-Discovery
Health Check
Metrics
Logs

To enable metrics gathering, Bleemeo agent needs access to PHP-FPM status page and to know where it may find this page.

PHP-FPM needs to expose its status. For example the pool configuration should include:

pm.status_path = /status

By defaults, Bleemeo agent try fcgi://<fpm-address>:<fpm-port>/status. E.g using FCGI over the TCP port on which PHP-FPM listen and use “/status” path.

If it does not match your configuration, you will need to override “stats_url” parameters by adding the following to /etc/glouton/conf.d/99-local.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"
# See below for additional note on UNIX socket permission
# 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"
# See below for additional note on UNIX socket permission
# For a PHP-FPM running in a Docker container
- type: "phpfpm"
instance: "CONTAINER_NAME"
port: 9000
stats_url: "fcgi://my-server:9000/status"

If using UNIX socket, you should make sure Glouton user has permission to access the socket. This usually means that Glouton user should be member of the group running php-fpm, which is www-data on Debian/Ubuntu system. Therefor sudo adduser glouton www-data and a restart of Bleemeo agent will grant access.

Agent gathers the following metrics:

MetricDescription
service_statusStatus of PHP-FPM
phpfpm_accepted_connNumber of requests per second
phpfpm_active_processesNumber of active processes
phpfpm_idle_processesNumber of idle processes
phpfpm_listen_queueNumber of requests in the queue of pending connections
phpfpm_listen_queue_lenSize of the queue of pending connections
phpfpm_max_active_processesMaximum number of active processes since FPM started
phpfpm_max_children_reachedNumber of times the process limit has been reached
phpfpm_max_listen_queueMaximum number of requests in the queue of pending connections since FPM started
phpfpm_slow_requestsNumber of slow requests per second
phpfpm_start_sinceTime spent since PHP-fpm start in seconds
phpfpm_total_processesNumber of idle + active processes