Can't PHP start/max/min children for some reason

Hi all,

We are having this kind odd issue with php7 on easy engine 3.7.5 with fastcgi: we edit the www.conf file to change these but realoding/restarting the service, even rebooting the droplet in Digital Ocean does not change a thing… it comes back with 0 starting children and just spawns more as the traffic starts to come in. We mainly want to increase the start servers so it can handle spikes in traffic better…

pm = ondemand
pm.max_children = 100
pm.start_servers = 50
pm.min_spare_servers = 40
pm.max_spare_servers = 60

Anyone ever experienced this or should I change some other files to the changes to apply?

ee v3 hasn’t been supported for a long time now - even critical security fixes ended January last year! :worried:

So it would be wise to either upgrade to v4 or migrate over to WordOps which was a fork of v3 that has improved on it a lot and is still supported. More info on all that here.

1 Like

Check if the file you are editing.
How to find out which config is working?

sudo cat /etc/nginx/conf.d/upstream.conf

upstream php7 {
server unix:/var/run/php7.0-fpm.sock;
}

Possible config options:
/etc/php/7.0/fpm/pool.d/www.conf
/etc/php/7.1/fpm/pool.d/www.conf
/etc/php/7.2/fpm/pool.d/www.conf
/etc/php/7.3/fpm/pool.d/www.conf

I use v3 on two servers. Everything is working. Everything suits me.

It may work but it is a security risk :slight_smile:. I stayed with v3 for a long time too - but WordOps works exactly the same way (because it is v3 with extra development), and is pretty easy to move over to.

/etc/nginx/conf.d/upstream.conf
upstream php {
    server 127.0.0.1:9000;
}

upstream debug {
    server 127.0.0.1:9001;
}

upstream php7 {
    server 127.0.0.1:9070;
}

upstream debug7 {
    server 127.0.0.1:9170;
}

Yeah, there is just server 127.0.0.1:9070 in that file, but anyway, the weird thing is that it obeys the max children number we change, just not the start servers… but not really a big deal, just a spike tends to slow down at first and we have some RAM to spare so we wanted to squeeze every single performance out of it.

Also, I dunno if this is the case, but we started with PHP 7.0 but later on moved to 7.2 with EasyEngine instructions, maybe thats why it is weird, the config file is in the 7.0 folder, but the upstream connects to the 7.2 I guess…

The www.conf is only in the 7.0 folder, as there is nothing else in 7.2 besides “mods-available”, the content of the file is as this:

/etc/php/7.0/fpm/pool.d
[www]
user = www-data
group = www-data
listen = 127.0.0.1:9070
listen.owner = www-data
listen.group = www-data
pm = ondemand
pm.max_children = 70
pm.start_servers = 30
pm.min_spare_servers = 20
pm.max_spare_servers = 40
ping.path = /ping
pm.status_path = /status
pm.max_requests = 500
request_terminate_timeout = 300

P.S.: I might migrate to WordOps as “marty” suggested anyway or try another solution like Webinoly or some other. Thanks for the help.

Moving to UNIX Sockets.

  1. /etc/nginx/conf.d/upstream.conf
upstream php7 {
server unix:/run/php7.2-fpm.sock;
}
  1. /etc/php/7.2/fpm/pool.d/www.conf
listen =  /run/php7.2-fpm.sock
  1. sudo service nginx reload && sudo ee stack reload --php7 && sudo service php7.2-fpm reload