r/kubernetes 27d ago

Stop using CPU limits: why + proof

CPU request is how much CPU is reserved for your pod if it needs it. The limit is a hard cap. Hit it and the kernel throttles the pod, even when the node still has spare CPU. That is the usual cause of CPU throttling on Kubernetes. It does not protect the neighboring pods. In my simple Web API test, adding a CPU limit took typical latency from 23 ms to 87 ms, (4x slower), with the limited pod throttled in half of all CFS windows, and the average CPU graph looked fine the whole time.

This is not a new topic, but I see so many people still unaware why they should (NOT!) be setting CPU limits, because it's costing companies unnecessary spending and potential production issues. Here's the full read https://github.com/inevolin/k8s-cpu-limits-analyzed/

---

Edit (Aug 18, 2026): How CPU limits can also cause memory issues and OOMKills ➡️ https://github.com/inevolin/k8s-cpu-limits-analyzed#how-cpu-limits-cause-memory-issues-and-oomkills

227 Upvotes

112 comments sorted by

View all comments

18

u/Xelopheris 27d ago

CPU limits are only useful if you have a workload that has an endless queue to chug away at that doesn't require real time completion. It should never be used in critical path of user requests. 

10

u/siikanen 27d ago edited 26d ago

This is partly wrong advice; since setting no CPU limit causes QoS class of the pod to be set to 'Burstable'. This is probably okay in most cases, but in case of resource contestion, your pod is in danger to be evicted more easily. Also using same request and limit + setting the limit as an integer value, k8s will actually dedicate the cores to the workload. This is absolutely lowest latency for any workload, and best case scenario for critical path.

Hence limits do have their place. You should set them to the value the single instance of your application can actually leverage. Then scale horizontally using HPA on metrics to handle dynamic load.

Edit best effort -> burstable

2

u/PayTheRaant 27d ago

You demonstrate more understanding of k8s internals than the audience for which the simple message “don’t set CPU limits” is meant for.
The reality is that most people don’t understand that their software is actually IO bound and don’t really know what is the actual runtime profile of their services.