Menu

Kubernetes Requests vs Limits: CPU Throttling, QoS Classes, and OOMKilled
πŸ“°

Kubernetes Requests vs Limits: CPU Throttling, QoS Classes, and OOMKilled

DEV Community: kubernetesΒ·R (RYUSLOG DEV)Β·about 13 hours ago
#tzr8S9xX
#devtokubernetes#devto#dev#requests#memory
Reading 0:00
15s threshold

Quick Summary

requests is what the scheduler reserves for a container; limits is what the kernel enforces at runtime. They are different mechanisms with different consequences: the scheduler sums requests to decide whether the pod fits on a node, and the cgroup enforces limits afterwards. A container with a CPU limit is throttled by the CFS (Completely Fair Scheduler) quota when it exceeds it β€” it is never killed. A container with a memory limit that exceeds it is killed with OOMKilled (exit code 137). That asymmetry is the whole reason CPU limits are contested and memory limits are not.

The ratio between requests and limits also defines the pod's QoS class. Guaranteed requires every container to have CPU and memory requests equal to limits; BestEffort requires none of them; anything in between is Burstable .…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.