• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved How can I activate PHP-FPM status page?

TuÄŸberkK

New Pleskian
Hello guys, some of my php-fpm proccesses are going crazy with cpu usage so I need the details of them. I figured to see that I need to reach the status page of PHP-FPM. But I couldn't manage that, I searched a lot.

PHP Settings --> Additional directives
Code:
pm.status_path=/status

Apache & nginx Settings --> Additional nginx directives
Code:
location ~ ^/status$ {
    allow 127.0.0.1;
    allow [yourip];
    deny all;
    fastcgi_split_path_info ^((?U).+\\.php)(/?.+)$;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_pass "unix:///var/www/vhosts/system/[yourdomainname]/php-fpm.sock";
    # I write my domain name here: [yourdomainname]
    include /etc/nginx/fastcgi.conf;
}

After applying these code and running /status on the web site I get "File not found." error.
 
Yes, that is the status page but when status page run with "status?full" parameter it shows in detail which scripts are being used.

For example: https://i.stack.imgur.com/WFw1l.png

I am trying to do this because some of my php-fpm proccess are consuming a lot of CPU, so I want to figure that out. If you know any other alternative ways to achieve this, I can do that too.

Thank you for your answer.
 
There used to be a support article in the Knowledge Base on the PHP FPM status page (how to use it in Plesk), but I cannot find it any longer. Maybe Plesk staff can?
 
I cannot find that article either, I think it is removed somehow. How can I ask this to Plesk staff?

I really need this solution or smt else, my server's cpu is at %100 constantly and I cant figure out why.
 
Question
How to enable pm.status_path and ping.path directives in order to monitor each instance of PHP-FPM by nginx (native, plesk-php56-fpm, plesk-php70-fpm and etc.)?

Answer
  1. Add required directives to [php-fpm-pool-settings] section in the /var/www/vhosts/system/example.com/conf/php.ini file.

    # cat /var/www/vhosts/system/example.com/conf/php.ini
    [php-fpm-pool-settings]
    pm.status_path = /status
    ping.path = /ping

    Note: if there is no such file, create a new one.

  2. Apply the changes:

    # /usr/local/psa/bin/php_settings -u

  3. Go to Domains > example.com > PHP Settings and set PHP to FPM application served by nginx

  4. Go to Domains > example.com > Apache & nginx Settings and add the following directives under Additional nginx directives section :

    location ~ ^/(status|ping)$ {
    fastcgi_split_path_info ^((?U).+\\.php)(/?.+)$;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_pass "unix:///var/www/vhosts/system/example.com/php-fpm.sock";
    include /etc/nginx/fastcgi.conf;
    }
Additional Information
Functionality to monitor PHP-FPM by apache is not implemented in Plesk at the moment.

How to change PHP-FPM pool settings for a domain in Plesk?
 
Back
Top