Interview Prep/Linux/Kernel Parameters, Namespaces & cgroups

What is CPU throttling in cgroups, and how do you detect it?

AdvancedConceptKernel Parameters, Namespaces & cgroups
Answer

With a quota (cpu.max), a cgroup may use only quota µs of CPU per period (100 ms default). A multi-threaded app can burn the whole quota in a few ms and then sit stalled for the rest of the period, causing latency spikes even when average CPU looks low.

cat /sys/fs/cgroup/system.slice/api.service/cpu.stat
# nr_periods, nr_throttled, throttled_usec

A rising nr_throttled ratio means the limit is too tight. Many teams set CPU requests but no CPU limits in Kubernetes for this reason.

All Linux questions Roadmap: Linux

More on Kernel Parameters, Namespaces & cgroups