<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/setting-the-right-requests-and-limits-in-kubernetes-6kve74w3p" -->

---
title: Setting the right requests and limits in Kubernetes
description: A deep technical walkthrough traces how Kubernetes CPU and memory requests and limits are enforced at each stage: scheduling (comparing requests to node...
canonical: https://daily.dev/posts/setting-the-right-requests-and-limits-in-kubernetes-6kve74w3p
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Setting the right requests and limits in Kubernetes | daily.dev
og:description: A deep technical walkthrough traces how Kubernetes CPU and memory requests and limits are enforced at each stage: scheduling (comparing requests to node...
og:url: https://daily.dev/posts/setting-the-right-requests-and-limits-in-kubernetes-6kve74w3p
og:image: https://api.daily.dev/og/posts/6KVE74w3P.png
og:image:alt: Setting the right requests and limits in Kubernetes
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Setting the right requests and limits in Kubernetes

**[LearnKube](https://daily.dev/sources/learnkube)** · 27 min read · 0 upvotes · 0 comments

## Summary

A deep technical walkthrough traces how Kubernetes CPU and memory requests and limits are enforced at each stage: scheduling (comparing requests to node allocatable capacity), cgroup translation (CPU requests become cpu.weight, CPU limits become cpu.max quotas via CFS bandwidth control, memory limits become memory.max), node-pressure eviction, and OOM scoring via oom_score_adj. It uses hands-on kubectl and Docker experiments to show that requests don't physically reserve resources but affect scheduling and fair-share weighting, that CPU limits cause throttling even with idle CPU (citing Numerator Engineering's NGINX experiment showing throughput drop from 1,221 rps on a 2-vCPU node to 455 rps on a 96-vCPU node with the same 100m limit), and how QoS classes (Guaranteed, Burstable, BestEffort) derive from these settings and affect eviction order and OOM likelihood. It closes by explaining the CPU Manager static policy for exclusive CPU pinning.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://learnkube.com/setting-cpu-memory-limits-requests>

## Questions this post answers

### Why does my Kubernetes pod get throttled even though the node has idle CPU?

CPU limits are enforced through CFS bandwidth control, which gives a cgroup a fixed quota per 100ms period regardless of idle capacity elsewhere. A pod with a 100m CPU limit gets only 10ms of CPU time per 100ms period; once workers across multiple cores exhaust that shared 10ms budget, the entire cgroup is throttled until the next period, even with idle CPUs on the node.

_Track cgroup throttling behavior like this on daily.dev before tuning Kubernetes CPU limits in production._

### Why did NGINX get slower after moving from a 2-vCPU node to a 96-vCPU node with the same CPU limit?

Throughput dropped to 37% (from 1,221 rps to 455 rps) because NGINX's worker_processes auto setting spawns more workers on nodes with more visible CPUs, but all workers still draw from the same fixed CPU quota (10ms per 100ms period for a 100m limit). More parallel workers burn through that shared budget faster, causing more frequent throttling and much worse tail latency, as demonstrated by Numerator Engineering with an unmodified NGINX image.

_Compare CPU limit behavior across node sizes on daily.dev before scaling Kubernetes nodes with fixed CPU limits._

### How does Kubernetes decide which pods to evict when a node runs low on memory?

The kubelet evicts pods based on three factors: whether usage exceeds requests, pod priority, and usage relative to requests. A pod using less memory than requested is protected ahead of one exceeding its request, and pods with unrealistically low memory requests cross the eviction threshold sooner; oom_score_adj (Guaranteed=-997, BestEffort=1000, Burstable calculated from request-to-capacity ratio) also biases the kernel's separate OOM killer.

_Reference eviction ranking factors on daily.dev when setting memory requests for pods under contention._

## Similar posts on daily.dev

- [Kubernetes Requests and Limits: How to Right-Size Pods Without Breaking Reliability](https://daily.dev/posts/kubernetes-requests-and-limits-how-to-right-size-pods-without-breaking-reliability-2idykp32g) · Cast AI · 0 upvotes · 0 comments
- [Java JVM CPU and Memory Requests and Limits in Kubernetes](https://daily.dev/posts/java-jvm-cpu-and-memory-requests-and-limits-in-kubernetes-9pj5al4jr) · LearnKube · 3 upvotes · 0 comments

---

Tags: [#linux](https://daily.dev/tags/linux), [#kubernetes](https://daily.dev/tags/kubernetes), [#docker](https://daily.dev/tags/docker)

[View this post on daily.dev](https://daily.dev/posts/setting-the-right-requests-and-limits-in-kubernetes-6kve74w3p)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Setting the right requests and limits in Kubernetes","url":"https://daily.dev/posts/setting-the-right-requests-and-limits-in-kubernetes-6kve74w3p","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/setting-the-right-requests-and-limits-in-kubernetes-6kve74w3p"},"datePublished":"2026-08-31T11:20:04.518Z","dateModified":"2026-08-31T11:20:32.403Z","description":"A deep technical walkthrough traces how Kubernetes CPU and memory requests and limits are enforced at each stage: scheduling (comparing requests to node...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bc0edbdf080d72e2a229cb5bbb879608?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bc0edbdf080d72e2a229cb5bbb879608?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"LearnKube","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"LearnKube","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/90786df1b5d44abb91a090a0b6c81517","url":"https://daily.dev/sources/learnkube"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/setting-the-right-requests-and-limits-in-kubernetes-6kve74w3p","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"linux,kubernetes,docker","timeRequired":"PT27M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"LearnKube","item":"https://daily.dev/sources/learnkube"},{"@type":"ListItem","position":3,"name":"Setting the right requests and limits in Kubernetes"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/setting-the-right-requests-and-limits-in-kubernetes-6kve74w3p#faq","mainEntity":[{"@type":"Question","name":"Why does my Kubernetes pod get throttled even though the node has idle CPU?","acceptedAnswer":{"@type":"Answer","text":"CPU limits are enforced through CFS bandwidth control, which gives a cgroup a fixed quota per 100ms period regardless of idle capacity elsewhere. A pod with a 100m CPU limit gets only 10ms of CPU time per 100ms period; once workers across multiple cores exhaust that shared 10ms budget, the entire cgroup is throttled until the next period, even with idle CPUs on the node. Track cgroup throttling behavior like this on daily.dev before tuning Kubernetes CPU limits in production."}},{"@type":"Question","name":"Why did NGINX get slower after moving from a 2-vCPU node to a 96-vCPU node with the same CPU limit?","acceptedAnswer":{"@type":"Answer","text":"Throughput dropped to 37% (from 1,221 rps to 455 rps) because NGINX's worker_processes auto setting spawns more workers on nodes with more visible CPUs, but all workers still draw from the same fixed CPU quota (10ms per 100ms period for a 100m limit). More parallel workers burn through that shared budget faster, causing more frequent throttling and much worse tail latency, as demonstrated by Numerator Engineering with an unmodified NGINX image. Compare CPU limit behavior across node sizes on daily.dev before scaling Kubernetes nodes with fixed CPU limits."}},{"@type":"Question","name":"How does Kubernetes decide which pods to evict when a node runs low on memory?","acceptedAnswer":{"@type":"Answer","text":"The kubelet evicts pods based on three factors: whether usage exceeds requests, pod priority, and usage relative to requests. A pod using less memory than requested is protected ahead of one exceeding its request, and pods with unrealistically low memory requests cross the eviction threshold sooner; oom_score_adj (Guaranteed=-997, BestEffort=1000, Burstable calculated from request-to-capacity ratio) also biases the kernel's separate OOM killer. Reference eviction ranking factors on daily.dev when setting memory requests for pods under contention."}}]}
```

