I don't believe there is any way to add a pool without restarting/reloading (as per this).
I do think that redundancy is the best approach to this, I do believe, that you might accomplish what you want with reload
. Since it is a graceful reload it should wait for the processes to finish.
Essentially, pass the SIGUSR2
signal to php-fpm, and it will gracefully reload all workers + reload the fpm conf/binary.
I believe that amounts to
kill -USR2 `cat $php_fpm_PID`
So, you modify the conf - and reload - shouldn't result in noticeable downtime.
Another option is to run one process per user - you can add new users without terminating existing processes, but the resource requirements are significantly higher (and, for 1000+ users aren't likely to be practical).
One more option is to create a temporary php-cgi process for the new user, and delay reloading the server until later (i.e. low load period, or when you have multiple users to add). This would reduce downtime, but still bring up the new user's subdomain immediately.
None of the above are exactly ideal, and the only practical solution to no downtime would be the multiple server approach.
Yes, you're right - If you specify these values in php-fpm pool config file, it will override "default" values in php.ini
config file - but only for this FPM pool.
In addition to this, remember that some of php directives could be defined as php_admin_value
and php_admin_flag
as described in PHP Documentation (see the bottom of page).
Best Answer
Note: prepend
sudo
if not rootUsing SysV Init scripts directly:
Using service wrapper script
Using Upstart (e.g. ubuntu):
Using systemd (newer servers):
Or whatever the equivalent is on your system.