- Request — the resource amount the pod asks the scheduler to reserve for placement.
- Limit — the maximum resource a container is allowed to consume at runtime.
- kube-scheduler — places pods onto nodes based on requests.
- kubelet & cgroups — enforce limits and report OOM or throttling events.
Requests
A request is the amount of CPU or memory a pod declares so the scheduler can reserve capacity on a node. For example, a pod needing 500Mi memory should setrequests.memory: "500Mi". The scheduler sums requests of already scheduled pods and the new pod, then chooses a node that has the available capacity.
Scheduling is strictly based on requests — not limits. If your cluster has fixed node resources (for example, a node with 24Gi RAM), many requests can exhaust available node capacity. Without cluster autoscaling, exhausted capacity leads to unschedulable pods and degraded services.

Limits
A limit is the maximum a container can consume at runtime.- Memory: If a container exceeds its memory limit, the kernel will usually terminate the process (reported as
OOMKilled). Memory limits are enforced by cgroups and managed by the kubelet. - CPU: If a CPU limit is set, Linux CFS quota mechanisms throttle the container when it tries to use more than the allowed CPU. If no CPU limit is set, the container can use spare CPU cycles on the node when available (subject to contention and QoS).

How requests and limits work together
- Scheduler uses requests to select a node that has enough available capacity.
- kubelet (via cgroups) enforces limits at runtime.
- Memory limit violation → container is typically OOMKilled.
- CPU limit violation → container is throttled (not killed).
ResourceQuota and namespace-level controls
AResourceQuota restricts aggregate resource consumption across all pods in a namespace. It counts the sum of requests and/or limits across the namespace.
Example: the following manifests create a test namespace and a ResourceQuota that caps total requested memory to 512Mi and total memory limits to 1000Mi for that namespace.
Example container resource configuration
Below is a container spec fragment (part of a Pod or Deployment) showing per-container requests and limits. Use this to control scheduling and runtime behavior.- The scheduler accounts for
64Mimemory and250mCPU when placing the pod. - At runtime the container may consume up to
128Mimemory; exceeding this will likely cause anOOMKilledevent. - No CPU
limitsare specified, so Kubernetes will not install a CPU quota for this container; it may use spare CPU cycles if available but is not guaranteed guaranteed throughput beyond therequests.
CPU vs memory: differences and behavior
The two resources behave differently in practice:
QoS classes (Guaranteed, Burstable, BestEffort)
QoS is derived from how you set requests and limits for containers in a Pod. It influences eviction order and scheduling behavior under resource pressure.Best practices
- Always set
requestsfor both CPU and memory so the scheduler can make accurate placement decisions. - Set memory
limitsto protect nodes from runaway containers (memory leaks) that can destabilize a node. - Consider
limits.cpucarefully: setting CPU limits prevents bursting but can cause throttling. If you want burstable CPU behavior, rely onrequestsand omit CPUlimitsfor those workloads. - Use
ResourceQuotato control aggregate resource consumption in a namespace and prevent noisy neighbors. - Measure and iterate: start with conservative
requestsandlimits, monitor (Prometheus, metrics-server, or cloud metrics), then tune based on actual usage and SLOs.
Do not rely solely on heuristics. Omitted memory limits can allow a container to consume node memory leading to node instability. Conversely, overly-tight CPU limits can cause excessive throttling and poor performance. Monitor and test under realistic load.
Links and references
- Kubernetes scheduling and resource management: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
- ResourceQuota docs: https://kubernetes.io/docs/concepts/policy/resource-quotas/
- QoS classes: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#quality-of-service
Monitoring and tuning
Use real-world telemetry (CPU/memory usage, throttling metrics, OOM events) from tools like Prometheus, metrics-server, or cloud provider monitoring to tunerequests and limits. Iterate based on latency, throughput, and SLOs rather than static guesses.