Kubernetes CPU Throttling: Why Low CPU Graphs Still Freeze Requests
Kubernetes CPU throttling freezes a container for the rest of each 100ms CFS period once its CPU quota is spent, so average CPU can look calm while p99 latency explodes. This guide proves throttling with cpu.stat and PromQL, separates it from node saturation and GC pauses, and fixes requests, limits and runtime thread pools safely.
Introduction
The dashboard says the service is fine. CPU sits at 20 percent, the Pod is Running and Ready, no restarts, no errors in the log. Yet customers see p99 latency jump from 40 milliseconds to over a second whenever traffic arrives in bursts, and the on-call engineer keeps restarting a healthy Pod. That composite incident is the natural habitat of Kubernetes CPU throttling: a latency fault that hides from every average-based graph, because the container is not short of CPU over a minute — it is frozen for most of each 100 millisecond window.
The mechanism is simple once you see it. A CPU limit becomes a CFS bandwidth quota: a budget of CPU time per period, 100ms by default. A 500m limit means 50ms of CPU time per period. If a burst of requests burns that budget in the first few milliseconds, the kernel suspends every thread in the container until the next period begins. Requests arriving during the freeze wait, and tail latency absorbs the wait. The node can be nearly idle the whole time. The limit, not the hardware, is the bottleneck.
This guide shows how to prove Kubernetes CPU throttling with cgroup counters and PromQL, how to separate it from node saturation, garbage collection and downstream slowness, and how to fix it without trading latency for a runaway cloud bill. The core skill is reading the right metric: averages describe throughput, but throttling is a story about time.
1. Kubernetes CPU throttling: prove it in the cgroup before you change limits
Proof comes before tuning in Kubernetes CPU throttling work, because raising limits on a guess can mask the real fault and inflate cost. The kernel keeps the receipts in the container's cgroup. On cgroup v2 nodes, read cpu.stat inside the container; on cgroup v1, the same counters live under the cpu controller path. Three fields matter: nrperiods counts elapsed quota periods, nrthrottled counts periods where the container was throttled, and throttledusec or throttledtime accumulates how long threads spent frozen.
Read the ratio, not the raw count. A container throttled in a handful of periods since start is noise. A container where nr_throttled climbs steadily during traffic, with throttled time growing in step with latency spikes, is your incident. Compare the live ratio over a load window: throttled periods divided by total periods above roughly a quarter means a meaningful share of scheduling windows end in a freeze. Also read cpu.max to confirm the quota the kernel actually enforces; a LimitRange in the namespace may have injected a default limit nobody remembers setting. The ResourceQuota and LimitRange guide explains how those defaults sneak in.
Pair the cgroup evidence with the application's own latency histogram. The throttling signature is a wide gap between p50 and p99: most requests complete in tens of milliseconds, while the unlucky tail waits out a quota freeze. If p50 and p99 rise together, suspect a downstream dependency or node pressure instead. If the Pod restarts with exit code 137, that is memory, and the OOMKilled runbook is the right tool. Throttling never restarts a Pod; it just makes a healthy Pod slow, which is exactly why it survives so many incident reviews.
2. Kubernetes CPU throttling mechanics: requests are weight, limits are quota
Two different kernel mechanisms hide behind the similar-looking fields in a Pod spec, and Kubernetes CPU throttling only makes sense once they are separated. A CPU request becomes a scheduling weight — cpu.weight on cgroup v2. Weight matters only under contention: when the node is busy, containers receive CPU in proportion to their weights; when the node is idle, a container may use far more than its request. Requests also drive placement, because the scheduler packs Pods onto nodes by summing requests against allocatable capacity.
A CPU limit becomes a bandwidth quota — cpu.max on cgroup v2. The kernel grants the cgroup a budget per period, and the budget is shared across every thread in the container. That sharing is the sharp edge. A multithreaded service on a many-core node can spend a 500m quota almost instantly: eight busy threads running in parallel consume 50ms of CPU time in about 6ms of wall-clock time, after which every thread freezes for the remaining 94ms. The limit does not mean "half a core, steadily". It means "as much parallelism as you like, until the budget is gone, then nothing".
Runtime behaviour amplifies this. Go versions before 1.25 sized GOMAXPROCS from the node's core count rather than the container limit, so garbage collection fanned out across every core and burned quota at maximum speed. JVM services detect container limits more gracefully, but application thread pools sized by hand often ignore them. Each extra runnable thread makes the quota disappear faster while adding no useful throughput once the freeze begins.
Memory limits behave differently, and confusing the two causes real harm. A memory limit protects neighbours: exceed it and the container is OOMKilled, which is visible and final. A CPU limit protects nothing in the same way; it shapes scheduling and can only make the limited container slower, even on an idle node. That asymmetry is why many platform teams set memory limits carefully and treat CPU limits as optional. The container internals guide walks through how these cgroup files are created by the runtime, which is worth reading before you argue about policy.
3. Kubernetes CPU throttling in PromQL: the ratio that averages hide
PromQL turns Kubernetes CPU throttling from a suspicion into a graph, because cAdvisor exposes the same counters the kernel keeps. Two metrics carry the story: containercpucfsperiodstotal counts quota periods, and containercpucfsthrottledperiodstotal counts periods that ended in throttling. Their rate ratio is the share of windows your container spent frozen, per container, over any window you choose. A third metric, containercpucfsthrottledsecondstotal, measures total frozen time and is useful for ranking offenders.
Plot that ratio next to the service's p99 latency and the incident usually explains itself: latency spikes line up with throttling ratio spikes, while average CPU usage stays flat. Rank the worst offenders with topk over the same ratio to find containers nobody suspected, then check whether their limits were copied from a template years ago. The PromQL for Kubernetes SREs guide builds alerting around these series; a sustained ratio above roughly 0.25 on a latency-sensitive service is a reasonable paging threshold, tuned to your SLOs rather than copied blindly.
Watch the interaction with autoscaling. An HPA watching CPU utilisation sees a throttled container pinned at its limit and adds replicas, which spreads load and reduces throttling per Pod — at the cost of running more Pods to work around a limit that should not exist. Costs climb, latency improves slightly, and the root cause survives. The HPA v2 tutorial covers scaling on CPU and custom metrics; the lesson here is to fix throttling before tuning the autoscaler, or the autoscaler will faithfully scale your mistake.
One caution: throttling metrics only exist for containers with CPU limits. A container with no limit cannot be throttled, so its absence from the graph is information, not a monitoring gap. If a slow service has no limit and no throttling series, your problem is elsewhere — node contention, downstream latency, or the application's own pauses.
4. Kubernetes CPU throttling versus node saturation, GC and downstream latency
Four different faults produce the same user complaint — "the service is slow" — and Kubernetes CPU throttling is only one of them. Node saturation means the machine itself is out of CPU: every container on the node slows together, load average climbs, and CPU pressure stall information rises. Throttling is narrower: one container freezes while its neighbours on the same node run fine, because the quota belongs to the cgroup, not the node. Checking a neighbour Pod's latency is a thirty-second test that separates the two.
Garbage collection is the second look-alike. A JVM or Go service with long GC pauses shows latency spikes that correlate with heap pressure and GC logs, not with quota periods. The distinguishing evidence is alignment: GC pauses line up with collection events in runtime logs, while throttling lines up with nr_throttled increments and the PromQL ratio. Both can coexist — a throttled container also collects garbage more slowly — but fixing the limit first reveals how much pause was really GC.
Downstream latency is the third. If the service waits on a database or an API, its own CPU counters stay calm, throttling ratio stays near zero, and traces show the time spent in client calls. Raising CPU limits for a downstream-bound service changes nothing except the bill. Distributed tracing earns its keep here: a span breakdown that shows 900ms in a database call ends the throttling investigation immediately.
The fourth look-alike is self-inflicted concurrency: a thread pool far larger than the CPU budget, queueing work internally. Requests wait for a worker thread while the container still has quota, which looks like throttling from outside. The cgroup counters stay clean in that case, and the fix is pool sizing, not limits. Run the four-way check in order — cgroup ratio, node pressure, GC logs, trace breakdown — and let each result eliminate a suspect before you touch the Pod spec.
5. Kubernetes CPU throttling fixes: raise, remove or reshape the limit
Fixing Kubernetes CPU throttling is a decision about what the limit is for. If the limit exists to protect the node, remember that CPU is compressible: a greedy container can be squeezed by weights under contention without a hard quota, while memory is the resource that actually kills neighbours. Many production platforms therefore set CPU requests for every container, set memory limits for every container, and set CPU limits only where a hard ceiling is genuinely required — multi-tenant clusters with noisy-neighbour contracts, or batch work that must never starve interactive services.
Removing the CPU limit is the cleanest fix for a latency-sensitive service whose request is honest. Raising the limit is the conservative version: it keeps a ceiling but moves it above the burst profile, so freezes become rare. Reshaping is the third option: keep the limit, but reduce the burst by sizing thread pools to the quota, setting GOMAXPROCS from the limit, and smoothing batch work out of the request path. Each option is legitimate; the wrong move is copying a limit from a template without measuring the burst it must absorb.
Whatever you choose, size the request from evidence. The request is your scheduling guarantee and your weight under contention, so it should reflect sustained usage at peak, not the average of a quiet Tuesday. Use vertical pod autoscaling recommendations or a week of usage percentiles as a starting point, then load-test. QoS class follows from these choices: requests equal to limits gives Guaranteed, requests without limits gives Burstable, and the eviction consequences differ under node pressure. The QoS classes guide explains that ordering, and it belongs in the same design conversation as throttling.
Roll the change like any other production change: one service, one namespace, watch throttling ratio and p99 for a full traffic cycle, then proceed. If latency does not move, your diagnosis was wrong and the matrix in the next section is where to re-enter the investigation.
6. Troubleshooting matrix: match the Kubernetes CPU throttling symptom to the cause
The matrix below compresses the Kubernetes CPU throttling investigation into evidence you can collect in minutes. Work from the symptom you actually observe, confirm the evidence column, and only then apply the fix. Skipping the evidence step is how teams raise limits for GC problems and add replicas for downstream outages.
| Symptom | Evidence to collect | Likely cause | Fix |
|---|---|---|---|
| p99 spikes, average CPU low | nr_throttled climbing; throttling ratio above 0.25 | CFS quota freeze | Raise or remove CPU limit; resize thread pools |
| All Pods on one node slow | Node CPU pressure high; neighbours affected equally | Node saturation | Rebalance Pods, raise requests, add capacity |
| Latency spikes with GC logs | Pauses align with collection events; quota counters calm | Runtime GC pressure | Tune heap/GC; then re-check throttling |
| Slow with idle CPU everywhere | Traces show time in DB/API client spans | Downstream dependency | Fix downstream; leave limits alone |
| HPA adds Pods, latency barely moves | Usage pinned at limit; throttling ratio high | Autoscaler masking throttling | Fix limit first, then retune HPA |
| Pod restarts, exit code 137 | OOMKilled events; memory at limit | Memory limit, not CPU | Memory sizing; see OOMKilled runbook |
| Bursts queue inside the app | Quota counters clean; thread pool saturated | Oversized concurrency | Size pools to CPU budget |
Two rows deserve emphasis because they waste the most money. The HPA row: an autoscaler scaling against a throttled ceiling burns budget while barely helping users, and the graph looks like the autoscaler is "working". The restart row: exit code 137 is memory, and no CPU change will fix it. Keeping those separations crisp is most of what senior engineers do differently in these incidents.
Record the row you landed on, the evidence that put you there, and the before-and-after throttling ratio in the incident notes. That record is what turns a one-off fix into a platform policy the next team can trust.
7. Kubernetes CPU throttling and runtime tuning: GOMAXPROCS, thread pools and burst shape
Runtime tuning is the underrated half of Kubernetes CPU throttling work, because the quota is spent by threads, and threads are created by runtimes. A service that spawns workers for every core on a 32-core node while holding a 500m limit is structurally guaranteed to freeze: its parallelism is sixty times its budget. Aligning runtime concurrency with the CPU budget does not replace fixing a bad limit, but it removes the self-inflicted part of the freeze and makes the remaining throttling signal honest.
For Go services, set GOMAXPROCS from the container limit — modern Go does this automatically in recent versions, but explicit configuration protects older builds and makes the intent visible in the manifest. For JVM services, container-aware ergonomics handle heap and GC threads, yet application executors, connection pools and fork-join pools still need deliberate sizing. For Node.js, the event loop is single-threaded but the libuv thread pool and worker threads still count against the same quota.
Burst shape matters as much as thread count. A service that processes requests smoothly spends quota evenly; a service that fans out to twenty backends per request, then does a burst of JSON serialisation, spends quota in spikes. Those spikes are exactly what a 100ms quota punishes. Where the workload allows it, smoothing work — streaming responses instead of buffering, paginating large payloads, moving batch jobs out of the request path — reduces throttling without touching limits at all.
Measure after each runtime change with the same throttling ratio you used for diagnosis. If the ratio falls but p99 does not, the freeze was not your latency bottleneck. If both fall together, you have found the mechanism, and the remaining question is whether the limit itself still earns its place.
8. Decision table: choosing a Kubernetes CPU throttling fix without overspending
Every Kubernetes CPU throttling fix spends something — money, isolation or engineering time — so choose with the trade-offs visible. The table below compares the realistic options for a latency-sensitive service that has confirmed throttling with cgroup and PromQL evidence. Batch and multi-tenant workloads may legitimately choose differently, and the last column names what to watch after the change.
| Option | Latency effect | Cost / isolation effect | Watch afterwards |
|---|---|---|---|
| Remove CPU limit, keep honest request | Freezes eliminated; bursts use idle node CPU | Node contention handled by weights; request still reserves capacity | Node CPU pressure, neighbour latency |
| Raise CPU limit above burst profile | Freezes become rare, ceiling remains | Slight overcommit risk; ceiling still protects tenants | Throttling ratio at peak, burst growth |
| Keep limit, resize thread pools to quota | Freeze windows shrink; throughput per period stabilises | No cost change; may cap peak throughput | Queueing inside the app, pool saturation |
| Add replicas via HPA | Spreads load, throttling per Pod falls | Direct cost increase; masks root cause | Cost per request, ratio per Pod |
| Move to larger nodes / fewer, bigger Pods | More quota headroom per Pod | Fewer, larger failure domains | Scheduling fit, blast radius |
The default recommendation for user-facing APIs is the first row, with the second as the fallback where tenant isolation contracts require a ceiling. The fourth row is a mitigation, not a fix, and should be labelled as such in the incident notes so nobody mistakes replica count for a solution. The fifth row occasionally makes sense for CPU-dense services, but it changes scheduling and failure domains, so it belongs in a capacity review rather than an incident.
Whichever row you pick, define the success metric before the change: throttling ratio below an agreed threshold during peak, and p99 latency back inside SLO for a full traffic cycle. A fix without a pre-agreed metric becomes an opinion, and opinions do not survive the next budget review.
9. Kubernetes CPU throttling prevention: requests, LimitRanges and admission policy
Prevention turns Kubernetes CPU throttling from an incident class into a lint rule. Start with requests: every container gets a CPU request derived from measured usage, reviewed when traffic patterns change. Requests are the scheduler's truth and the contention weight, so an honest request is the cheapest latency insurance available. Vertical pod autoscaling in recommendation mode gives teams a data-backed starting point without handing it the controls.
Then audit the defaults that create throttling silently. A LimitRange with a default CPU limit applies that limit to every container that does not specify one, which means a platform decision made for cost control can freeze services whose owners never chose a limit. If your platform sets default CPU limits, pair them with a throttling dashboard and an exception path, or drop the CPU default and keep only the memory default. The ResourceQuota and LimitRange guide covers how these objects interact, and it is the right reference for the policy conversation.
Admission policy is the enforcement layer. A policy that requires CPU requests, requires memory limits, and either forbids CPU limits on latency-tier namespaces or requires an annotation justifying them will stop most throttling incidents before they deploy. Keep the policy explainable: one sentence per rule, linked to the incident or measurement that motivated it. Policies that engineers cannot explain get bypassed; policies tied to a p99 graph get followed.
Finally, alert on the ratio, not on usage. A dashboard of average CPU will never page you for throttling, because throttling is invisible to averages. Alert when a latency-tier container's throttling ratio stays elevated through a peak window, and route the alert to the service owner with the cgroup commands from section 1 attached. Prevention is mostly making the invisible metric impossible to ignore.
10. Use cases: Kubernetes CPU throttling on call, in interviews and in cost reviews
The same Kubernetes CPU throttling evidence serves three rooms. On call, the sequence is short: check nr_throttled, check the PromQL ratio, check whether neighbours on the node are affected, then decide. Five minutes of counters replace an hour of restarting healthy Pods. Keep the commands in the runbook next to the alert so the first responder starts with evidence instead of folklore.
In interviews, throttling is a favourite probe because it tests whether a candidate reads kernel mechanisms or just dashboards. A strong answer walks the chain: limit becomes cpu.max quota, quota is shared across threads, parallel bursts exhaust it in milliseconds, the container freezes until the next 100ms period, averages stay calm while p99 explodes, and the proof lives in cpu.stat and containercpucfsthrottledperiods_total. Then the candidate explains the fix trade-off — remove or raise the limit, keep the request honest, size thread pools to the budget — and names what they would watch afterwards. That structure signals production experience more than any certification list.
In cost reviews, throttling evidence cuts both ways. It exposes replica counts inflated by an HPA scaling against a throttled ceiling, which is money spent working around a limit. It also justifies keeping requests where they are, because the request is what guarantees the service its share when nodes get busy. Bring the throttling ratio graph and the cost-per-request graph together; the conversation becomes arithmetic instead of opinion.
Across all three rooms, the habit that matters is refusing to argue from averages. Latency is a tail phenomenon, throttling is a time phenomenon, and the metrics that describe them — ratios, percentiles, frozen seconds — are the ones worth putting on the wall.
11. Limits, failure modes and senior takeaways for Kubernetes CPU throttling
Removing CPU limits is not a universal law, and pretending otherwise would make this guide dangerous. In multi-tenant clusters, a hard CPU ceiling can be a contractual isolation tool, and weights alone may not satisfy a tenant who bought a guaranteed ceiling. In batch systems, limits keep background work from starving interactive services during node pressure. The senior position is narrower and stronger: CPU limits should be a deliberate choice with a named purpose, never a template default nobody measured. Where the purpose is latency protection, the limit usually defeats it.
There are failure modes on the other side too. A service with no CPU limit and an inflated request can still suffer under node contention if the platform overcommits requests aggressively. A service whose limit is removed while its thread pools stay oversized may trade freezes for context-switch overhead. And throttling metrics disappear for unlimited containers, so your dashboards must switch to pressure and latency signals for those workloads. Every fix moves the bottleneck; the job is to know where it moved.
The takeaways compress to four habits. Prove throttling in the cgroup before changing anything. Read ratios and percentiles, never averages, when latency is the complaint. Treat requests as the guarantee and limits as the exception. And fix the limit before tuning the autoscaler, or the autoscaler will spend money preserving the bug.
Keep the cpu.stat command, the PromQL ratio and the matrix in the runbook, and review throttling graphs after every significant traffic change. The next burst will arrive on schedule; whether it becomes an incident is a decision you make in the Pod spec, long before the pager goes off.
Frequently Asked Questions
What is Kubernetes CPU throttling in plain terms?
Kubernetes CPU throttling is the kernel pausing a container for the rest of a 100ms period after it spends its CPU quota. A 500m limit grants 50ms of CPU time per period; a burst can spend that in milliseconds, after which every thread freezes until the next period, even on an idle node.
How do I prove Kubernetes CPU throttling is causing latency?
Read /sys/fs/cgroup/cpu.stat inside the container and watch nrthrottled and throttled time climb during traffic. In Prometheus, divide the rate of containercpucfsthrottledperiodstotal by containercpucfsperiodstotal. If that ratio rises with your p99 latency while average CPU stays low, throttling is proven.
Why does Kubernetes CPU throttling hide from CPU graphs?
Because averages describe total CPU over a minute, while throttling is about timing inside 100ms windows. A container can average 20 percent CPU yet freeze in most periods during bursts. Dashboards built on usage averages look calm; ratio and percentile metrics show the freeze.
Should I remove CPU limits to fix Kubernetes CPU throttling?
For latency-sensitive services with honest CPU requests, removing the CPU limit is usually the cleanest fix, because requests still reserve capacity and weights handle contention. Keep CPU limits where a hard ceiling is a deliberate isolation or batch-protection requirement, and raise them above the measured burst profile.
How does Kubernetes CPU throttling interact with the HPA?
An HPA watching CPU utilisation sees a throttled container pinned at its limit and adds replicas. That spreads load and reduces throttling per Pod, but it spends money working around the limit. Fix the limit first, then retune the autoscaler, or the autoscaler preserves the root cause.
Can Kubernetes CPU throttling happen without a CPU limit?
No. Throttling is quota enforcement, and the quota comes from the CPU limit. A container with a request but no limit can still slow down under node contention, where weights decide its share, but it cannot be frozen by CFS bandwidth control. That distinction separates throttling from saturation.
What throttling ratio should trigger action in Kubernetes CPU throttling monitoring?
Treat a sustained ratio above roughly 0.25 during peak traffic on a latency-sensitive service as actionable, then tune the threshold against your SLOs. Pair the ratio alert with p99 latency so the page means user impact, and attach the cpu.stat commands to the alert for the first responder.
Preparing for Senior Platform & SRE Interviews
Practice real-world cluster triage, RBAC debugging, and pod scheduling scenarios in our Kubernetes scenario interview questions hub.
Explore Interview Scenarios →