Skip to content

Migrate credreg-prod to 16 GB nodes, raise main-app memory (#1056)#1057

Open
arielr-lt wants to merge 1 commit into
masterfrom
fix/prod-node-16g-oom
Open

Migrate credreg-prod to 16 GB nodes, raise main-app memory (#1056)#1057
arielr-lt wants to merge 1 commit into
masterfrom
fix/prod-node-16g-oom

Conversation

@arielr-lt

Copy link
Copy Markdown
Collaborator

Summary

Fixes the recurring 502 Bad Gateway on large competency-framework publishes (#1056). Root cause: main-app runs chronically at its 4Gi memory ceiling and gets OOM-killed mid-publish — when the Puma worker dies, nginx returns 502. Over the last ~30 days main-app peaked at ~4Gi almost every day and OOM-killed on more than half of them. The 8 GB t3.large prod nodes can't host a larger memory limit (8Gi wouldn't even schedule on an 8 GB node), so prod is moved to 16 GB t3.xlarge nodes first, then the limit is raised.

Changes

  • New prod node group ng_prod_v2t3.xlarge (16 GB), parameterized instance type/scaling, identical env=production label + NoSchedule taint and subnets as the old group.
  • Removed the retired ng_prod resource and its ng_prod_* variables/tfvars.
  • main-app memory limit 4Gi → 8Gi in k8s-manifests-prod/app-deployment.yaml (request unchanged at 3560Mi).
  • Runbook PROD-NODE-16G-MIGRATION.md documenting the blue/green migration + rollback.

Rollout (already executed live, zero-downtime)

Blue/green: created ng_prod_v2, added a temp main-app PDB + scaled worker to 2, cordoned/drained the old nodes one-by-one (main-app held Ready throughout), migrated redis-0 last (~28 s blip, EBS reattached in-AZ, no data loss), then destroyed ng_prod. Prod now runs solely on 2× t3.xlarge. No user-facing outage.

Notes

  • ng_prod_v2 keeps the _v2 name deliberately to avoid a resource-address rename (which would force node replacement).
  • The app-deployment.yaml image:/replicas: fields remain CI-managed placeholders; only limits.memory changed here.
  • A temporary main-app PodDisruptionBudget (maxUnavailable=1) was added live during migration and left in place as hygiene (the app previously had none). Consider promoting it to a permanent manifest.

Refs #1056

main-app ran chronically at its 4Gi memory ceiling and OOM-killed
mid-publish, returning 502s on large framework publishes. The 8 GB
t3.large nodes could not host a larger memory limit, so move prod to
16 GB t3.xlarge nodes first, then raise the limit.

- Replace ng_prod (t3.large) with ng_prod_v2 (t3.xlarge, parameterized
  instance type/scaling); migration done blue/green with zero downtime
- Remove the retired ng_prod resource and its variables
- Raise k8s-manifests-prod main-app limits.memory 4Gi -> 8Gi
- Add PROD-NODE-16G-MIGRATION.md runbook

Refs #1056
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