Kubernetes requests vs limits

The scheduler and the Cluster Autoscaler count requests, not use, so requests decide how many nodes you pay for.

Published 21 October 2026 · Updated 3 November 2026 · By Shreya Shukla (opens in a new tab), Backend engineer, Zoorik

Kubernetes pod right sizing: the old request moves down, day by day, to a new request just above real use

Short answer. A request is what the scheduler reserves for a container. A limit is the ceiling the kernel enforces. Set requests from real use: CPU at a high percentile and memory at the peak, both plus headroom. Don’t reduce limits until you know why they were set.

Requests vs limits

Requests and limits do different jobs, and CPU and memory behave differently once a container goes past them:

SettingWhat Kubernetes uses it forWhen the container goes above it
CPU request
Scheduling, and a weight when containers compete for CPU
It can use idle CPU on the node
CPU limit
A hard ceiling the kernel enforces
It is throttled. Runtimes don’t kill containers for CPU use
Memory request
Scheduling. On cgroup v2 nodes, the runtime may also use it as a hint to set memory.min and memory.low
Allowed while the node has memory free. If the node runs short, the pod is likely to be evicted
Memory limit
A memory ceiling the kernel enforces
The kernel may kill the container (an OOM kill) once it detects memory pressure

Only the request decides where a pod can run. Going past a CPU request costs nothing while the node has idle CPU. Memory limits are “enforced reactively”, in the documentation’s words: a container may pass its limit for a while, then be killed.

Write CPU below one core in millicpu: 100m is 0.1 CPU, and 1m is the finest Kubernetes accepts. Write memory with binary suffixes such as Mi and Gi. Case matters: a memory request of 400m is 0.4 bytes, and 400Mi is 400 mebibytes.

Why requests drive cost

Picture a Deployment of 20 replicas, each requesting 1 CPU and using 150m (0.15 CPU). Together they use 3 CPU but reserve 20 CPU of node capacity, and you pay for the nodes that provide it.

The scheduler places a pod on a node only while the requests there stay below the node’s capacity. It refuses the pod even when real use on that node is very low.

The Cluster Autoscaler counts requests too. It considers a node for removal only when its pods’ CPU and memory requests each sum to under 50% of allocatable capacity. That 50% is the default --scale-down-utilization-threshold.

When requests sit far above use across a cluster, that is Kubernetes overprovisioning. Right-sizing pods brings it back down.

Sizing from use frees 16.7 of the 20 requested CPU Three bars for one Deployment of 20 replicas on one shared CPU scale from 0 to 20. Requested today: 20 CPU, 20 times 1 CPU. Used: 3 CPU, 20 times 150m. Requested at P95 + 10%: 3.3 CPU, 20 times 165m, followed by an amber span from 3.3 to 20 CPU labelled 16.7 CPU free for other pods. Illustration. Sizing from use frees 16.7 of the 20 requested CPU Requested today20 CPU (20 × 1 CPU)Used3 CPU (20 × 150m)Requested at P95 + 10%3.3 CPU (20 × 165m)16.7 CPU free for other pods05101520CPU
Illustration: 20 replicas, each using 150m, with the request set at P95 plus 10%.

Read real use

kubectl top pod shows only the current reading, which Metrics Server serves to the HPA and the Vertical Pod Autoscaler (VPA). Sizing needs history that includes last Monday’s peak. Get it from a monitoring system such as Prometheus, scraping cAdvisor, the container-metrics daemon built into the kubelet.

Two series carry what you need. The rate of container_cpu_usage_seconds_total is cores in use. container_memory_working_set_bytes is the working set: an estimate of the memory in use that can’t be freed under pressure.

On Azure Kubernetes Service (AKS), the Azure Monitor metrics add-on scrapes cAdvisor by default and keeps both series, plus the throttling counters used below.

These queries return the highest CPU percentile and the memory peak across one Deployment’s pods:

max(
  quantile_over_time(0.95,
    rate(container_cpu_usage_seconds_total{
      namespace="<namespace>",
      pod=~"<deployment>-[a-z0-9]+-[a-z0-9]{5}",
      container="<container>"
    }[5m])[7d:5m]
  )
)

max(
  max_over_time(container_memory_working_set_bytes{
    namespace="<namespace>",
    pod=~"<deployment>-[a-z0-9]+-[a-z0-9]{5}",
    container="<container>"
  }[7d])
)

Match the window to the workload’s cycle: a week or more for a service that’s busy on weekdays, several runs for a batch job. A startup burst lifts a CPU percentile with every restart, so look at it separately.

The VPA can make these recommendations too. HPA vs VPA covers running it beside an HPA.

Pod right sizing, step by step

  1. Set the CPU request from a high percentile plus headroom, such as the 7-day P95 plus 10%. A CPU request below the peak can’t get a container killed: it borrows idle CPU at busy moments.
  2. Set the memory request from the peak of a window that includes the busiest day, plus headroom. A pod whose container uses more than its memory request is likely to be evicted when the node runs short of memory.
  3. Don’t reduce limits on the first pass. If a memory peak already sits close to the memory limit, raise the limit first: that container is one spike from an OOM kill.
  4. Check what caps requests in the namespace, its LimitRange and ResourceQuota, against the new request and the unchanged limit.
  5. Check the HPA, if the workload has one. It measures CPU use as a share of the request, so the same load reads higher against a smaller request. If any container in the pod has no CPU request, the HPA can’t act on CPU.
