Skip to content

Commit 551c3fb

Browse files
authored
Merge pull request #65 from flownative/task/slowlog-setting
Add configurable request_slowlog_timeout
2 parents b0dfdda + 6b2c6d0 commit 551c3fb

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ similar mechanism in Kubernetes or your actual platform.
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 |
8989
| PHP_FPM_MAX_REQUESTS | string | 500 | Number of requests after which a worker is recycled to mitigate memory leaks; set to 0 to disable |
90+
| PHP_FPM_REQUEST_SLOWLOG_TIMEOUT | string | 0 | Log requests (and count them on the FPM status page) that take longer than this, e.g. "5s"; set to 0 to disable |
91+
| PHP_FPM_SLOWLOG_PATH | string | /opt/flownative/log/php-fpm-slow.log | Destination file for slowlog backtraces, used when PHP_FPM_REQUEST_SLOWLOG_TIMEOUT is enabled |
9092
| PHP_FPM_PM_MODE | string | ondemand | Process manager mode for PHP-FPM; "static", "ondemand" or "dynamic" |
9193
| PHP_SPX_ENABLE | boolean | false | Enable or disable the SPX extension |
9294
| PHP_SPX_KEY | string | dev | The secret key used for authentication |

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ 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}"
5555
export PHP_FPM_MAX_REQUESTS="${PHP_FPM_MAX_REQUESTS:-500}"
56+
export PHP_FPM_REQUEST_SLOWLOG_TIMEOUT="${PHP_FPM_REQUEST_SLOWLOG_TIMEOUT:-0}"
5657
export PHP_FPM_ERROR_LOG_PATH="${PHP_FPM_ERROR_LOG_PATH:-/opt/flownative/log/php-fpm-error.log}"
5758
export PHP_FPM_ACCESS_LOG_PATH="${PHP_FPM_ACCESS_LOG_PATH:-/opt/flownative/log/php-fpm-access.log}"
59+
export PHP_FPM_SLOWLOG_PATH="${PHP_FPM_SLOWLOG_PATH:-/opt/flownative/log/php-fpm-slow.log}"
5860
EOF
5961
}
6062

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ pm = ${PHP_FPM_PM_MODE}
2222
pm.max_children = ${PHP_FPM_MAX_CHILDREN}
2323
pm.max_requests = ${PHP_FPM_MAX_REQUESTS}
2424

25+
slowlog = ${PHP_FPM_SLOWLOG_PATH}
26+
request_slowlog_timeout = ${PHP_FPM_REQUEST_SLOWLOG_TIMEOUT}
27+
2528
pm.status_path = /php-fpm-status
2629

2730
clear_env = no

0 commit comments

Comments
 (0)