Skip to content

fix(helm): raise resource defaults for CPU-throttled and OOM-prone services - #648

Merged
OlivierTrudeau merged 1 commit into
mainfrom
fix/helm-starved-resource-defaults
Sep 21, 2026
Merged

OlivierTrudeau merged 1 commit into
mainfrom
fix/helm-starved-resource-defaults

Conversation

@damianloch

@damianloch damianloch commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Why

#639 and #641 reconciled Helm defaults with production, but only covered the five services our production Terraform explicitly overrides (server, frontend, celeryWorker, celeryBeat, chatbot). Services prod doesn't override silently run chart defaults — and those defaults were never validated against real usage.

I read cgroup counters (memory.peak, memory.events, cpu.stat) from every live production pod. Four containers are measurably starved:

Container Old limit Peak mem % of limit OOM kills CPU throttled
memgraph 500m / 1Gi 951Mi 93% 0 508,254 periods (~6.6h)
celery-worker 1000m / 4Gi 2049Mi @ prod's 2Gi 100%+ 6 and 3 20k–24k periods
celery-beat 200m / 512Mi 329Mi 64% 0 57,188 periods
frontend 1000m / 1Gi 787Mi 77% 0 now, 2 prior OOMKilled 40,310 periods (~1.4h)

memgraph was never touched by either prior PR and is the worst container in the cluster on both axes. celeryBeat got a memory bump in #639 but its CPU was left at 50m/200m. celeryWorker memory is already correct from #641; only its CPU was still low.

Verified fine, left alone: server (24% of limit), chatbot (54%), mcp (6%), searxng (35%). redis/vault/postgres/minio are disabled in prod, so there's no usage evidence to size them from.

Changes

celeryBeat    requests.cpu     50m  -> 100m      limits.cpu     200m -> 500m
celeryWorker  requests.cpu    250m  -> 500m      limits.cpu    1000m -> 2000m
frontend      requests.cpu    100m  -> 200m      limits.cpu    1000m -> 2000m
              requests.memory 256Mi -> 512Mi     limits.memory   1Gi -> 2Gi
memgraph      requests.cpu    100m  -> 250m      limits.cpu     500m -> 1000m
              requests.memory 512Mi -> 1Gi       limits.memory   1Gi -> 2Gi

Also MEMGRAPH_MEMORY_LIMIT 512 -> 1536 (MB). This is Memgraph's internal --memory-limit, which was capping the graph store at 512MB while the container itself peaked at 951Mi. Keeping it below the new 2Gi container limit means an oversized query gets rejected rather than the pod being OOM-killed.

Notes

  • No value is lowered. Verified programmatically by diffing every cpu/memory/ephemeral-storage field against origin/main in normalized units.
  • Raises total requests by 550m CPU / 768Mi memory per install. Worth a look if you're running a tight single-node cluster.
  • Docker Compose keeps --memory-limit=512 — it targets single hosts/laptops, where the prod sizing isn't appropriate. Say the word if you'd rather they match.
  • Chart version intentionally not bumped, consistent with chore(helm): update deployment defaults #639.
  • Two prod-only issues this surfaced, out of scope here: our Terraform overrides celeryWorker memory down to 2Gi and it's actively OOM-killing (this chart's 4Gi is correct), and server is at restartCount 33 with reason Error plus liveness failures — not OOM, so a different root cause.

Testing

  • helm lint passes.
  • helm template renders the expected requests/limits on all containers and --memory-limit=1536 in the Memgraph args.

Summary by CodeRabbit

  • Performance
    • Increased default CPU and memory allocations for the frontend, background workers, scheduler, and graph database services.
    • Raised the default graph database memory limit from 512 MB to 1.5 GB.

…rvices

Follow-up to #639/#641, which only covered the services our production
Terraform explicitly overrides. Memgraph, and the CPU side of Celery
beat/worker and the frontend, were left at the original defaults.

Sized from cgroup counters (memory.peak, memory.events, cpu.stat) read
from live production pods:

  memgraph       peak 951Mi / 1Gi limit (93%), 508,254 throttled periods
  celery-worker  9 oom_kill events, 20k-24k throttled periods
  celery-beat    57,188 throttled periods at a 200m limit
  frontend       peak 787Mi / 1Gi (77%), 2 prior OOMKills, 40,310 throttled

Memgraph was the worst container in the cluster on both axes. Its
--memory-limit also stayed at 512MB while the container peaked at 951Mi,
so the graph store cap is raised to 1536MB, below the new 2Gi container
limit, so an oversized query is rejected instead of the pod being killed.

Raises requests by 550m CPU / 768Mi memory total. No value is lowered.
Docker Compose keeps --memory-limit=512 since it targets single hosts.
@damianloch
damianloch requested a review from a team as a code owner September 21, 2026 16:54

@arvo-ai-staging arvo-ai-staging 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.

Aurora Risk Review

Verdict: SAFE

No risks identified. This change looks safe to ship.


Aurora reviews PRs for incident prevention.

@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: Arvo-AI/aurora/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: a95ff256-f406-4581-b237-ddac42bcebf8

📥 Commits

Reviewing files that changed from the base of the PR and between b5b98a7 and 06af5f3.

📒 Files selected for processing (2)
  • deploy/helm/aurora/templates/memgraph-statefulset.yaml
  • deploy/helm/aurora/values.yaml

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


Walkthrough

The Helm chart increases default CPU and memory resources for several services. It also raises the default Memgraph memory limit from 512 MB to 1536 MB.

Changes

Resource defaults

Layer / File(s) Summary
Service resource allocations
deploy/helm/aurora/values.yaml
The default CPU and memory requests and limits increase for celeryWorker, celeryBeat, frontend, and memgraph.
Memgraph memory limit configuration
deploy/helm/aurora/values.yaml, deploy/helm/aurora/templates/memgraph-statefulset.yaml
The default MEMGRAPH_MEMORY_LIMIT and StatefulSet --memory-limit value increase from 512 to 1536. The values file notes that the setting should remain below the Memgraph memory limit resource.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: oliviertrudeau

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: increasing Helm CPU and memory resource defaults for services affected by CPU throttling or out-of-memory events.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@OlivierTrudeau
OlivierTrudeau merged commit 06a0cbb into main Sep 21, 2026
14 checks passed
@OlivierTrudeau
OlivierTrudeau deleted the fix/helm-starved-resource-defaults branch September 21, 2026 18:07
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.

2 participants