fix(api): set gunicorn keep-alive above the load balancer idle timeout to stop 502s (#11647)

This commit is contained in:
Josema Camacho authored and GitHub committed 2026-06-19 12:49:49 +02:00
1 parent e10cf34ad6
commit 6d8d553610
2 files changed
+7

No files matched your search

+6
View File
@@ -56,6 +56,12 @@ preload_app = not DEBUG
# that may take longer, such as complex API operations.
timeout = env.int("GUNICORN_TIMEOUT", default=120)
# HTTP keep-alive idle timeout. Must exceed the idle timeout of the proxy or load
# balancer in front of gunicorn, or it reuses a connection gunicorn just closed
# and returns a 502. Default clears the common 60s; raise `GUNICORN_KEEPALIVE` to
# stay above a longer one.
keepalive = env.int("GUNICORN_KEEPALIVE", default=75)
# Logging
logconfig_dict = DJANGO_LOGGERS
gunicorn_logger = logging.getLogger(BackendLogger.GUNICORN)