WEB HOSTING SUPPORT NETWORK
     
 

PHP-FPM Status

You can review and manage the active PHP configuration of your subdomains on the PHP Settings page of the Control Panel, along with some diagnostic information that is specific to the PHP-FPM handler.

When you click on the "Manage" button next to one of your subdomains, a page with the PHP settings that pertain to that particular subdomain will be shown.

If FPM with OPcache is chosen as the PHP handler, you can click on the "Status" button to display an additional list of status information. This information is relevant to the performance and load of your website.

Here is a list of the diagnostic values that you can review, along with the meaning of each one:

Accepted conn Number of requests that have been accepted and processed.
Active processes Number of active PHP-FPM processes that accept requests.
Idle processes Number of processes that are idle.
Listen queue This value shows the number of requests that are waiting to be processed.
Listen queue len This is the size of the queue of pending connections.
Max active processes This is the greatest number of active processes that has been reached since the PHP-FPM master process was started.
Max children reached Shows the number of times the PHP-FPM process limit has been hit when FPM tried to start more processes.
Max listen queue Shows the largest number of requests in the queue since the master PHP-FPM process was started.
Pool This is the name of the FPM pool. Usually, this will be set to the name of the subdomain.
Process manager Type of process management strategy chosen for your website. On our servers, this is set to "ondemand".
Slow requests Number of requests that have taken more time to be processed than a configured timeout.
Start since Shows how many seconds the master PHP-FPM process has been running for.
Start time Shows when the master PHP-FPM process was started.
Total processes Number of all PHP-FPM processes that are currently running.

The most important metrics you should pay attention to are the "Max children reached" and "Listen queue" ones.

Max children reached

This value will be incremented whenever the PHP-FPM master process reaches the maximum number of processes it can start in order to handle requests.

If this value is not zero, this means that there have been more requests to your website that can be comfortably handled by your hosting service, and requests have started piling up on a queue for processing. This may make your site slower than usual, and it may also be an indication of other problems.

Listen queue

This value shows the number of requests pending processing. If there are requests in the queue, this may mean that your website is overloaded or there is some other problem that causes it to be slower than usual.

Details about running processes

You can also review the status of your running FPM processes. This can be done from the command line using the php-fpm-status tool. This way, you can check what requests your website is currently processing.

To do that, you have to log in over SSH and run the following command:

php-fpm-status www.example.com

You should replace "www.example.com" with the name of your website.

Here is what the output of the command looks like:

Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate, max-age=0
Content-Type: text/plain
 
pool:                 www.example.com
process manager:      ondemand
start time:           25/Apr/2021:01:37:49 +0800
start since:          1695502
accepted conn:        66673
listen queue:         0
max listen queue:     0
listen queue len:     0
idle processes:       1
active processes:     2
total processes:      3
max active processes: 20
max children reached: 2
slow requests:        0
 
************************
pid:                  22441
state:                Running
start time:           17/May/2021:04:14:52 -0400
start since:          871
requests:             127
request duration:     685
request method:       GET
request URI:          /fpm-status-ShOC0gaIVoh0eiH1eEGNahVEK?full
content length:       0
user:                 -
script:               -
last request cpu:     0.00
last request memory:  0

************************
pid:                  22442
state:                Idle
start time:           17/May/2021:04:14:52 -0400
start since:          871
requests:             127
request duration:     64918
request method:       POST
request URI:          /index.php
content length:       36
user:                 -
script:               /home/example/www/www/index.php
last request cpu:     2.62
last request memory:  2097152

The first part of the output shows the same information as the Status section described above.

After that, there is information about each active FPM worker process. The details are as follows:

pid This is the system ID of the process.
state State the process is in. There are likely to be one or more "Idle" processes that are waiting for requests.
start time When the process was started.
start since Shows how many seconds the worker process has been running for.
requests The number of requests this worker process has handled.
request duration How long it took (microseconds) to handle the last processed request.
request method The HTTP method of the last processed request.
request URI The URI of the request. Note that depending on the configuration of your website, this may not match the exact URI sent to the web server.
content length How many bytes long the request is.
user N/A on our servers.
script File system path to the running PHP script.
last request cpu How much CPU time (seconds) it took the server to process the request.
last request memory The amount of memory (in bytes) the server used when processing the request.

The most important metrics here are the "request duration", "last request cpu", and "last request memory" ones.

Request duration

This shows how long the PHP FPM worker took to process the last request it handled. This time is in microseconds, so 5,000,000 here would mean five seconds.

Last request CPU

This shows how many CPU seconds it took the server to process the last request. This metric is important because it can show you if a script is overloading your account. Lower values are better for both performance and load.

Last request memory

This shows the amount of memory allocated to the PHP FPM worker process during the last request.

While the limit on our servers is quite high, you should have in mind that running out of memory may cause your website to become unresponsive. If this value is often high, it can show potential problems with resource usage in your PHP applications.