Automatically Optimize Containers CPU And Memory

Optimize resources, reduce waste, and maximize the value of your Kubernetes cluster

Recommendations to improve utilization address the over or under allocation of resources inside your cluster. It analyzes the usage of CPU and memory, builds a prediction model, and suggests changes to containers CPU/memory limits and requests. The goal is to make sure that containers get optimized resource allocation without impacting their performance or the stability of your cluster.

Step 1 - Understand The Recommendation Anatomy

You will see recommendations suggesting adjustments to resources under the Utilization category. Those recommendations are separated by resource type. For example, if you need to adjust both the CPU and memory allocation of a container, you will find two separate recommendations.

Memory Utilization Recommendation

A recommendation will tell you the required action and all relevant context around it. 

Required Action

CPU throttling issues impacting your containers require you to adjust the CPU requests and limits. The required action will be quantified to just the right values that your container needs to avoid the starvation of your containers.

Learn more about Kubernetes resources management here.

Expected Impact

This section tells how much performance improvement you will get out of this recommendation. The higher the value the more heavily your container is being throttled.

What's Wrong

This section explains what Magalix agent was able to observe about the container's CPU consumption vs currently allocated to that container. It provides an explainer to the collected evidence.

Collected Evidence

This section shows the CPU consumption and CPU throttling metrics side by side. For example, in the above snapshot, the container was using around 200 millicores and it was throttled on average 20 times/second.

How To Resolve The Issue

Resources issues at container level are usually fixed by manually adjusting the requests and limits of CPU. In this particular type of recommendation, you can either adjust the values manually in your container's spec file or enable the autopilot. Magalix agent will adjust them automatically for you.


Resources To Learn More

If you would like to learn more about resource allocation inside Kubernetes and how to manage them, you will find this section handy. We are linking to official Kubernetes documentation and also our more detailed explainer articles. 

Let Magalix help you implement best practices for Kubernetes and cloud-native, with your team. explore what you can do with Magalix Console.

Connect Your First Cluster

Step 2 - Run On Autopilot

Magalix can automate resources optimization for you with very high frequency. Enabling the autopilot will allow the Magalix agent to execute those recommendations for you on an hourly basis.


Controlling the Autopilot at the Container Level

You can enable or disable the autopilot at the container level. You can also set the autopilot at the namespace level. In this case, all containers/pods running under that namespace will have Autopilot enabled. But you can turn it off for some containers if needed.

  • ON means that it is always on regardless of the namespace-level value.
  • OFF means that the Autopilot is always off, regardless of the namespace-level value.
  • Auto means that the Autopilot is on or off depending on the namespace-level value.