04 · Linux & capacity
Resource pressure
Find the boundary that is full. Spare capacity elsewhere does not let a process cross its own limit.
- 2-minute guide
- All field guides
The model
Separate utilization from waiting work. Busy CPUs, exhausted memory and blocked I/O require different evidence. Load average includes runnable tasks and uninterruptible waits; it is not a CPU percentage.
Also separate scopes: host, container, process and application budgets. A container can exceed its memory limit while the host has plenty available. CPU limits usually throttle work rather than kill it.
Worked example
An image worker needs 320 MiB during a resize but has a 256 MiB container limit: 64 MiB too much. The host reports 8,192 MiB available. Its spare memory does not override the container limit.
If termination evidence identifies a memory-cgroup OOM, investigate the workload peak and that limit. Moving unrelated workloads off the host would not change it. Exit 137 alone only indicates SIGKILL; it does not establish an OOM.
Commands worth running
Use host tools on Linux; use the Kubernetes command where a pod is the relevant scope.
vmstat 1 5Read interval reports after the first, which summarizes since boot. Compare runnable work (r), blocked work (b) and CPU time before assuming compute saturation.
free -mRead available, an estimate including reclaimable cache. Low free alone is not a shortage. Units here are MiB.
kubectl describe pod image-workerCompare the container’s memory limit with its last termination reason. Current usage after a restart cannot reconstruct the earlier peak.
Self-check
What evidence would identify which memory boundary was enforced?
Show answer
A container OOM reason and matching cgroup evidence, compared with host memory pressure. Do not infer the scope from a restart count alone.