Repository navigation
fix(parakeet): LB timeout + HPA scaling for GPU service - #8737
Conversation
The parakeet-backend-config was missing timeoutSec, causing GCP to default to 30s. The HTTP client expects 120s read timeout, so any audio chunk requiring >30s GPU processing consistently 504s. Fixes #8736 Co-Authored-By: Claude Opus 4.6 <[email protected]>
- maxReplicas 10→2 to match available GPU node capacity - scaleUp: no stabilization, +1 pod per 5min (react fast to load) - scaleDown: 600s stabilization, -1 pod per 10min (prevent flapping) Fixes #8736 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add connectionDraining.drainingTimeoutSec: 130 to BackendConfig so the LB gracefully drains existing connections during scale-down or rollout, preventing 502s on long-running GPU transcription requests. Fixes #8736 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add template support for terminationGracePeriodSeconds so pods wait long enough for in-flight GPU requests to finish before SIGKILL. Without this, K8s default 30s grace period conflicts with 120s request timeout and 130s connection draining window. Fixes #8736 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Set pod grace period to 150s (above 120s client timeout and 130s LB drain window) so long-running transcription requests complete before Kubernetes sends SIGKILL. Fixes #8736 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Test Detail Table (CP8)
by AI for @beastoin |
Omi PR Workflow — Complete ✓
Codex Consultation Summary
Timeout Chain (verified consistent)Ready for merge review. by AI for @beastoin |
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks @beastoin — solid infra fix. Quick review notes:
Timeout chain is correctly ordered ✓
- LB
timeoutSec: 120<connectionDraining.drainingTimeoutSec: 130<terminationGracePeriodSeconds: 150 - This ensures a full-duration (120s) request completes before the LB gives up, the LB drains for longer than the max request, and K8s keeps the pod alive past both. The gap between 130→150 gives uvicorn headroom to finish in-flight work after SIGTERM.
HPA behavior rewrite looks sound ✓
- Fast scale-up (
stabilizationWindowSeconds: 0, +1 pod/5min) is right for burst GPU load. - Conservative scale-down (600s stabilization, -1 pod/10min) prevents thrashing on expensive GPU pods.
- Dropping the
Percentpolicy +selectPolicyin favor of pods-only is cleaner for a low-replica GPU service.
One operational note — maxReplicas: 10→2 is a capacity decision. The PR body already flags this: make sure there are ≥2 schedulable GPU nodes matching the service=parakeet, env=prod affinity before deploy. With maxSurge: 0, maxUnavailable: 1, a rollout drops capacity 2→1, so the connection draining + grace period are doing real work here.
No code-level blockers. The chart changes are clean, helm lint/template verified per the test plan, and CI is green. Safe to proceed once GPU node capacity is confirmed.
(review by Omi PR monitor — automated maintainer review, not a formal approval)
kodjima33
left a comment
There was a problem hiding this comment.
parakeet GPU Helm/HPA tuning — Nik owns backend deploy, approve only
Summary
timeoutSec: 120toparakeet-backend-configBackendConfig — fixes ~15% 504 errors caused by GCP defaulting to 30s while the HTTP client expects 120s read timeoutconnectionDraining.drainingTimeoutSec: 130— gracefully drains in-flight requests during scale-down/rollout (Codex recommendation)terminationGracePeriodSeconds: 150to deployment template + prod values — prevents K8s SIGKILL before 120s requests finish (Codex recommendation; default 30s was too short)maxReplicasto 2 to allow scaling under burst GPU loadChanges
templates/service.yamlspec.timeoutSec: 120+connectionDraining.drainingTimeoutSec: 130on BackendConfigtemplates/deployment.yamlterminationGracePeriodSecondsfrom valuesprod_omi_parakeet_values.yamlmaxReplicas: 10→2, GPU-safe HPA behavior,terminationGracePeriodSeconds: 150Codex consultation (3 turns)
maxSurge: 0, maxUnavailable: 1is safe with 2 GPU nodes.Risks / Edge cases
maxSurge: 0, capacity drops from 2→1 pods during rollout. Mitigated by connectionDraining + terminationGracePeriodSeconds.maxReplicas: 2requires at least 2 schedulable GPU nodes withservice=parakeet, env=prodaffinity. Verify node count before deploy.Test plan
helm lintpasses (verified locally)helm templaterenders BackendConfig withtimeoutSec: 120+connectionDraining.drainingTimeoutSec: 130(verified locally)helm templaterenders Deployment withterminationGracePeriodSeconds: 150(verified locally)helm templaterenders HPA withmaxReplicas: 2and correct behavior block (verified locally)gcloud compute backend-services describeshowstimeoutSec: 120kubectl get hpashowsMAXPODS: 2Fixes #8736
🤖 Generated with Claude Code
by AI for @beastoin