From 82772c8a3470f4810717945225549fab36c6ab71 Mon Sep 17 00:00:00 2001 From: Yosuke Otosu Date: Wed, 14 Dec 2022 20:50:01 +0900 Subject: [PATCH 1/2] feat: keep-alive option --- bin/run_server.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/run_server.sh b/bin/run_server.sh index 61b11bcb..5ad68b10 100755 --- a/bin/run_server.sh +++ b/bin/run_server.sh @@ -41,6 +41,7 @@ function start () { WORKER_TIMEOUT=${WORKER_TIMEOUT:-30} WORKER_MAX_REQUESTS=${WORKER_MAX_REQUESTS:-500} WORKER_MAX_REQUESTS_JITTER=${WORKER_MAX_REQUESTS_JITTER:-200} + KEEP_ALIVE=${KEEP_ALIVE:-75} gunicorn --worker-class server.AppUvicornWorker \ --workers ${WORKER_COUNT} \ @@ -48,6 +49,7 @@ function start () { --timeout ${WORKER_TIMEOUT} \ --max-requests ${WORKER_MAX_REQUESTS} \ --max-requests-jitter ${WORKER_MAX_REQUESTS_JITTER} \ + --keep-alive ${KEEP_ALIVE} \ --limit-request-line 0 \ app.main:app } From 5d30541c8552d636ae57d4d41fd83fa5e03e03a2 Mon Sep 17 00:00:00 2001 From: Yosuke Otosu Date: Thu, 15 Dec 2022 15:46:02 +0900 Subject: [PATCH 2/2] fix --- bin/run_server.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/run_server.sh b/bin/run_server.sh index 5ad68b10..9e0dd73d 100755 --- a/bin/run_server.sh +++ b/bin/run_server.sh @@ -41,7 +41,7 @@ function start () { WORKER_TIMEOUT=${WORKER_TIMEOUT:-30} WORKER_MAX_REQUESTS=${WORKER_MAX_REQUESTS:-500} WORKER_MAX_REQUESTS_JITTER=${WORKER_MAX_REQUESTS_JITTER:-200} - KEEP_ALIVE=${KEEP_ALIVE:-75} + KEEP_ALIVE=${KEEP_ALIVE:-2} gunicorn --worker-class server.AppUvicornWorker \ --workers ${WORKER_COUNT} \