Skip to content

Commit

Permalink
Add GUNICORN_WORKER_CONNECTIONS config option
Browse files Browse the repository at this point in the history
Add support for configuring max simultaneous connection count per
gunicorn worker with the GUNICORN_WORKER_CONNECTIONS environment
variable.
  • Loading branch information
MythicManiac committed Dec 6, 2023
1 parent f43b743 commit adf8ef1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions django/docker_entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ def to_bool(val) -> bool:
GUNICORN_WORKER_CLASS = register_variable(str, "GUNICORN_WORKER_CLASS", "gevent")
GUNICORN_WORKER_COUNT = register_variable(int, "GUNICORN_WORKER_COUNT", 3)
GUNICORN_WORKER_TIMEOUT = register_variable(int, "GUNICORN_WORKER_TIMEOUT", 30)
GUNICORN_WORKER_CONNECTIONS = register_variable(
int, "GUNICORN_WORKER_CONNECTIONS", 1000
)
GUNICORN_LOG_LEVEL = register_variable(str, "GUNICORN_LOG_LEVEL", "info")
GUNICORN_MAX_REQUESTS = register_variable(int, "GUNICORN_MAX_REQUESTS", 10000)
GUNICORN_MAX_REQUESTS_JITTER = register_variable(
Expand Down Expand Up @@ -121,6 +124,8 @@ def run_gunicorn() -> None:
GUNICORN_MAX_REQUESTS,
"--max-requests-jitter",
GUNICORN_MAX_REQUESTS_JITTER,
"--worker-connections",
GUNICORN_WORKER_CONNECTIONS,
"-w",
GUNICORN_WORKER_COUNT,
"-t",
Expand Down

0 comments on commit adf8ef1

Please sign in to comment.