Repository navigation
Description
Problem Description
The ollama-64gib pod restarted 5 times, and Kubernetes gives OOMKilled (exit 137) as the reason of the last restart (2026-10-27, 18:49 to 19:37 UTC). Each restart unloads the models of the ollama-64gib-standard tier, so the gateway fails or retries the calls in flight, and the next call waits for a model load.
The container has no memory limit (requests.memory: 8Gi, no limits), so the node ran out of memory. The node has 15.3 GiB of memory, and kubectl top node showed 79 % in use 3 minutes after the restart.
The last lines of the killed container are from llama-server, which Ollama 0.34.4 runs:
slot release: id 0 | task 1434 | stop processing: n_tokens = 81367, truncated = 0
srv prompt_save: - saving prompt with length 81367, total state size = 3172.830 MiB (draft: 319.702 MiB)
llama-server saves the state of an idle slot into a prompt cache in host memory. Its default size limit is 8,192 MiB (--cache-ram, environment variable LLAMA_ARG_CACHE_RAM, llama.cpp tools/server/README.md). With OLLAMA_CONTEXT_LENGTH=160000, one saved prompt can take more than 3 GiB, so the cache can take half of the node's memory beside the model.
Reproduction Steps
kubectl -n llm describe pod -l app.kubernetes.io/name=ollama-64gib | grep -A4 'Last State'kubectl -n llm logs <ollama-64gib-pod> --previous --tail=20- Send long prompts (80k tokens) to
qwen3.8:27borgemma4:31bon the tier, one after another.
Expected vs Actual Behavior
- Expected: the tier keeps its models loaded, and host memory stays below what the node has.
- Actual: the node runs out of memory and Kubernetes kills Ollama.
Environment Diagnostics
devops-cli 0.7.1 (main at 69928b0). k8s/llm/profiles/ollama-profiles.yaml, tier ollama-64gib: image ollama/ollama:0.34.4, OLLAMA_CONTEXT_LENGTH=160000, OLLAMA_MAX_LOADED_MODELS=2, OLLAMA_KV_CACHE_TYPE=q8_0, no memory limit.
Questions to answer
- Does Ollama 0.34.4 pass
LLAMA_ARG_CACHE_RAM, or anOLLAMA_*setting, to llama-server? If it does, set a cache size that fits the node, and a memory limit on the container that names the real budget. - How much host memory does the tier use with no prompt cache: the model files that Ollama maps, the draft model and the CPU buffers?
- Is the memory limit of the other tiers also unset?
Related
- fix(k8s): find why the 16gib-fast qwen3.8 IQ3_S gateway deployment returns HTTP 500 on about 300 calls a day #2368 investigates the HTTP 500 errors of the
ollama-16gibtier.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNew
Activity
dan-petty commentedon Oct 27, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
The item fixes an OOM defect in the Ollama tier.It restores stable model serving for the tier.