Real-time viewing and monitoring of PHP-FPM running status, php-fpm details
Preface
Everyone knows that the PHP-FPM has built-in status page, after enabling can view the detailed running status of the PHP-FPM, to bring help to the PHP-FPM optimization.
Open php-fpm.conf, configure php-fpm status page options
pm.status_path = /phpfpm_status
Configure nginx. conf and add accessible server
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 reload nginx, and php-fpm
service php-fpm restartservice nginx restart
Browser access result:
You can view the output format of php-fpm status with different parameters:
Http://www.foo.bar/status # default plain text http://www.foo.bar/status? Json # json format http://www.foo.bar/status? Html # html format http://www.foo.bar/status? Xml # xml format # Can the full parameter view the process details http://www.foo.bar/status? Fullhttp: // www. foo. bar/status? Json & fullhttp: // www. foo. bar/status? Html & fullhttp: // www. foo. bar/status? Xml & full
PHP-FPM status parameter description:
Pool-fpm pool sub-name, mostly for wwwprocess manager-process management mode, value: static, dynamic or ondemand. dynamicstart time-start date. If php-fpm is reloaded, the time will update start since-run duration accepted conn-number of requests received by the current pool listen queue-request waiting queue, if the value is not 0, increase the number of FPM processes max listen queue-Maximum number of request waiting queues listen queue len-socket wait queue length idle processes-Number of idle processes active processes-number of active processes total processes- total number of processes max active processes-Maximum number of active processes (starting from FPM) max children r The maximum number of eached-Avenue processes. If the number is not 0, it indicates that the maximum number of processes is too small. please increase the number. Slow requests-php-fpm slow-log enabled, number of slow requests
Summary
The above is all about this article. I hope this article will help you in your study or work. If you have any questions, please leave a message.