Skip to content

Commit cb9b690

Browse files
authored
Merge pull request #64 from flownative/task/configurable-php-fpm-max-requests
Add pm.max_requests = 500, make configurable
2 parents efa781f + ee2ba57 commit cb9b690

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ similar mechanism in Kubernetes or your actual platform.
8686
| PHP_FPM_GROUP | string | 1000 | Group id for running PHP (read-only) |
8787
| PHP_FPM_PORT | string | 9000 | Port the PHP-FPM process listens to |
8888
| PHP_FPM_MAX_CHILDREN | string | 20 | Maximum number of children to run |
89+
| PHP_FPM_MAX_REQUESTS | string | 500 | Number of requests after which a worker is recycled to mitigate memory leaks; set to 0 to disable |
8990
| PHP_FPM_PM_MODE | string | ondemand | Process manager mode for PHP-FPM; "static", "ondemand" or "dynamic" |
9091
| PHP_SPX_ENABLE | boolean | false | Enable or disable the SPX extension |
9192
| PHP_SPX_KEY | string | dev | The secret key used for authentication |

root-files/opt/flownative/lib/php-fpm.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export PHP_FPM_GROUP="1000"
5252
export PHP_FPM_PORT="${PHP_FPM_PORT:-9000}"
5353
export PHP_FPM_PM_MODE="${PHP_FPM_PM_MODE:-ondemand}"
5454
export PHP_FPM_MAX_CHILDREN="${PHP_FPM_MAX_CHILDREN:-20}"
55+
export PHP_FPM_MAX_REQUESTS="${PHP_FPM_MAX_REQUESTS:-500}"
5556
export PHP_FPM_ERROR_LOG_PATH="${PHP_FPM_ERROR_LOG_PATH:-/opt/flownative/log/php-fpm-error.log}"
5657
export PHP_FPM_ACCESS_LOG_PATH="${PHP_FPM_ACCESS_LOG_PATH:-/opt/flownative/log/php-fpm-access.log}"
5758
EOF

root-files/opt/flownative/php/etc/php-fpm.conf.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ listen = [::]:${PHP_FPM_PORT}
2020

2121
pm = ${PHP_FPM_PM_MODE}
2222
pm.max_children = ${PHP_FPM_MAX_CHILDREN}
23+
pm.max_requests = ${PHP_FPM_MAX_REQUESTS}
2324

2425
pm.status_path = /php-fpm-status
2526

0 commit comments

Comments
 (0)