From 7a14421e78e0872229bebf52d5710e612748dea6 Mon Sep 17 00:00:00 2001 From: Frank Hamand Date: Wed, 11 Oct 2023 08:54:48 +0100 Subject: [PATCH] feat: Set keepalive to 60 on gunicorn (#17897) Set keepalive to 60 on gunicorn The default is 2 seconds, the default for ALBs is 30 seconds This can cause a race condition where gunicorn closes the connection as the ALB sends a request, resulting in a 502. --- bin/docker-server | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/docker-server b/bin/docker-server index 274df8dd061..b6fe91c32ba 100755 --- a/bin/docker-server +++ b/bin/docker-server @@ -20,6 +20,7 @@ exec gunicorn posthog.wsgi \ --worker-tmp-dir /dev/shm \ --workers=2 \ --threads=8 \ + --keep-alive=60 \ --backlog=${GUNICORN_BACKLOG:-1000} \ --worker-class=gthread \ ${STATSD_HOST:+--statsd-host $STATSD_HOST:$STATSD_PORT} \