This article mainly introduces the PHP-FPM open State statistics method, the article introduces very detailed, to everyone has a certain reference learning value, the need for friends below to see together.
This article mainly introduces about PHP-FPM open State statistics related content, share out for everyone to refer to the study, the following to see a detailed introduction:
Enable the PHP-FPM status feature
$ cat/usr/local/php/etc/php-fpm.conf | grep Statuspm.status_path =/php-fpm_status
Nginx Configuration
Add location to the default host
Location ~ ^/(php-fpm_status|ping) {Fastcgi_pass unix:/dev/shm/php-cgi.sock;//If you are not using sock, change to corresponding port include fastcgi.conf; Access_log off; Allow 127.0.0.1; Deny all; }
Access test
$ Curl 127.0.0.1/php-fpm_statuspool: wwwprocess manager:dynamicstart time: 12/may/2017:13:12:55 +0800start Since: 25552accepted conn:8649listen queue: 0max listen queue:0listen queue len:0idle processes:13active proce Sses:1total Processes:14max Active Processes:7max children Reached:0slow requests:0
PHP-FPM Status Detailed
POOL-FPM pool name, mostly www
Process manager– processes management mode, value: static, dynamic
Start time– start date, if Reload php-fpm, the time will be updated
Start since– Run time
Accepted conn– the number of requests accepted 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– Requests the highest number of wait queues
Listen queue Len–socket wait queues length
Idle processes– Free Process number
Active processes– number of active processes
Total processes– Process Quantity
Max Active processes– maximum number of active processes (FPM start count)
Max children reached-the maximum number of times a process is limited, if the number is not 0, that means your maximum number of processes is too small, please change it a bit.
Slow requests– enabled php-fpm slow-log
, number of slow requests
PHP-FPM Other parameters
PHP-FPM Status page A place to personalize is that it can take parameters, can take parameters JSON, XML, HTML, and the first three parameters can be combined with the full
Please try it yourselfurl?php-fpm_status?json
Summarize