Skip to content

Commit

Permalink
fix: restart gunicorn workers every 50 requests (#1469)
Browse files Browse the repository at this point in the history
This is done to limit the effect of asset caching or of possible memory
leaks on the RAM consumption on gunicorn workers.
  • Loading branch information
raphael0202 authored Nov 23, 2024
1 parent 1d68bc9 commit 642583c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gunicorn.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
# Default to True (production) if not specified
preload_app = bool(os.environ.get("GUNICORN_PRELOAD_APP", True))
timeout = 60
# Limit the impact of caching on RAM use by restarting workers
# every 50 requests
max_requests = 50
max_requests_jitter = 5

0 comments on commit 642583c

Please sign in to comment.