Kubernetes Resource Requests and Limits: CPU, Memory, QoS and OOMKilled

How requests and limits work for CPU and memory, scheduling, CPU throttling, OOMKilled, QoS classes, and how to right-size containers.

Published December 2, 2026

Every container on Kubernetes can declare how much CPU and memory it needs (requests) and the most it may use (limits). These two numbers decide where pods are scheduled, whether they get throttled, whether they get killed, and how efficiently your cluster is packed. Getting them wrong is behind a large share of Kubernetes performance problems and wasted cloud spend.

The concept

Requests are used for scheduling: a pod is placed only on a node with enough unreserved CPU and memory to cover its requests. They also determine fair sharing of CPU under contention. Limits are enforced at runtime: a container using more CPU than its limit is throttled (slowed down), while a container exceeding its memory limit is killed with OOMKilled because memory cannot be throttled.

Requests and limits together determine the pod's QoS class. Guaranteed (requests equal limits for all resources) pods are the last to be evicted under node pressure; Burstable pods sit in the middle; BestEffort pods (no requests or limits) are evicted first. A common practice is to set memory request equal to memory limit and to set CPU requests but be cautious with CPU limits, which can cause latency through throttling.

CPU vs memory behaviour

CPUMemory
RequestScheduling + share under contentionScheduling + eviction ranking
Limit exceededThrottled (slower)OOMKilled (restarted)
Unit examples500m = half a core512Mi, 2Gi
Common practiceSet request; limit cautiouslyRequest = limit

QoS classes

QoS classConditionEviction priority
Guaranteedrequests == limits for CPU and memoryEvicted last
BurstableSome requests/limits setMiddle
BestEffortNo requests or limitsEvicted first

Right-sizing matters

Requested8 cores requestedActually used (p95)2.5 cores used
A typical over-provisioned service: requests far above real usage waste capacity.

Practical examples

A balanced configuration

Memory request equals limit; CPU request with no hard limit.

resources:
  requests:
    cpu: 250m
    memory: 512Mi
  limits:
    memory: 512Mi

Find OOMKilled containers

Check last termination reason and current usage.

kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}/{.metadata.name}{"\t"}{.status.containerStatuses[*].lastState.terminated.reason}{"\n"}{end}' | grep OOMKilled
kubectl top pods -n shop --containers

Default requests for a namespace

A LimitRange applies defaults to containers that omit them.

apiVersion: v1
kind: LimitRange
metadata: { name: defaults, namespace: shop }
spec:
  limits:
    - type: Container
      defaultRequest: { cpu: 100m, memory: 256Mi }
      default: { memory: 256Mi }

Common mistakes

  • No requests at all, letting the scheduler overpack nodes.
  • Memory limits below real peak usage, causing OOMKilled restarts under load.
  • Tight CPU limits on latency-sensitive services, causing throttling.
  • Guessing values once and never revisiting them with real metrics.

Key takeaways

  • Requests drive scheduling; limits are enforced at runtime.
  • CPU over limit → throttled; memory over limit → OOMKilled.
  • QoS classes decide eviction order.
  • Right-size from observed usage (VPA recommendations, metrics).

FAQ

Should I set CPU limits?

It is debated. Many teams set CPU requests only, to avoid throttling, and rely on requests for fairness; set limits where you need strict isolation.

What does 1 CPU mean?

One vCPU/core of time. 100m is one-tenth of a core.

How do I get sizing recommendations?

The Vertical Pod Autoscaler in recommendation mode, or monitoring p95 usage over a representative period.

More DevOps articles