Skip to content

listen: raise prod HPA minReplicas 30→40 - #22623

Merged
Git-on-my-level merged 1 commit into
mainfrom
lane/listen-hpa-min40
Oct 19, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
lane/listen-hpa-min40

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Raise prod backend-listen HPA autoscaling.minReplicas 30 → 40 (maxReplicas stays 60). This puts the floor the two-lane lead already patched live into the chart, so the next deploy doesn't drop it back to 30.
  • At 40 pods the rollout runs 14 waves of 3 pods (maxSurge 2 + maxUnavailable 1) with a 300s startup budget each, so test_backend_listen_rollout_wait_can_cover_a_real_rollout needs ≥ 4200s. As listen: raise prod HPA minReplicas 12→30 before live stage 2 #22461 did for the 30-pod floor, this PR raises the kubectl rollout status wait (listen helm workflow and deploy-backend-stack) and the prod progressDeadlineSeconds from 3000s to 4200s, and the helm rollback --wait from 50m to 70m. test_workflow_contracts.py is updated to match.

Branch lane/listen-hpa-min40 into main.

Evidence (aggregates, prod, 2026-10-19)

  • From 15:10Z, listen CPU per pod stepped up. At 16:50Z the hottest pods hit the 2-core limit, with liveness/readiness probe timeouts.
  • Live STT exhausted/accepted rose to 0.41. Soniox→unavailable connection_lost rose to 119/10m.
  • The lead patched the live HPA min to 40 at 17:24:55Z. Within 45 minutes the hottest pod CPU fell to 1.0–1.5 cores, probe timeouts stopped, exhausted/accepted returned to 0.25–0.27, and connection_lost fell to 46/10m.
  • Cost: about 10 extra listen pods at the floor.

Lane / contract

Two-lane live-STT capacity follow-up; no other lanes' files touched.

Product invariants affected

  • INV-DATA-1: path match only (chart values / deploy workflow timeouts); no data-path behavior change.
    This change does not alter the Firebase/Firestore project or serving endpoints.

Verification

  • Unit: test_verify_backend_release_vector.py, test_workflow_contracts.py, test_listen_helm_env_overrides.py, test_streaming_stt_helm_key_bindings.py, test_backend_runtime_env_validator.py: 306 passed locally. Before the timeout changes, the rollout-wait invariant failed at minReplicas 40 (3000 < 4200).
  • Pre-push gate runs the full backend suite. Not verified here: an actual prod roll at the new floor.

Rollback

Revert this PR. That returns minReplicas to 30 and the waits to 3000s / 50m.

Failure-Class: none

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

A 40-pod floor rolls in 14 waves of 3 pods at a 300s startup budget, so the
rollout wait and progressDeadlineSeconds rise to 4200s and the helm rollback
wait to 70m, as #22461 did for the 30-pod floor.

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T19:00:17.393259Z 1aeb49f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1aeb49fc79

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

autoscaling:
enabled: true
minReplicas: 30
minReplicas: 40

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update the scheduled prod scale-up floor to 40

When the tracked production scaler CronJob runs at 11:00 UTC, backend/charts/backend-listen/prod_omi_backend_listen_cronjob.yaml:46-47 patches this same HPA back to minReplicas: 30. That silently undoes the new capacity floor every day and reintroduces the CPU saturation and connection-loss conditions this change is intended to address; update the scheduled scale-up target alongside the values file.

Useful? React with 👍 / 👎.

@@ -1,4 +1,4 @@
progressDeadlineSeconds: 3000
progressDeadlineSeconds: 4200

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the progress deadline independent of rollout size

When a production rollout makes no progress at all—for example because every new pod has an image-pull or readiness failure—this increase delays ProgressDeadlineExceeded and the workflow failure from 50 to 70 minutes. Kubernetes defines this field as the interval before reporting that progress has stalled, and counts scaling a ReplicaSet or a pod becoming ready as progress; it is not a whole-rollout wall-clock budget (Deployment status documentation). The 40-replica wave calculation therefore justifies extending the separate kubectl rollout status watch, but not this stall detector; retain an appropriately bounded no-progress deadline so a broken production rollout is reported promptly.

Useful? React with 👍 / 👎.

# See gcp_backend.yml: 300s cannot cover a full backend-listen roll; a
# stalled rollout still fails on progressDeadlineSeconds.
if ! kubectl -n ${{ vars.ENV }}-omi-backend rollout status deploy/${{ vars.ENV }}-omi-backend-listen --timeout=3000s; then
if ! kubectl -n ${{ vars.ENV }}-omi-backend rollout status deploy/${{ vars.ENV }}-omi-backend-listen --timeout=4200s; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Refresh GKE credentials before waiting longer than one hour

For a rollout that legitimately takes between 60 and 70 minutes—the exact case this change is meant to permit—the workflow's kubeconfig can no longer authenticate the final status gate. The earlier get-gke-credentials@v3 step leaves use_auth_provider at its default false, which embeds a short-lived token rather than a refreshable auth-provider configuration (action documentation); the action's tracker documents these kubeconfigs returning unauthorized after the default one-hour lifetime (observed failure). Even if the existing watch connection survives, the strict deploy_status_report.py call immediately afterward starts fresh kubectl requests and fails, so the extra ten minutes cannot produce a successful deployment. Refresh the kubeconfig immediately before this wait or enable refreshable authentication; the composite action has the same default-token setup and changed timeout.

