diff --git a/docs/content/docs/7.reference/1.environment-variable-specification.md b/docs/content/docs/7.reference/1.environment-variable-specification.md index 597464177..510ad729d 100644 --- a/docs/content/docs/7.reference/1.environment-variable-specification.md +++ b/docs/content/docs/7.reference/1.environment-variable-specification.md @@ -49,6 +49,7 @@ We like to customize our images on a per app basis using environment variables. `PHP_FPM_PM_MAX_SPARE_SERVERS`
*Default: "3"*|The desired maximum number of idle server processes. Used only when pm is set to dynamic. (Official docs)|fpm* `PHP_FPM_PM_MIN_SPARE_SERVERS`
*Default: "1"*|The desired minimum number of idle server processes. Used only when pm is set to dynamic. (Official docs)|fpm* `PHP_FPM_PM_START_SERVERS`
*Default: "2"*|The number of child processes created on startup. Used only when pm is set to dynamic. (Official docs)|fpm* +`PHP_FPM_PM_MAX_REQUESTS`
*Default: "0"*|The number of requests each child process should execute before respawning. This can be useful to work around memory leaks in 3rd party libraries. (Official docs)|fpm* `PHP_FPM_POOL_NAME`
*Default: "www"*|Set the name of your PHP-FPM pool (helpful when running multiple sites on a single server).|fpm* `PHP_FPM_PROCESS_CONTROL_TIMEOUT`
*Default: "10s"*|Set the timeout for the process control commands. (Official docs)|fpm* `PHP_MAX_EXECUTION_TIME`
*Default: "99"*|Set the maximum time in seconds a script is allowed to run before it is terminated by the parser. (Official docs)|all diff --git a/src/php-fpm.d/usr/local/etc/php-fpm.d/docker-php-serversideup-pool.conf b/src/php-fpm.d/usr/local/etc/php-fpm.d/docker-php-serversideup-pool.conf index e8d3e0cff..10e74a3e2 100644 --- a/src/php-fpm.d/usr/local/etc/php-fpm.d/docker-php-serversideup-pool.conf +++ b/src/php-fpm.d/usr/local/etc/php-fpm.d/docker-php-serversideup-pool.conf @@ -141,6 +141,10 @@ pm.min_spare_servers = ${PHP_FPM_PM_MIN_SPARE_SERVERS} ; Note: Mandatory when pm is set to 'dynamic' pm.max_spare_servers = ${PHP_FPM_PM_MAX_SPARE_SERVERS} +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. For +; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +pm.max_requests = ${PHP_FPM_PM_MAX_REQUESTS} ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Healthcheck settings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/src/variations/fpm-apache/Dockerfile b/src/variations/fpm-apache/Dockerfile index e6c4cdcf3..5a07f5c35 100644 --- a/src/variations/fpm-apache/Dockerfile +++ b/src/variations/fpm-apache/Dockerfile @@ -63,6 +63,7 @@ ENV APACHE_DOCUMENT_ROOT=/var/www/html/public \ PHP_FPM_PM_MAX_SPARE_SERVERS="3" \ PHP_FPM_PM_MIN_SPARE_SERVERS="1" \ PHP_FPM_PM_START_SERVERS="2" \ + PHP_FPM_PM_MAX_REQUESTS="0" \ PHP_FPM_POOL_NAME="www" \ PHP_FPM_PROCESS_CONTROL_TIMEOUT="10s" \ PHP_MAX_EXECUTION_TIME="99" \ diff --git a/src/variations/fpm-nginx/Dockerfile b/src/variations/fpm-nginx/Dockerfile index a8197b6df..034b008d7 100644 --- a/src/variations/fpm-nginx/Dockerfile +++ b/src/variations/fpm-nginx/Dockerfile @@ -87,6 +87,7 @@ ENV APP_BASE_DIR=/var/www/html \ PHP_FPM_PM_MAX_SPARE_SERVERS="3" \ PHP_FPM_PM_MIN_SPARE_SERVERS="1" \ PHP_FPM_PM_START_SERVERS="2" \ + PHP_FPM_PM_MAX_REQUESTS="0" \ PHP_FPM_POOL_NAME="www" \ PHP_FPM_PROCESS_CONTROL_TIMEOUT="10s" \ PHP_MAX_EXECUTION_TIME="99" \ diff --git a/src/variations/fpm/Dockerfile b/src/variations/fpm/Dockerfile index e97261604..f6771af72 100644 --- a/src/variations/fpm/Dockerfile +++ b/src/variations/fpm/Dockerfile @@ -38,6 +38,7 @@ ENV APP_BASE_DIR=/var/www/html \ PHP_FPM_PM_MAX_SPARE_SERVERS="3" \ PHP_FPM_PM_MIN_SPARE_SERVERS="1" \ PHP_FPM_PM_START_SERVERS="2" \ + PHP_FPM_PM_MAX_REQUESTS="0" \ PHP_FPM_POOL_NAME="www" \ PHP_FPM_PROCESS_CONTROL_TIMEOUT="10s" \ PHP_MAX_EXECUTION_TIME="99" \