Best practices for CPU limits and requests on Kubernetes
Lets summarize:
- Use CPU requests for everything
- Make sure they are accurate
- Do not use CPU limits.
Tim Hockin (one of the original Kubernetes maintainers at Google) has recommended the same for years.
What about memory limits and requests?
Everything in this post is about CPU and not memory. Memory is different because it is non-compressible – once you give memory you can’t take it away without killing the process. We’ve covered the best practices for Kubernetes memory limits here. In short, our bottom line recommendation is:
- Always use memory limits
- Always use memory requests
- Always set your memory requests equal to your limitsS
See the full post on Kubernetes memory requests and limits.
Other reasons why CPU throttling can occur on Kubernetes
This post focused on K8s CPU limits, but there are other reasons why CPU throttling can happen. That’s why we wrote an open source observability engine – to show you why each Prometheus alert fires.
Bạn có thể đọc tất cả ở đây:
https://home.robusta.dev/blog/stop-using-cpu-limits