AGENTS.md reference: .github/AGENTS.md:L26-L29

Useful? React with 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit 7c20418 into main Oct 19, 2026
62 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/listen-hpa-min40 branch October 19, 2026 19:11
Git-on-my-level added a commit that referenced this pull request Oct 24, 2026
## Summary
- Lower prod `backend-listen` HPA `autoscaling.minReplicas` 40 → 30
(`maxReplicas` stays 60). The 40 floor was the 10-19 incident hardening
(#22623); measured off-peak load needs only ~31 pods at the 55% CPU
target, so 30 (the pre-#22623 floor) is enough night headroom and stops
paying for ~9 idle pods every night.
- Peak path untouched: same requests/limits, 55% target, socket guards
(16 req / 35 ws per pod), max 60. The floor only binds off-peak; peaks
still drive 50–60 pods (pegged at 60 on 10-20).
- Matching pin: `test_backend_listen_helm_defaults.py` `(40, 60)` →
`(30, 60)`. The #22623 rollout waits stay valid unchanged — a 30-pod
floor rolls in fewer waves, not more
(`test_backend_listen_rollout_wait_can_cover_a_real_rollout` passes with
the existing 4200s waits and `progressDeadlineSeconds: 4200`).
- Expected saving ≈ $1k/mo (~35% of listen node spend) together with the
node-pool consolidation: night floor 40 → ~31 pods ⇒ 14 → 11 nodes.

## Evidence (read-only, prod, 2026-10-24, listen capacity review §4A)
- Off-peak fleet 17.4–20.5 cores; at the 55% target that is ~31 pods.
HPA status reports "desired replica count is less than the minimum" all
night — the 40 floor is pure night waste. Socket guards idle at 4.2 req
/ 12.4 ws per pod vs 16/35.
- Peak (10-22/23 14–18Z): fleet 34–38 cores, 50–60 pods — unchanged by
this PR.
- Reconnect-storm check: worst landing = all 635 peak fleet WS on the
30-pod floor = 21 ws/pod vs the 35-socket guard (1.7×); client
reconnects are rate-shaped by `LISTEN_RECONNECT_BUDGET_PER_MIN=6`.

## Deploy timing
Apply only after 22Z (listen freeze 13–22Z). Roll out via the normal
listen helm workflow.

## Product invariants affected
- INV-DATA-1: path match only (chart values); no data-path behavior
change.

## Verification
- `BACKEND_UNIT_TEST_FILE_LIST=<list file> BACKEND_PYTEST_WORKERS=4 bash
backend/test.sh` (contracts, listen helm defaults, release vector):
`test_workflow_contracts.py` 94 passed,
`test_backend_listen_helm_defaults.py` 12 passed,
`test_verify_backend_release_vector.py` 51 passed. Not verified here: an
actual prod roll at the new floor.

## Rollback
Revert this PR and re-roll the listen helm workflow. Scale-up is fast
(50%/15s ≈ 5 pods/15s — back to a 40-pod fleet in ~2 min); the 4200s
rollout waits stay valid in both directions.

Failure-Class: none

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/23476?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/23476?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F23476&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
ocakciomursel-pixel pushed a commit to ocakciomursel-pixel/omi that referenced this pull request Oct 24, 2026
Night fleet needs only ~31 pods at the 55% CPU target, so the 10-19
incident floor of 40 (BasedHardware#22623) idles ~9 pods every night. Return the floor
to its pre-BasedHardware#22623 value of 30; peak path (max 60, requests, target, socket
guards) is unchanged. Update the (40, 60) pin in
test_backend_listen_helm_defaults.py; the 4200s rollout waits stay valid
(a 30-pod floor rolls in fewer waves). Saves ~$1k/mo with the pool
consolidation. Apply only after 22Z (listen freeze 13-22Z). Rollback:
revert and re-roll; scale-up 50%/15s (~5 pods/15s) restores 40 in ~2 min.
ocakciomursel-pixel pushed a commit to ocakciomursel-pixel/omi that referenced this pull request Nov 1, 2026
…etire100)

Batch at 100% moves consented mobile capture off the live sync path; the
residual live leg (opt-outs + desktop, ~45-65% of sessions) needs ~19-27
listen pods, not the 42 running now. Pusher's 10-28 queue storm
(sync-jobs-fresh depth 4.5k) has drained back to ~1.5k and the fresh
queue's input collapses at 100%, so the emergency live-only floor of 36
lands as a chart value of 16 instead.

- backend-listen: minReplicas 30 -> 20 (max 60 unchanged; socket guards
  and the BasedHardware#22623 rollout-timeout derivation only relax on a floor drop)
- pusher: minReplicas 12 -> 16 (max 40 unchanged); mirrors the floor so
  deploys stop diverging from the live-only 36
- helm-defaults pin updated to (20, 60)

Apply only with the live kubectl patch and guards from
data/run-2026-10-13-two-lane-nemotron/retire100-changeset-2026-10-29.md,
after the batch live100 gate (lead applies).
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.

1 participant