A developer pings you: "the node is idle, so this cannot be CPU." Their service runs in a cgroup whose cpu.max reads 100000 100000 on a 64-core host that is 20% busy. It has 16 worker threads. Its CPU utilization graph is flat and far below the quota, but p99 latency shows stalls of up to 90 ms and cpu.stat shows nr_throttled climbing at roughly the rate of nr_periods. What is happening?
- cpu.max applies per thread, so each of the 16 threads gets only a fraction of the quota. The quota is a single pool for the whole group; threads share it, which is exactly why parallelism drains it fast.
- The 16 threads spend the whole quota in the first few milliseconds of each 100 ms period; the kernel then throttles every thread in the group until the next period, so average usage looks low while wall-clock stalls are long. CFS bandwidth control accounts quota per period across all threads; parallel bursts exhaust it early and the rest of the period is dead time.
- The stalls are memory reclaim; CPU throttling never affects latency because the scheduler is work-conserving. Throttling forcibly deschedules runnable threads; it is the definition of added latency, and cpu.stat is pointing at it.
- The host is CPU-saturated and the group is losing the fight for cores; raise cpu.weight. The host is 20% busy. nr_throttled counts quota exhaustion, which happens on an idle host; weight only matters under contention.
The threads use up the whole CPU quota early in each 100 ms period, so the kernel stops every thread until the next period; average use looks low while stalls are long.
cpu.max is quota period: the group may run quota microseconds of CPU time per period, summed across every thread. With many runnable threads the quota is consumed in a few milliseconds of wall time and the group sleeps for the remainder of the period, so utilization averaged over seconds looks fine while each request that lands in the throttled window waits tens of milliseconds. The interview signal is reaching for cpu.stat rather than a utilization graph, and knowing the fix is the ratio of parallelism to quota, not host capacity.
Reaching for cpu.weight or 'more cores'. Neither touches quota exhaustion, which happens on an idle host by design.