How to check current pm.max_children setting?

I have modified pm.max_children in /opt/plesk/php/7.0/etc/php-fpm.d/domain.com.conf file.

I restarted the php70-fpm service and want to check whether my settings are enabled or not.

How can I check this setting?


Solution 1:

If you just want to know how many workers are currently running, you can try with HTOP, do a htop and filter (F4) with "php-fpm".

Or with ps

ps aux | grep "php-fpm: pool"

If you want precise and technical informations, you can use the fpm status page:

Add this to you pool configuration:

pm.status_path = /status

Then this in your nginx configuration: (adapt to your configuration)

location ~ ^/(status|ping)$ {
     access_log off;
     allow 127.0.0.1;
     allow 10.10.10.10#your-ip;
     deny all;
     include fastcgi_params;
     fastcgi_pass 127.0.0.1:9000;
}

You can then use CURL to query with:

 curl http://localhost/status

Which gives you something like:

pool:                 www
process manager:      dynamic
start time:           01/Mar/2019:15:16:10 +0100
start since:          2551
accepted conn:        7843
listen queue:         0
max listen queue:     0
listen queue len:     0
idle processes:       8
active processes:     2
total processes:      10
max active processes: 10
max children reached: 0

More informations / Source: https://easyengine.io/tutorials/php/fpm-status-page