diff --git a/php_fpm/Dockerfile b/php_fpm/Dockerfile index 7cda7af..b47850e 100644 --- a/php_fpm/Dockerfile +++ b/php_fpm/Dockerfile @@ -33,9 +33,12 @@ ENV NAMELESS_PATH_HIDE=true # Enable friendly URLs and hide the option by default, they work fine with the included configuration and there is no reason to turn it off. ENV NAMELESS_FRIENDLY_URLS=true NAMELESS_FRIENDLY_URLS_HIDE=true -ENV PHP_MAX_CHILDREN=32 \ - PHP_MIN_SPARE_SERVERS=2 \ - PHP_MAX_SPARE_SERVERS=4 +ENV PHP_PM="ondemand" \ + PHP_PM_MAX_CHILDREN="16" \ + PHP_PM_MAX_REQUESTS="200" \ + PHP_PM_IDLE_TIMEOUT="1m" \ + PHP_PM_MIN_SPARE_SERVERS="2" \ + PHP_PM_MAX_SPARE_SERVERS="4" # The www-data user has uid 33 on Debian/Ubuntu which is what most people are used to USER 33 diff --git a/php_fpm/entrypoint.sh b/php_fpm/entrypoint.sh index 7c40c40..11da934 100644 --- a/php_fpm/entrypoint.sh +++ b/php_fpm/entrypoint.sh @@ -57,10 +57,13 @@ fi { \ echo "[www]" - echo "pm.max_children = $PHP_MAX_CHILDREN" - echo "pm.start_servers = $PHP_MIN_SPARE_SERVERS" - echo "pm.min_spare_servers = $PHP_MIN_SPARE_SERVERS" - echo "pm.max_spare_servers = $PHP_MAX_SPARE_SERVERS" + echo "pm = $PHP_PM" + echo "pm.max_children = $PHP_PM_MAX_CHILDREN" + echo "pm.max_requests = $PHP_PM_MAX_REQUESTS" + echo "pm.process_idle_timeout = $PHP_PM_IDLE_TIMEOUT" + echo "pm.start_servers = $PHP_PM_MIN_SPARE_SERVERS" + echo "pm.min_spare_servers = $PHP_PM_MIN_SPARE_SERVERS" + echo "pm.max_spare_servers = $PHP_PM_MAX_SPARE_SERVERS" } > /tmp/additional-php-fpm-settings.conf # this file is symlinked to the correct php-fpm configuration dir exec php-fpm