View and monitor the running status of PHP-FPM in real time

Source: Internet
Author: User
: This article mainly introduces the real-time view and monitoring of the PHP-FPM running status, for PHP tutorials interested in students can refer. The PHP-FPM has a built-in status page that enables you to view the detailed running status of the PHP-FPM to help with PHP-FPM optimization. The following article will record how to view and monitor the running status of php-fpm in real time.

Open php-fpm.conf, configure php-fpm status page options

Pm. status_path =/phpfpm_status (default value: status)

Configure nginx. conf and add accessible servers (not 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 reload nginx and php-fpm. the command is as follows:

Service php-fpm restart
Service nginx restart

The browser access result is as follows:

In addition, you can view the output format of php-fpm status with different parameters:

Http://www.phpernote.com/status # default plain text
Http://www.phpernote.com/status? Json # json format
Http://www.phpernote.com/status? Html # html format
Http://www.phpernote.com/status? Xml # xml format

You can also view the process details by using the full parameter:

Http://www.phpernote.com/status? Full
Http://www.phpernote.com/status? Json & full
Http://www.phpernote.com/status? Html & full
Http://www.phpernote.com/status? Xml & full

The following is a detailed description of the PHP-FPM status parameter:

Pool-fpm pool sub-name, mostly www

Process manager-process management mode; value: static, dynamic or ondemand. dynamic

Start time-start date. If php-fpm is Reloaded, the time will be updated.

Start since-running duration

Accepted conn-number of requests received by the current pool

Listen queue-request waiting queue. if this value is not 0, increase the number of FPM processes.

Max listen queue-maximum number of request waiting queues

Listen queue len-socket waiting 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 startup)

Max children reached-maximum number of processes on the Boulevard. if this 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

The above introduces the real-time view and monitoring of the PHP-FPM running status, including the content of the aspect, hope to be interested in PHP Tutorial friends help.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.