Skip to content

Commit 853e0e1

Browse files
authored
Merge pull request #4763 from alphagov/BC-performance-stability
Add environment overrides to gunicorn settings
2 parents b950bbb + afda508 commit 853e0e1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gunicorn_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ def child_exit(server, worker):
1515
multiprocess.mark_process_dead(worker.pid)
1616

1717

18-
workers = 4
18+
workers = int(os.getenv("GUNICORN_WORKERS", "4"))
1919
worker_class = "eventlet"
20-
worker_connections = 8 # limit runaway greenthread creation
20+
worker_connections = int(os.getenv("GUNICORN_WORKER_CONNECTIONS", "8"))
2121
statsd_host = "{}:8125".format(os.getenv("STATSD_HOST"))
22-
keepalive = 0 # disable temporarily for diagnosing issues
22+
keepalive = int(os.getenv("GUNICORN_KEEPALIVE", "0"))
2323
timeout = int(os.getenv("HTTP_SERVE_TIMEOUT_SECONDS", 30)) # though has little effect with eventlet worker_class
2424

2525
debug_post_threshold = os.getenv("NOTIFY_GUNICORN_DEBUG_POST_REQUEST_LOG_THRESHOLD_SECONDS", None)

0 commit comments

Comments
 (0)