fix(puma): raise production worker_timeout 12s->60s (env-tunable) - #17
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Production Puma
worker_timeoutwas 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 onbilling.thinkfleet.ai.Change
worker_timeoutto 60s.PUMA_WORKER_TIMEOUTenv 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).