Monitoring PHP-FPM

Configure the Server Density agent to monitor your PHP-FPM pool to:

• Collect important metrics, such as performance & requests
• Identify overall server slowdowns caused by the pool

Monitored metrics

  • Processes Idle
  • Processes Active
  • Processes Max Reached
  • Processes Total
  • Requests Accepted
  • Listen Queue Size

Installing the PHP-FPM plugin package

Install the PHP-FPM plugin on Debian/Ubuntu:

sudo apt-get install sd-agent-phpfpm

Install the PHP-FPM plugin on RHEL/CentOS:

sudo yum install sd-agent-phpfpm

Read more about agent plugins.

Configuring the agent to monitor PHP-FPM

1. To monitor PHP-FPM, you’ll need to enable the status option in your PHP config. 

2. Configure /etc/sd-agent/conf.d/php_fpm.yaml


- # Get metrics from your FPM pool with this URL
status_url: http://localhost/status
# Get a reliable service check of your FPM pool with that one
ping_url: http://localhost/ping
# Set the expected reply to the ping.
ping_reply: pong
  • If you have auth enabled on the status page, amend the config file as necessary.
  • It is not possible disable SSL checking via the check configuration.

3. Restart the agent

sudo /etc/init.d/sd-agent restart

Verifying the configuration
Execute info to verify the configuration with the following:

sudo /etc/init.d/sd-agent info 

If the agent has been configured correctly you’ll see an output such as:

  - instance #0 [OK]
  - Collected 8 metrics & 0 events

You can also view the metrics returned with the following command:

sudo -u sd-agent /usr/share/python/sd-agent/ check php_fpm

Configuring graphs

Click the name of your server from the Devices list in your Server Density account then go to the Metrics tab. Click the + Graph button on the right then choose the PHP-FPM metrics to display the graphs. The metrics will also be available to select when building dashboard graphs.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Monday  —  Friday.

10am  —  6pm UK.

Dedicated Support.