PHP-FPM has a built-in status page, opened to view the detailed operation of PHP-FPM, to php-fpm optimization to bring help. The following article will record how to view and monitor the PHP-FPM running status in real time.
Open php-fpm.conf, configure PHP-FPM Status page options
Pm.status_path =/phpfpm_status (default is: status)
Configure NGINX.CONF to add accessible server (not to be placed in HTTP)
server {
Listen 80;
server_name 127.0.0.1;
Location/phpfpm_status {
Fastcgi_pass 127.0.0.1:9000;
Include Fastcgi_params;
Fastcgi_param script_filename $fastcgi _script_name;
}
}
Restart or overload Nginx, and PHP-FPM, as follows:
Service PHP-FPM Restart
Service Nginx Restart
The browser access results are shown below:
You can also view the PHP-FPM status output format with different parameters:
Http://www.111cn.net/status #默认纯文本
Http://www.111cn.net/status?json #json格式
Http://www.111cn.net/status?html #html格式
Http://www.111cn.net/status?xml #xml格式
You can also view process details by using the full parameter:
Http://www.111cn.net/status?full
Http://www.111cn.net/status?json&full
Http://www.111cn.net/status?html&full
Http://www.111cn.net/status?xml&full
Now pay for the PHP-FPM status parameter details:
POOL–FPM pool name, most of which are www
Process manager– processes management method, value: Static, dynamic or OnDemand. Dynamic
Start time– launch date, if Reload php-fpm, time will be updated
Start since– run time long
Accepted conn– the number of requests received by the current pool
Listen queue– request Wait queue, if this value is not 0, then increase the number of FPM processes
Max Listen queue– request wait queue highest number
Listen queue Len–socket wait queues length
Idle processes– number of idle processes
Active processes– dynamic number of processes
Total processes– Process Quantity
Max Active processes– Maximum activity number (FPM start count)
Max children reached-the number of maximum limit of the path process, if this number is not 0, that means that your maximum number of processes is too small, please change the larger.
Slow requests– enabled PHP-FPM Slow-log, number of slow requests