Repository navigation
fix: give the oed-api container a 1Gi memory limit - #7
Conversation
With no limit, a large /api/v1/data request could use all of a node's memory. On 2026-11-04 the kernel OOM-killed this container while the node itself went NotReady, evicting every pod on it, three times in about 75 minutes. With a limit, only this container is killed.
matthewberry
left a comment
There was a problem hiding this comment.
Looks good. Checked:
helm template(afterhelm dependency build) rendersresources.limits.memory: 1Giandrequests.memory: 256Miin the right place under theoed-apicontainer.- The Dockerfile
CMDruns one uvicorn process with no--workers, so 1Gi covers a single process.
Nit: the values.yaml comment says "A 5000-record /api/v1/data request peaks at about 260Mi." Once #8 merges that stops being true, because most of the 260Mi was the rich.print. #8 measures about 21 MiB before encoding. Either drop the number or say it was measured before #8.
|
Correction to the PR description: |
Why
On 2026-11-04 two mmli2 worker nodes went NotReady three times between them with
SystemOOM ... victim process: uvicorn, evicting every pod on them (including the mmli-backend and its MinIO). At 15:31 UTC the container OOM-killed at that moment was this one: it has no memory limit, so a request that grows large uses the node's memory instead of a container's. Its last logged request wasGET /api/v1/data?offset=0&limit=5000from outside the cluster; the request in flight when it died wasn't logged.What
deployment.yamlrenderscontroller.resourceswhen set.values.yamlsets a 256Mi request and a 1Gi limit. If a request exceeds 1Gi, only this container is OOM-killed and restarted; the node and its other pods are unaffected.Sizing
Idle, the container uses 46–106Mi. A 5000-record response, including the
rich.printof all records inapp/db/queries.py:143, peaks at about 260Mi (measured locally with synthetic records shaped like the real ones). A full-table request (35,753 records, no cap on an explicitlimit) peaks at about 1.6Gi in that print alone, so it will now kill the container instead of the node. Cappinglimitand removing that print come in a separate PR.Testing
helm templaterenders the Deployment withresources.requests.memory: 256Miandresources.limits.memory: 1Gi. Not yet observed on the cluster.Deploying
Argo CD (
mmli2-mmli-oed-api) tracks this chart onmainwith automated sync, so merging rolls out a new pod; with one replica, the API is briefly unavailable.