Skip to content

Commit f598d29

Browse files
committed
fix: apply reviewer feedback to gunicorn config
- preload_app = True: saves memory via copy-on-write in container deployments - max_requests = 1000 / max_requests_jitter = 50: recycles workers periodically to guard against memory leaks, jitter prevents all workers restarting simultaneously - graceful_timeout = 30: explicit clean shutdown window during ECS deploys - accesslog/errorlog = '-': routes all logs to stdout/stderr for CloudWatch - worker_tmp_dir = '/dev/shm': uses in-memory fs for worker heartbeat files
1 parent cc469da commit f598d29

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

gunicorn.conf.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,15 @@
55
threads = 2
66
worker_class = 'gthread'
77
timeout = 30
8+
graceful_timeout = 30
89
bind = '0.0.0.0:8081'
10+
11+
preload_app = True
12+
13+
max_requests = 1000
14+
max_requests_jitter = 50
15+
16+
accesslog = '-'
17+
errorlog = '-'
18+
19+
worker_tmp_dir = '/dev/shm'

0 commit comments

Comments
 (0)