Capacity Management for Teams on Kubernetes: Setting Pod CPU and Memory Limits

Capacity Management for Teams on Kubernetes: Setting Pod CPU and Memory Limits

Capacity management is a complex, ever-moving target, for teams on any infrastructure, whether on-prem, cloud-native, or hybrid cloud.

Capacity management is a complex, ever-moving target, for teams on any infrastructure, whether on-prem, cloud-native, or hybrid cloud.

It can be especially difficult for teams running Kubernetes clusters. In this post, you can learn how to get started right by starting small and focusing on step 3 from the Magalix Ultimate Guide to Capacity Management eBook: setting pods’ CPU limits.

Setting The Right Pod CPU Limits: Some Heuristics

When setting CPU limits in your pods, it’s important to use the right statistics to properly budget your resources.

For example, a common method of budgeting is using the average utilization of the CPU, which doesn’t work. Using the maximum or percentiles without considering metric resolution causes a lot of resource churn.

Setting the proper CPU limits makes your system predictable and performant. Not setting limits allows CPU-hungry containers to slow down all other containers on the same worker node.

On the other hand, setting low CPU limit values can degrade the performance of your applications. Setting a low value for the pod’s CPU limit exposes your apps to throttling, which can lead to significant performance issues. If you’re running infrastructure for a mobile game, a slow gaming experience can be a huge burden for user acquisition and engagement. For things like healthcare or finance, it can be a death sentence for your business, and can be even worse for your end-users (patients and clients).

At This Point, Let’s Stop and Review Pod CPU Limit Recommendations:

  • If you frequently update your pods’ CPU resources, use the 95th percentile of 1-minute resolution as a guideline to set the CPU limit of your pods.
  • Keep an eye out for CPU throttling and see if it goes up with your CPU utilization. You may need to use a higher resolution metric, i.e. 10-second data points, to set the right CPU limit value for pods.
  • If you frequently update your pods’ CPU resources, use the 95th percentile of 1-minute resolution as a guideline to set the CPU limit of your pods.
  • Keep an eye out for CPU throttling and see if it goes up with your CPU utilization. You may need to use a higher resolution metric, i.e. 10-second data points, to set the right CPU limit value for pods.

kubernetes capacity management

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

50+ Useful Kubernetes Tools for 2020 - Part 2

Our original Kubernetes tool list was so popular that we've curated another great list of tools to help you improve your functionality with the platform.

How to use Terraform and Kubernetes to manage the IT worlds

Get Hands-on experience on Kubernetes and the best comparison of Kubernetes over the DevOps at your place at Kubernetes training

Kubernetes in the Cloud: Strategies for Effective Multi Cloud Implementations

This article explains how you can leverage Kubernetes to reduce multi cloud complexities and improve stability, scalability, and velocity.

Kubernetes vs Docker

Get Hands-on experience on Kubernetes and the best comparison of Kubernetes over the DevOps at your place at Kubernetes training

Typical flow for deploying applications to Kubernetes

Get Hands-on experience on Kubernetes and the best comparison of Kubernetes over the DevOps at your place at Kubernetes training