Skip to content

Fix parakeet internal LB timeout mismatch causing ~15% 504 failures #8736

Closed

Description

@beastoin

Problem

Parakeet /v2/transcribe is returning ~15% 504 errors on the internal load balancer. Root cause identified:

LB timeout (30s) vs client timeout (120s) mismatch.

The parakeet-backend-config BackendConfig is missing timeoutSec, so GCP defaults to 30s. The HTTP client in backend/utils/stt/pre_recorded.py sets read=120s. Any audio chunk requiring >30s GPU processing consistently 504s on both attempts (retry is useless — same LB timeout).

Compare: prod-pusher-backend-config and prod-agent-proxy-backend-config both set timeoutSec: 3600.

Affected Callers

Caller Service Failure behavior
sync.py:574 process_segment() backend-sync Cloud Tasks retries whole job
postprocess_conversation.py:82 backend Falls back to streaming transcript
chat.py:135 transcribe_voice_message_segment() backend Silent failure — user gets no transcription

Required Changes

1. BackendConfig timeout fix

Add timeoutSec: 120 to parakeet-backend-config spec to match client expectation.

2. HPA max replicas → 2

Current HPA maxReplicas: 1 (clamped) means parakeet cannot scale under load. Increase to maxReplicas: 2 with appropriate scale-up/scale-down policy:

  • Scale-up: allow adding 1 pod when GPU utilization or request backlog exceeds threshold
  • Scale-down: stabilization window of 10-15 minutes to avoid flapping on bursty traffic

3. Scale policy recommendations

  • Scale-up trigger: sustained high request latency or queue depth
  • Scale-down stabilization: 600s (prevent premature scale-down during burst gaps)
  • Behavior: conservative scale-down (1 pod at a time), faster scale-up

Files to Change

  • infra/prod_omi_parakeet_values.yaml (or equivalent Helm values)
    • BackendConfig: add timeoutSec: 120
    • HPA: maxReplicas: 1 → maxReplicas: 2
    • HPA behavior: add scale-up/scale-down policy

Validation

  • After deploy: verify gcloud compute backend-services describe shows timeoutSec: 120
  • Monitor Grafana panel "LB Request Rate by Response Code & Route" — 504 rate should drop significantly
  • Verify HPA shows MAXPODS: 2 via kubectl get hpa

Activity

  1. added 3 commits that reference this issue on Jul 1, 2026
    5f61ef9
    d598a79
    eead3d1
  2. added a commit that references this issue on Jul 1, 2026
    e7c3107
  3. added 2 commits that reference this issue on Jul 1, 2026
    bb544a1
    3b22900
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions