From 5dbe645a3c9a33cf3d02cb16d9f089c9cb6b692f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Guti=C3=A9rrez?= Date: Tue, 21 May 2024 22:31:44 +0200 Subject: [PATCH] tweak fpm config --- templates/fpm/php-fpm-www.conf.twig | 6 ++++++ templates/fpm/php-fpm.conf.twig | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/templates/fpm/php-fpm-www.conf.twig b/templates/fpm/php-fpm-www.conf.twig index a85f40d..bf2ae05 100644 --- a/templates/fpm/php-fpm-www.conf.twig +++ b/templates/fpm/php-fpm-www.conf.twig @@ -24,6 +24,12 @@ group = docker ; Note: This value is mandatory. listen = [::]:9000 +; 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. +; Default Value: 0 +pm.max_requests = 500 + ; Clear environment in FPM workers ; Prevents arbitrary environment variables from reaching FPM worker processes ; by clearing the environment in workers before env vars specified in this diff --git a/templates/fpm/php-fpm.conf.twig b/templates/fpm/php-fpm.conf.twig index bad6b3f..25680aa 100644 --- a/templates/fpm/php-fpm.conf.twig +++ b/templates/fpm/php-fpm.conf.twig @@ -22,4 +22,25 @@ error_log = /var/log/php/php-fpm.log ; Default Value: notice log_level = notice +; If this number of child processes exit with SIGSEGV or SIGBUS within the time +; interval set by emergency_restart_interval then FPM will restart. A value +; of '0' means 'Off'. +; Default Value: 0 +emergency_restart_threshold = 10 + +; Interval of time used by emergency_restart_interval to determine when +; a graceful restart will be initiated. This can be useful to work around +; accidental corruptions in an accelerator's shared memory. +; Available Units: s(econds), m(inutes), h(ours), or d(ays) +; Default Unit: seconds +; Default Value: 0 +emergency_restart_interval = 1m + +; Time limit for child processes to wait for a reaction on signals from master. +; Available units: s(econds), m(inutes), h(ours), or d(ays) +; Default Unit: seconds +; Default Value: 0 +process_control_timeout = 10s + + {{ comment }}