Requests and limits are resource settings for each container in a Kubernetes pod. A request is the amount of CPU or memory the scheduler reserves for the container on a node. A limit is the maximum the container may consume: exceeding the CPU limit leads to throttling, exceeding the memory limit leads to the container being terminated with OOMKilled. Together they determine scheduling, the pod's QoS class and how efficiently cluster capacity is used.
What are requests and limits?
Every container in a Kubernetes pod can declare resource requests and resource limits for CPU and memory. CPU is specified in cores or millicores (500m is half a core), memory in bytes with suffixes such as Mi or Gi. The two values have different purposes:
- The request is a reservation. The scheduler places a pod only on a node whose allocatable capacity still covers the sum of the requests of all pods on it. Actual usage does not matter for this decision.
- The limit is a ceiling enforced at runtime by the kubelet and the Linux kernel through cgroups.
resources:
requests:
cpu: "250m"
memory: "256Mi"
limits:
cpu: "1"
memory: "512Mi"
If only a limit is set and no request, Kubernetes uses the limit as the request. The values in the example are illustrations, not recommendations.
CPU and memory behave differently
CPU is a compressible resource. When a container reaches its CPU limit, it is not stopped but slowed down: the Linux CFS bandwidth control gives it a quota per scheduling period (100 ms by default) and pauses it once the quota is used up. This CPU throttling can cause noticeable latency even when average CPU usage looks low, because short bursts hit the quota. cAdvisor exposes it as container_cpu_cfs_throttled_periods_total relative to container_cpu_cfs_periods_total.
Memory is not compressible. If a container tries to use more than its memory limit, the kernel's OOM killer terminates a process in it, and Kubernetes reports the container as OOMKilled with exit code 137. That is an OOM kill. Memory requests matter as well: when a node runs low on memory, the kubelet evicts pods, and pods using more than their request are among the first candidates.
QoS classes
From requests and limits Kubernetes derives a Quality of Service class for each pod, which influences eviction order under node pressure:
| QoS class | Condition | Behaviour under pressure |
|---|---|---|
| Guaranteed | Every container has CPU and memory requests and limits, and requests equal limits | Evicted last |
| Burstable | At least one container has a CPU or memory request or limit, but the pod is not Guaranteed | Evicted after BestEffort, roughly by usage above request |
| BestEffort | No container has any request or limit | Evicted first |
Common mistakes
- No requests at all: pods become BestEffort, the scheduler packs nodes blindly and one busy workload can starve others, the classic noisy neighbor.
- Requests far above real usage: nodes look full to the scheduler while they are mostly idle. The cluster autoscaler adds nodes that nobody needs.
- Tight CPU limits on latency sensitive services: throttling increases response times. Many teams therefore set CPU requests but use CPU limits carefully, while always setting memory limits.
- Memory limits below the real peak: the result is recurring OOM kills, often only under load or for JVM and other runtimes whose heap settings do not match the limit.
Rightsizing and cost
Because the scheduler reserves capacity based on requests, the requests, not actual usage, determine how many nodes a cluster needs. The gap between requested and used resources is paid for but idle. Rightsizing compares requests with observed usage over a representative period, for example a high percentile of CPU and the peak of memory, and adjusts them. The Vertical Pod Autoscaler can produce such recommendations, and in-place resizing of pod resources has been available as a beta feature since Kubernetes 1.33. Rightsizing is a core lever of FinOps and of capacity planning; our article on FinOps for Kubernetes covers the process step by step.
LimitRange and ResourceQuota
Platform teams enforce sensible values per namespace with two objects. A LimitRange sets default requests and limits for containers that declare none, as well as minimum and maximum values. A ResourceQuota caps the total of requests and limits in a namespace, for example requests.cpu or limits.memory. If a quota covers CPU or memory, every new pod must specify those values, or receive them as defaults from a LimitRange, otherwise it is rejected.
How Obseria helps
Obseria's Kubernetes monitoring collects requests, limits and real usage per container through the OpenTelemetry Collector and kube-state-metrics, and shows throttling, OOM kills and evictions next to traces and logs of the affected service. Cloud cost management highlights workloads whose requests are far above their usage, and Obseria Intelligence helps link latency regressions to throttling or a changed limit after a deployment.