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

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:
| Setting | What Kubernetes uses it for | When 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.
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
- 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.
- 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.
- 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.
- Check what caps requests in the namespace, its LimitRange and ResourceQuota, against the new request and the unchanged limit.
- 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.
- 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
/resizesubresource. For the worked example,resourcesbecomes:
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.
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.
Sources: Kubernetes, “Resource Management for Pods and Containers” (opens in a new tab); Kubernetes, “Resize CPU and Memory Resources assigned to Containers” (opens in a new tab); Kubernetes, “Resource metrics pipeline” (opens in a new tab); Kubernetes, “Horizontal Pod Autoscaling” (opens in a new tab); Kubernetes autoscaler, “Cluster Autoscaler FAQ” (opens in a new tab); The Linux Kernel documentation, “CFS Bandwidth Control” (opens in a new tab); Microsoft Learn, “Default Prometheus metrics configuration in Azure Monitor” (opens in a new tab); Kubernetes perf-tests, “clusterloader2/testing/load/modules” (opens in a new tab) (the ContainerCPU and ContainerMemory queries in measurements.yaml).