Monitor PHP-FPM with Nixstats


The following metrics are submitted to Nixstats.

  • Accepted connections (per second, total)
  • Active processes
  • Total processes
  • Idle processes
  • Max active processes
  • Listen queue
  • Listen queue length
  • Max listen queue
  • Max children reached
  • Start time
  • Start since
  • Pool
  • Process manager
  • Slow requests


  • urllib2
  • json

PHP-FPM status page

To enable the PHP-FPM status page add the following code to your PHP-FPM pool configuration file.

pm.status_path = /status_phpfpm

Now make the following changes to your NGiNX configuration file.

server {
    server_name localhost;
    location /status_phpfpm {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        deny all;

You can test if the status page is working by running
wget -qO-

Configure the plugin

To enable the plugin edit the nixstats configuration file. This file is usually located at /etc/nixstats.ini.

Add the following settings to the end of the file.

enabled = yes
status_page_url =

Test to see if the plugin is working by running nixstatsagent --test phpfpm. It should show the following metrics:

    "accepted_conn": 3015,
    "accepted_conn_per_second": 0.0,
    "active_processes": 1,
    "idle_processes": 0,
    "listen_queue": 0,
    "listen_queue_len": 128,
    "max_active_processes": 1,
    "max_children_reached": 0,
    "max_listen_queue": 1,
    "pool": "www",
    "process_manager": "ondemand",
    "slow_requests": 0,
    "start_since": 294686,
    "start_time": 1492504250,
    "total_processes": 1

Now you can restart the agent service nixstatsagent restart to start monitoring PHP-FPM.