Skip to content

fix(helm): raise default uwsgi memory limit to 1Gi - #17151

Merged
Maffooch merged 1 commit into
devfrom
fix/helm-uwsgi-memory-limit
Dec 4, 2026
Merged

Maffooch merged 1 commit into
devfrom
fix/helm-uwsgi-memory-limit

Conversation

@Maffooch

@Maffooch Maffooch commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Summary

The test-k8s / Kubernetes Deployment job keeps ejecting unrelated PRs from the dev merge queue. The uwsgi container is OOM-killed on the first API login. The restart diagnostics added in #16398 now show the cause. From job 144642921948:

uwsgi: restarts=1 lastState={"terminated":{...,"exitCode":137,...,"reason":"OOMKilled",...}}

Merge-group runs 47217243792 (k8s 1.34.12) and 47200498848 (k8s v1.35.10) fail the same way. Across the last 40 Unit tests merge-group runs on dev, 11 Kubernetes Deployment jobs failed. Some passing jobs also show a uwsgi restart that the token-auth retry loop hid (sampled 8 passing jobs, 6 had a 502 or a second Starting uWSGI).

Anyone on the default chart values hits the same limit, so the fix belongs in the chart:

  • 4 warm uwsgi processes use about 500Mi.
  • Django's Argon2PasswordHasher uses memory_cost=102400 KiB, so each login, token-auth or basic-auth request adds about 100Mi while it hashes.
  • At 512Mi, the first password check pushes the container over the limit, and the kubelet kills the whole container.

This PR raises django.uwsgi.resources.limits.memory from 512Mi to 1Gi. Requests stay at 256Mi, so scheduling is unchanged. Only the ceiling moves.

#16097 proposed the same change earlier and was closed without merging. At that point the OOM was inferred from logs and a local reproduction. #16398 then added the diagnostics to confirm it in CI, and the runs above now show OOMKilled.

Changes

  • helm/defectdojo/values.yaml: uwsgi memory limit 512Mi to 1Gi, with a # -- note on sizing (raise it further with more processes or threads).
  • helm/defectdojo/README.md: regenerated with helm-docs 1.14.2.
  • helm/defectdojo/values.schema.json: adds the field description (the schema generator runs with useHelmDocs: true). The Update schema job checks it.
  • helm/defectdojo/Chart.yaml: artifacthub.io/changes entry.

Checks

  • helm lint helm/defectdojo: 0 charts failed.
  • helm template renders memory: 1Gi on the uwsgi container.
  • The test-k8s jobs on this PR are the real check. I'll rerun them a few times to show they pass consistently.

🤖 Generated with Claude Code

With 4 uwsgi processes the warm workers use about 500Mi, and each
Argon2 password check allocates about 100Mi more. At the 512Mi limit
the first login or token-auth request OOM-kills the uwsgi container.
This also breaks the test-k8s job in the merge queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Maffooch
Maffooch requested a review from blakeaowens as a code owner December 3, 2026 22:54
@Maffooch Maffooch added this to the 3.6.0 milestone Dec 3, 2026
@github-actions github-actions Bot added the helm label Dec 3, 2026
@Maffooch
Maffooch added this pull request to the merge queue Dec 4, 2026
Merged via the queue into dev with commit 9936615 Dec 4, 2026
94 checks passed
@Maffooch
Maffooch deleted the fix/helm-uwsgi-memory-limit branch December 4, 2026 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants