The Illusion of Idle Resources
In the world of Kubernetes, everything looks perfect on the surface. You have set your CPU limits, your monitoring dashboards show a nice, flat line of usage, and the node has plenty of headroom. But then, the p99 latency spikes. Your health checks start
failing, and your users complain about sluggishness. If you look at your average CPU utilization over a minute, it looks like nothing is wrong. This is because you are looking at the wrong timescale. The problem isn't that you lack total capacity; it is that you are being throttled in tiny, invisible bursts.
Requests vs. Limits: The Great Divide
To understand why this happens, you have to understand the two levers you pull when configuring a container: requests and limits. Think of a 'request' as a reservation. It is the amount of resource the scheduler guarantees your container will have. If a node has enough room to satisfy that reservation, the pod gets placed there. On the other hand, a 'limit' is a hard ceiling. It is the maximum amount of resource the container is allowed to touch. While requests are about ensuring fairness and placement, limits are about enforcement. This is where the trouble starts.
The 100 Millisecond Trap
The reason your average usage graphs lie to you is due to how the Linux kernel enforces CPU limits using something called CFS quotas. Instead of looking at your usage over a minute, the kernel looks at very short windows, typically 100 milliseconds long. If you set a CPU limit, the kernel hands out a specific quota of CPU time for each of these tiny windows. If your application uses up its entire quota in the first 10 milliseconds, the kernel effectively freezes your container for the remaining 90 milliseconds. To your monitoring tool, it looks like you used a little bit of CPU and then nothing. In reality, your application was screaming for help while being held in a digital timeout.
Why Memory is Different
It is important to note that CPU and memory behave in fundamentally different ways. CPU is 'compressible.' When you hit a CPU limit, the kernel just makes you wait. You keep running, just much slower. This is why you see latency spikes instead of crashes. Memory, however, is 'incompressible.' You cannot pause a process that is trying to use more RAM. If a container exceeds its memory limit, the kernel's out-of-memory killer steps in and terminates the process immediately. This results in an OOMKilled error and a container restart. While memory issues lead to crashes, CPU issues lead to the silent, frustrating performance degradation that catches so many engineers off guard.
How to Spot and Fix Throttling
So, how do you stop the bleeding? First, stop trusting average CPU utilization. You need to look at throttling metrics. Tools like cAdvisor expose specific counters that show the fraction of periods in which a container was throttled. If that number is high, you have found your culprit. To fix it, you have a few options. You can increase your CPU limits to provide more headroom for multi-threaded bursts, or you can be more deliberate with your requests. Many high-performance teams actually choose to set CPU requests based on real-world usage (like the p95) but omit CPU limits entirely for latency-sensitive services, relying on requests to ensure they get their fair share without being artificially paused.













