php-fpm status with pool of 4 engines

dbembibre

Active member
Anyone know how to show an unified status page when implementing pools of php-fpm engines ?
I set in the engines the same path to status and if i refresh the status page i see one to one every the engine. But exist any way to show all engines at one time in the same url ?

Code:
upstream backend {
    server 127.0.0.1:9000;
    server 127.0.0.1:9001;
    server 127.0.0.1:9002;
    server 127.0.0.1:9003;
}

[www1]
listen=127.0.0.1:9000
pm = dynamic
pm.max_children = 4096
pm.start_servers = 20
pm.status_path = /status
pm.min_spare_servers = 5
pm.max_spare_servers = 128
pm.max_requests = 1024
listen.backlog = -1

[www2]
listen=127.0.0.1:9001
pm = dynamic
pm.max_children = 4096
pm.start_servers = 20
pm.min_spare_servers = 5
pm.status_path = /status
pm.max_spare_servers = 128
pm.max_requests = 1024
listen.backlog = -1

[www3]
listen=127.0.0.1:9002
pm = dynamic
pm.max_children = 4096
pm.start_servers = 20
pm.status_path = /status
pm.min_spare_servers = 5
pm.max_spare_servers = 128
pm.max_requests = 1024
listen.backlog = -1

[www4]
listen=127.0.0.1:9003
pm = dynamic
pm.max_children = 4096
pm.start_servers = 20
pm.status_path = /status
pm.min_spare_servers = 5
pm.max_spare_servers = 128
pm.max_requests = 1024
listen.backlog = -1
 
# grep status /etc/php-fpm.d/www.conf

Why do you use an upstream config when you only have 1 server? Is illogical.
Are you using FreeBSD and friends? Because there is no such thing of backlog -1 in Linux.
max_spare_servers, max_children and max_requests are set to insane values also. Use this formula, to set the workers right:
start_servers = min_spare_servers + (max_spare_servers - min_spare_servers) / 2

You should stop copy/paste'ing from Internet and read the PHP documentation to see what each setting does.
 
Last edited:
# grep status /etc/php-fpm.d/www.conf

Why do you use an upstream config when you only have 1 server? Is illogical.
Are you using FreeBSD and friends? Because there is no such thing of backlog -1 in Linux.
max_spare_servers, max_children and max_requests are set to insane values also. Use this formula, to set the workers right:
start_servers = min_spare_servers + (max_spare_servers - min_spare_servers) / 2

You should stop copy/paste'ing from Internet and read the PHP documentation to see what each setting does.


Yes i know how to set the workers values (max_children = free_memory/ size of each php process ?), are similar to config a worker settings in apache. And max_requests are too high because i dont want to reset the php-fpm process, i want to see if start to swap memory, to later start to down max_request, i think that 300 max_request for pool is enough.

I know that are insane high values, are only for my testing enviroment, under a vmware ESX 4 with 2 servers with 16GB each, one under freebsd and one under netbsd. In my production server only have one php-fpm instance in static mode with 156 max_childrens in the same server that nginx that works fine.
With respect too backlog -1 means unlimited right ? in unix systems.
I want to test two pools in each server with the www partition shared, to see if this work, i have a lot of old small servers in a datacenter of my company, and i want to reutilizate to serve as php-fpm server.
I put first all in one server to see if it works, because in new to nginx and later start to add php-fpm instances of the other server via private ip.


Thanks for your help
 
Last edited:
Write a quick php script to grab all the status pages and output them together

I'm not sure why you are using more than one pool for what appears to be the same dir/user/etc, why not just use one larger pool?
 
Back
Top Bottom