A smaller request makes the HPA add a pod Two bars for one pod using 300m of CPU, on one shared scale from 0 to 750m. Request 750m: a requested bar to 750m with a used bar inside it to 300m, which reads 40%. The dashed 50% target line sits at 375m, above the use, so the HPA keeps 4 replicas. Request 500m: a requested bar to 500m with the same used bar to 300m, which reads 60%. The dashed 50% target line sits at 250m, below the use, so the HPA asks for 5 replicas, drawn as 4 replicas plus one more. A smaller request makes the HPA add a pod Request 750m50% targetused 300m = 40%HPA keeps 4 replicasRequest 500m50% targetused 300m = 60%HPA asks for 5 replicas0250m500m750m
Each bar is one pod and each square a replica, at the moment the HPA decides.
  1. Apply through the Pod template, in your manifest or Git, and let the controller replace the pods. Or use in-place resize, stable since Kubernetes 1.35, through the pod’s /resize subresource. For the worked example, resources becomes:
resources:
  requests:
    cpu: 165m
    memory: <peak plus headroom>
  limits:
    cpu: <unchanged>
    memory: <unchanged>

CPU throttling

CPU throttling is the Linux kernel holding back a container that hits its CPU limit. The kernel enforces the limit as a quota of CPU time per period, and the default period is 100 ms.

A 500m limit allows 50 ms of CPU time in each 100 ms. Once that quota is spent, the container’s threads wait for the next period.

Multi-threaded services hit this first, because every thread draws on the same quota. Four busy threads on four cores spend the whole 50 ms quota in 12.5 ms of wall-clock time, then wait 87.5 ms.

A 5-minute CPU rate averages those bursts away. If one period in ten is busy like this, the rate reads 50m, a tenth of the limit, though every busy period was throttled.

Four busy threads use up a 50 ms quota in 12.5 ms One 100 ms period on a wall-clock axis from 0 to 100 ms, for a container with a CPU limit of 500m, which is 50 ms of CPU time per 100 ms period. Four lanes, thread 1 to thread 4, each run from 0 to 12.5 ms and are throttled from 12.5 to 100 ms. A bracket over 0 to 12.5 ms reads 50 ms quota spent, 4 times 12.5 ms. A bracket over 12.5 to 100 ms reads throttled 87.5 ms. A line at 100 ms reads next period, quota refills. Four busy threads use up a 50 ms quota in 12.5 ms CPU limit 500m = 50 ms of CPU time per 100 ms period50 ms quota spent(4 × 12.5 ms)throttled 87.5 msthread 1thread 2thread 3thread 4next period:quota refills012.5100ms
Illustration: one busy 100 ms period for a container with a 500m CPU limit and four threads on four cores.

The kernel counts elapsed and throttled periods for each container. cAdvisor exposes them as container_cpu_cfs_periods_total and container_cpu_cfs_throttled_periods_total. Their ratio is the share of periods in which the container hit its limit. Watch it after any change to a CPU limit:

rate(container_cpu_cfs_throttled_periods_total{
  namespace="<namespace>", container="<container>"
}[5m])
/
rate(container_cpu_cfs_periods_total{
  namespace="<namespace>", container="<container>"
}[5m])

When a throttled service is also slow, look at its limit first. A bigger request reserves more of a node but leaves the ceiling where it was.

A higher CPU limit, or none, lets the container use idle CPU when it bursts, at the cost of CPU its neighbours might want. When you right-size, change requests, and leave CPU limits for a separate change.

Rollback rules

Set these before you change anything:

  • Change one workload at a time. Sizing a whole namespace at once hides which workload caused the trouble.
  • Decide what makes you revert before the change: OOMKilled restarts, failing probes, slower responses at busy times, or a jump in HPA replicas.
  • Make each change its own commit in Git, so a rollback is a revert and an ordinary rollout.

Afterwards, kubectl describe pod <pod> shows an OOM kill as Reason OOMKilled, with a rising Restart Count (what to do after an OOM kill). Watch a full cycle of the workload, a week for most services, before you change it again.

Where Coral fits

Coral is Zoorik’s Kubernetes cost optimization for AKS and Amazon Elastic Kubernetes Service (EKS). It rebalances each container’s CPU and memory requests from real use, on a policy you choose, without any downtime.

  • Sizing. CPU comes from a high percentile of recent use and memory from the recent peak, each plus headroom.
  • The HPA keeps scaling. The HPA decides how many pods run, and Coral decides how big each pod is. For a CPU-based HPA, Coral replays past load through that HPA’s own settings before it picks the request. A smaller request wins only if its saving beats the cost of unserved load and extra scaling.
  • Limits stay or rise. On the built-in policies, Coral never reduces the CPU or memory limit of a regular (non-Guaranteed) pod, and never leaves a limit below its request. A custom policy can set limits its own way.
  • How a change lands. Coral only recommends until you switch on “Automatically optimize” for a policy or a workload. Your manifest never changes. Coral sets new requests as pods start. It resizes running pods in place on 1.33+ nodes, or else restarts them one at a time within their PodDisruptionBudgets.
  • Guardrails. Early reductions come in small steps while data builds up. Every change stays within your minimums, LimitRanges and quotas.
  • Going back up. A usage surge or an OOM kill raises the request within minutes.

On our own AKS development cluster, Coral had rebalanced the requests of 14 apps by 12 October 2026. The CPU they reserve fell 45%, from 0.78 to 0.43 cores, and memory 16%, from 6.4 to 5.4 GiB. The Coral Value Lab study has the full run.

Kubernetes optimization with Coral Estimate your saving

Find your own number

One command in your terminal. One PDF report with your estimated saving at list price.

Estimate your saving
Talk to the builders

Thirty minutes with the people who build Coral.

Book a demo (opens in a new tab)

Or write to founders@zoorik.com