How Kubernetes CPU Throttling Causes Latency Spikes Even at Low CPU Usage
Kubernetes enforces CPU limits through the Linux kernel's Completely Fair Scheduler (CFS) in 100-millisecond windows, which can freeze containers even when average CPU usage appears low. A container hitting its quota early in a window may remain frozen for the rest of it, causing latency spikes invisible to standard monitoring dashboards. SREs are advised to track the CFS throttling ratio metric rather than raw CPU usage, flagging applications where over 15–25% of scheduler windows are throttled. Runtime misconfigurations in Java and Go can worsen throttling by spawning threads based on host core counts rather than container limits, a problem addressable via UseContainerSupport and Uber's automaxprocs library. For latency-sensitive workloads on bare-metal nodes, assigning pods to the Guaranteed QoS class with integer CPU values allows Kubernetes to bypass CFS quotas entirely by pinning containers to dedicated physical cores.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in