# Requests, limits and QoS classes: what the scheduler books and the kernel enforces

> The scheduler reads requests; the kernel enforces limits. Why CPU limits throttle even on an idle node, why memory limits kill, which QoS class your numbers produce, and how to choose them.

- Canonical: https://www.alpacamango.com/docs/kubernetes-requests-and-limits
- Author: Commander Vanta
- Published: 2026-11-26 · Updated: 2026-11-20
- Topics: Kubernetes

**A request is a reservation the scheduler books; a limit is a ceiling the kernel enforces. Set CPU and memory requests on every container, because they decide where Pods land and who survives when a node runs short. Set a memory limit, at or close to the request. Think twice about a CPU limit: going over a memory limit gets a container killed, but a CPU limit slows it down even on an idle node.**

## Who reads which number

The two fields look like a pair, but different parts of Kubernetes read them at different times. (If the scheduler and the kubelet are unfamiliar, [Kubernetes architecture, one component at a time](/docs/kubernetes-architecture-explained) introduces them.)

- **The scheduler reads requests, and only requests.** It adds up the requests of the Pods already on each node and places the new Pod where its own requests still fit. It does not look at what the containers are actually using.
- **The kubelet and the kernel read limits.** The kubelet turns them into cgroup settings, and the Linux kernel enforces them while the container runs.
- **Requests are not caps.** A container may use more than it asked for whenever the node has room to spare. It is borrowing, and it is the first to be asked to give it back.

So a container with no requests is, to the scheduler, free. Ten of them fit on any node, which is how a cluster ends up with a node at full memory and a dashboard saying it is barely booked.

## CPU limits throttle, memory limits kill

The two resources fail in different ways, and that difference should drive the decision.

**CPU can be taken back.** A CPU limit is enforced as a quota of CPU time per short period, a tenth of a second by default. A process with four busy threads and a limit of one CPU spends its whole quota in about a quarter of each period, then waits for the rest of it, whether or not the node is idle. The result is not an error but latency: slow requests, slow health checks, and sometimes a [liveness probe](/docs/kubernetes-probes) that times out and restarts a container that was merely throttled.

**Memory cannot be taken back.** Memory in use cannot be squeezed, so when a container goes over its memory limit and the kernel acts, it ends the process: an OOM kill, reason `OOMKilled`, and a restart. Without a memory limit the container can grow until the node itself runs short, and then the kubelet evicts Pods, beginning with those using more than they requested.

That is the argument for the usual advice. A memory limit protects the node from one leaking container. A CPU limit protects other tenants from a busy container, but the CPU request already does most of that: when the node is contended, CPU time is shared in proportion to requests. Many teams therefore set a CPU request and no CPU limit on latency-sensitive services. Keep the limit where you need hard isolation, or where a ResourceQuota on `limits.cpu` makes every new Pod declare one (a LimitRange can supply the default).

```yaml
resources:
  requests:
    cpu: 250m        # what the scheduler books
    memory: 512Mi
  limits:
    memory: 512Mi    # equal to the request: no borrowing, no surprise
    # no cpu limit: use spare CPU, share by request under contention
```

## The QoS class follows from the numbers

You do not choose a Pod's quality-of-service class; Kubernetes derives it from what you wrote, and it decides who goes first when a node is short of memory.

- **Guaranteed:** every container has CPU and memory requests and limits, and each request equals its limit. Last to be evicted.
- **Burstable:** some requests or limits, but not the Guaranteed pattern. The example above is Burstable, because it has no CPU limit.
- **BestEffort:** no CPU or memory requests or limits at all. First to go.

One trap is worth knowing. If you set a limit and leave out the request, Kubernetes copies the limit into the request. A container with only limits is therefore booked at its full ceiling, and a Pod whose every container sets only CPU and memory limits is Guaranteed. That is safe, but it can quietly fill a cluster with reservations nobody meant to make.

```bash
kubectl get pod web -o jsonpath='{.status.qosClass}'
```

## Choosing the numbers

Base requests on what the container really uses at a normal peak, from your metrics, rather than on a guess. Set the memory limit just above the highest working set you have seen. Since Kubernetes 1.35, resizing a running Pod's requests and limits in place is stable, so correcting a bad guess no longer has to mean replacing the Pod. Practise all of this on a real cluster with the "Resources, QoS and priority" lab in the [scheduling module of Gazeek's CKA course](https://gazeek.com/courses/cka?utm_source=alpacamango#module-04-scheduling).

## The diagram

The picture shows the scheduler booking a node by requests, then the kernel enforcing limits on the node: CPU throttled, memory killed, and the three QoS classes in eviction order. [Open it in archhy](https://archhy.com/d/rJLbPKEreMBi?utm_source=alpacamango) and press Make a copy to adapt it.
