From b0933c444b84803917d77d0ceebc8f39ae59efff Mon Sep 17 00:00:00 2001 From: Michiel Berger Date: Thu, 30 Apr 2026 17:39:13 +0200 Subject: [PATCH] Dockerfile: gunicorn 2 workers x 4 threads (gthread) Single sync worker means a slow request to / (compute_leaderboard, ~17s on dev / longer on h4a's compact CPU slice) blocks every other request, including the /healthz probe. With 2 worker processes and 4 threads each, slow requests on / no longer wedge the gunicorn queue, and /healthz responds promptly even while a /api/calculate is in flight. --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1396a7e..4ba5432 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,5 +24,7 @@ EXPOSE 8080 CMD ["gunicorn", "pluginbattery.web:app", \ "--bind", "0.0.0.0:8080", \ - "--workers", "1", \ + "--workers", "2", \ + "--threads", "4", \ + "--worker-class", "gthread", \ "--timeout", "120"]