Commit a2e62a0
fix: add --preload to Gunicorn to prevent worker timeout on startup
Without --preload, each Gunicorn sync worker independently loads the
Django WSGI application after forking. During this loading phase, the
worker does not send heartbeats to the arbiter. On resource-constrained
environments (staging, small Docker containers), this loading can exceed
the 120-second timeout, causing the arbiter to kill the worker with
WORKER TIMEOUT before it ever serves a request.
With --preload, the application is loaded once in the master process
before forking workers. Workers start with the app already loaded,
eliminating the startup timeout risk.
https://claude.ai/code/session_01AztUaxUwQFtPfzRVyDzeNz1 parent 4a49f87 commit a2e62a0
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
0 commit comments