diff --git a/README.md b/README.md index 8c1d5a749c685e56372915556a0a68ebef09a679..a605126d8844c5f51b6e687ad7ce14e1b233362f 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,8 @@ data: {} **phpconfig**: ``` +# If set, fpm forks exactly the number of worker processes specified (pm=static, pm.max_children=COUNT) +fpm_process_count: 5 ini: post_max_size: 64M upload_max_filesize: 64M diff --git a/templates/php-fpm/www.conf.j2 b/templates/php-fpm/www.conf.j2 index b9b341172201839612efb79c2c3671d1676e44eb..e16b2cebea59e18e76539201382f36bd9162eca4 100644 --- a/templates/php-fpm/www.conf.j2 +++ b/templates/php-fpm/www.conf.j2 @@ -99,7 +99,11 @@ listen.group = www-data ; pm.process_idle_timeout - The number of seconds after which ; an idle process will be killed. ; Note: This value is mandatory. +{% if nginx.php.fpm_process_count|d(False) %} +pm = static +{% else %} pm = dynamic +{% endif %} ; The number of child processes to be created when pm is set to 'static' and the ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. @@ -110,7 +114,7 @@ pm = dynamic ; forget to tweak pm.* to fit your needs. ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' ; Note: This value is mandatory. -pm.max_children = 50 +pm.max_children = {{ nginx.php.fpm_process_count|d(50) }} ; The number of child processes created on startup. ; Note: Used only when pm is set to 'dynamic'