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
- 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
# Get a reliable service check of your FPM pool with that one
# Set the expected reply to the ping.
- If you have auth enabled on the status page, amend the config file as necessary.
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:
php_fpm ----- - 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/agent.py check php_fpm
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.