Skip to content

Commit adf8ef1

Browse files
committed
Add GUNICORN_WORKER_CONNECTIONS config option
Add support for configuring max simultaneous connection count per gunicorn worker with the GUNICORN_WORKER_CONNECTIONS environment variable.
1 parent f43b743 commit adf8ef1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

django/docker_entrypoint.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ def to_bool(val) -> bool:
7676
GUNICORN_WORKER_CLASS = register_variable(str, "GUNICORN_WORKER_CLASS", "gevent")
7777
GUNICORN_WORKER_COUNT = register_variable(int, "GUNICORN_WORKER_COUNT", 3)
7878
GUNICORN_WORKER_TIMEOUT = register_variable(int, "GUNICORN_WORKER_TIMEOUT", 30)
79+
GUNICORN_WORKER_CONNECTIONS = register_variable(
80+
int, "GUNICORN_WORKER_CONNECTIONS", 1000
81+
)
7982
GUNICORN_LOG_LEVEL = register_variable(str, "GUNICORN_LOG_LEVEL", "info")
8083
GUNICORN_MAX_REQUESTS = register_variable(int, "GUNICORN_MAX_REQUESTS", 10000)
8184
GUNICORN_MAX_REQUESTS_JITTER = register_variable(
@@ -121,6 +124,8 @@ def run_gunicorn() -> None:
121124
GUNICORN_MAX_REQUESTS,
122125
"--max-requests-jitter",
123126
GUNICORN_MAX_REQUESTS_JITTER,
127+
"--worker-connections",
128+
GUNICORN_WORKER_CONNECTIONS,
124129
"-w",
125130
GUNICORN_WORKER_COUNT,
126131
"-t",

0 commit comments

Comments
 (0)