04 · Linux & capacity

Resource pressure

Find the boundary that is full. Spare capacity elsewhere does not let a process cross its own limit.

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.

Host memory cannot bypass a container limitA host has eight thousand one hundred ninety-two mebibytes available. Inside it, a container's memory limit is two hundred fifty-six mebibytes. A workload needing three hundred twenty exceeds that limit by sixty-four mebibytes. Host available: 8,192 MiB Workload needs 320 MiB Container limit: 256 MiB64 MiB over this boundary
Illustrative — memory amounts are MiB, not percentages.

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 5

Read interval reports after the first, which summarizes since boot. Compare runnable work (r), blocked work (b) and CPU time before assuming compute saturation.

free -m

Read available, an estimate including reclaimable cache. Low free alone is not a shortage. Units here are MiB.

kubectl describe pod image-worker

Compare the container’s memory limit with its last termination reason. Current usage after a restart cannot reconstruct the earlier peak.

Self-check

References

Practise it