Skip to content

fix(puma): raise production worker_timeout 12s->60s (env-tunable) - #17

Merged
rrader26 merged 1 commit into
mainfrom
fix/puma-worker-timeout
Jul 6, 2026
Merged

fix(puma): raise production worker_timeout 12s->60s (env-tunable)#17
rrader26 merged 1 commit into
mainfrom
fix/puma-worker-timeout

Conversation

@rrader26

@rrader26 rrader26 commented Jul 6, 2026

Copy link
Copy Markdown

Why

Production Puma worker_timeout was hardcoded to 12s (config/puma.rb). Puma's own default is 60s. On CPU-pressured nodes a worker that misses its heartbeat for >12s is killed by the master → mass worker thrash → /health (served by a worker) has no responder → k8s liveness probe SIGKILLs the whole pod (exit 137). This caused intermittent prod login outages on billing.thinkfleet.ai.

Change

  • Default production worker_timeout to 60s.
  • Read from PUMA_WORKER_TIMEOUT env so it can be tuned without an image rebuild (the exact limitation hit during the incident).

Part of the prod-stability work alongside deployment hardening (replica anti-affinity, relaxed probes, PDB).

12s was too tight under CPU pressure: a worker starved past 12s is killed
by the Puma master, causing mass worker thrash on busy nodes -> /health has
no worker -> k8s liveness kills the pod. This drove intermittent prod login
outages on billing.thinkfleet.ai. Default to Puma's 60s and expose
PUMA_WORKER_TIMEOUT so it can be tuned without an image rebuild.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rrader26
rrader26 merged commit 634af80 into main Jul 6, 2026
1 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants