PREP WITH PROOF
Menu
DEVOPS / PRACTICAL GUIDE

Kubernetes CPU Throttling: Diagnose Slow Pods

Diagnose Kubernetes CPU throttling with kubectl and PromQL. Read quota counters, distinguish OOM kills, and test whether a CPU limit causes slow requests.

THE QUICK ANSWER

Check the applied CPU limit and compare the share of throttled enforcement periods with latency on the same container. Throttling delays runnable work. OOMKilled indicates a memory-related termination. Test one change to the CPU limit under the same traffic before attributing slow requests to quota.

The Pod is running. Why are requests slow?

An API still passes its health checks, but its slowest requests take twice as long during a traffic burst. The container has no recent restart, and the CPU graph averages 180 millicores against a 250-millicore limit. That average looks comfortable. It can still hide short bursts in which the workload used up its CPU quota and had to wait for the next enforcement period.

On Linux, a CPU limit caps the CPU time available to a container. Once a runnable workload consumes its quota for an enforcement period, the kernel can make it wait for more CPU time. A CPU request is used in scheduling and affects the workload’s relative CPU allocation under contention. Raising the request can help when containers are competing for CPU, but an unchanged CPU limit can still constrain a burst.

Memory limits have a different failure mode. A process can be killed when the kernel cannot satisfy memory demand within a limit. A container reported as OOMKilled calls for memory investigation. Throttling alone does not kill a container, although sustained slowness can make a liveness probe fail and trigger a restart. Distinguish those paths before adjusting a deployment.

ObservationCheck firstDo not infer from this alone
Higher tail latency, stable restartsPer-container quota counters and request latency over the same windowAny throttling is necessarily harmful
Termination reason OOMKilledMemory demand and limit; check node events as wellCPU quota caused the kill
Pod reason EvictedEviction message and node resource pressureA container hit its memory limit
Liveness probe failures before restartsProbe events, previous logs, and CPU or dependency delaysEvery restart is an OOM kill

Source: Kubernetes: resource requests and limit enforcement ↗

Capture the affected container before it gets replaced

Set the namespace, Pod and container to the affected names. Describe the Pod and check the named container’s actual requests, limits, state, last state and restart count. In the events, check whether a probe failed or the Pod was evicted. Use the applied Pod’s settings; admission defaults or policies can make them differ from a manifest in source control.

The previous-log command is useful when a container restarted and the prior instance’s logs are still available. If it never restarted, skip that command. Check the right container in a multi-container Pod: a proxy and an application can have different quotas, and the proxy can delay an otherwise healthy application.

Record the affected Pod names and the incident timestamps. An aggregate dashboard can hide one overloaded replica, and a rollout can replace the original Pod with another one that has the same application labels. Compare the relevant container and time window. kubectl top is a useful resource snapshot if Metrics Server is available; it does not tell you how many CPU quota periods were throttled.

ns=payments
pod=checkout-api-7c8c5b6fb9-j7mz2
container=api

kubectl -n "$ns" describe pod "$pod"
kubectl -n "$ns" top pod "$pod" --containers
# Only if this container previously terminated:
kubectl -n "$ns" logs "$pod" -c "$container" --previous

Source: Kubernetes: debug a running Pod ↗

Measure throttled periods alongside latency

If your Prometheus setup collects kubelet cAdvisor CPU metrics with namespace, pod and container labels, graph this query for the affected container. Replace the three label values, and add a cluster selector if your data source contains multiple clusters. Start with one series per metric for the chosen container. If the result has duplicate lines, inspect the scrape labels and select the correct target before aggregating. The division uses Prometheus’s default vector matching; if the two metrics have different labels, inspect both before attempting to join them.

The numerator measures throttled periods per second and the denominator measures enforcement periods per second. A result of 20 means about 20 percent of observed enforcement periods had some throttling. It does not say the workload lost 20 percent of a core or spent 20 percent of wall time waiting. For example, if the counters increase by 200 and 1,000 across the same interval, the ratio is 20 percent whether the quota was exceeded briefly in each affected period or repeatedly left work queued until the next one.

Graph request duration, request rate and errors alongside the ratio. If the slow requests line up with rising throttling on the same replica, you have a hypothesis to test. If throttling rises only during background work while request latency stays stable, the ratio alone does not justify a change. Choose a rate window with several scrape samples and inspect shorter bursts with finer-grained data when you have it.

100 *
rate(container_cpu_cfs_throttled_periods_total{
  namespace="payments", pod="checkout-api-7c8c5b6fb9-j7mz2", container="api"
}[5m])
/
rate(container_cpu_cfs_periods_total{
  namespace="payments", pod="checkout-api-7c8c5b6fb9-j7mz2", container="api"
}[5m])

Source: cAdvisor: Prometheus CPU counters ↗

Handle a missing or misleading time series

No result can mean missing metrics, mismatched labels, a new Pod with too few samples, or no exported quota accounting for that container. An undefined ratio can mean the denominator did not advance. Inspect the raw numerator and denominator separately and confirm the scrape target is up before treating any of those cases as zero. Use rate before aggregating counters so Prometheus can handle resets for the individual series.

If you have approved access to the relevant Linux cgroup v2 and can identify the container’s cgroup path, cpu.max shows the local quota and period, and cpu.stat can expose nr_periods, nr_throttled and throttled_usec when the CPU controller is enabled. Use counter differences over the same interval and stay on the same cgroup. A quota of max means no local quota is set; an ancestor may still impose a ceiling. A cgroup path visible in one container or node may be different in another, so avoid assuming that the first cpu.stat you find belongs to the application.

If requests are slow and quota counters are flat during the incident, look for other explanations. Node contention can delay runnable work even without increasing quota throttling. A connection pool or upstream service can also be the bottleneck while CPU remains idle. Compare node load, pool wait time and dependency latency before changing a CPU setting.

Source: Linux kernel: cgroup v2 CPU controller ↗

Run one comparison that can disprove the diagnosis

Use a staging replica or a small controlled canary. Choose a repeatable request mix, including the slow endpoint or burst that exposed the issue. Keep the CPU request, memory settings, traffic per replica and application configuration fixed. Compare the baseline with one change to the CPU limit. The values below are illustrative, not sizing recommendations; check available node capacity and namespace policy before using them.

Record tail latency, throughput, errors, CPU usage and throttled-period ratio for both runs, and check a neighboring workload for contention. If throttling falls but latency does not improve, the quota was not the main explanation for that test. If latency and throttling both improve at similar throughput and error rates, the result supports the quota hypothesis. Repeat the comparison if cache warmup or a dependency changed between runs.

Then choose the fix that addresses the measured bottleneck. Raising the limit can give a single replica more burst room if the node has it. Adding replicas may help when work distributes evenly, but will not fix a single serialized operation or a hot shard by itself. Reducing worker concurrency can spread the quota over fewer simultaneous requests, at the cost of possible application queueing. Profiling may show unnecessary CPU work that none of these settings removes.

# Container resource settings for an illustrative baseline.
# Change only limits.cpu to "500m" in the comparison run.
resources:
  requests:
    cpu: "200m"
    memory: "256Mi"
  limits:
    cpu: "250m"
    memory: "512Mi"

Source: Kubernetes: resource requests and limit enforcement ↗

Verify the fix under the original burst

After the change, confirm the running Pod has the expected resources. Repeat the original burst and compare the affected endpoint’s latency at a similar request rate. Check restarts, probe failures and the impact on other workloads. The goal is a better user-facing result within capacity, not a chart that shows zero throttling.

Keep the useful evidence together: the Pod and container identity, the quota settings, the incident window, and the before-and-after behavior. If the container was instead killed for memory, continue with the related OOMKilled guide. If events show liveness failures without an OOM kill, use the related probe guide to check whether the probe is exposing a resource bottleneck or has an independent problem.

Source: Kubernetes: node pressure eviction and OOM behavior ↗

KEEP THESE THREE THINGS

Your next steps

  1. Capture the affected container and its restart or eviction evidence before looking at aggregate charts.
  2. Treat throttled-period share as a frequency signal and compare it with per-replica latency.
  3. Change one variable, repeat the workload and verify latency, errors and neighboring capacity.

Sources & official resources

Linked resources checked on 2026-11-08. Technical behavior and provider guidance can change; check the documentation for the version you use.

About this guide and its recommendations

Published by Prep With Proof with AI-assisted drafting. Study routines and examples are editorial suggestions, not official exam instructions or claims of a learner's personal results. Cited provider facts are linked; ownership of recommended Prep With Proof products is disclosed. No competitor endorsement or guaranteed certification outcome is implied.

Suggest a correction →