Grafana Cloud Monitor infrastructure Kubernetes Monitoring Optimize resource usage and efficiency
Grafana Cloud

Optimize resource usage and efficiency

Kubernetes resources that are not optimized can significantly impact both budget and performance:

  • An underprovisioned Kubernetes infrastructure leads to lagging, underperforming, unstable, or non-functioning applications.
  • An overprovisioned infrastructure becomes costly.

To manage CPU, RAM, and storage, and mitigate the threat of an unstable infrastructure, you must:

  • Ensure that there are enough allocated resources. This decreases the risk of Pod or container eviction as well as undesired performance of your microservices and applications.
  • Eliminate unused or stranded resources.

Discover resource usage

Use color coding to learn how resources are being used throughout the views:

  • Green means your resource usage is in balance and right-sized. Resource utilization is between 60% and 90%.
  • Yellow means overprovisioning. Resource utilization is below 60%, indicating these are resources that you don’t use but still pay for.
  • Red means underprovisioning. Resource utilization is over 90%, signaling possible performance issues.

Use the Efficiency view

The Efficiency view provides a correlation between CPU, memory, and storage use for cClusters, Nodes, and namespaces. The list of Clusters indicates each Cluster’s resource usage. You can use this data to:

  • Analyze performance and troubleshoot stability issues by comparing average and maximum resource usage.
  • Observe resource usage per Cluster and per cloud provider.
  • Discover stranded resources in your fleet.

Efficiency view

What is calculated

We use the following to determine how unused resources, stranded resources, and resource limits are calculated:

  • Unused resources: The average percentage of CPU, RAM, and storage that remain untouched for a certain period. When we calculate unused resources momentary peaks in resource usage are not included because they can be above what’s expected at certain times. Instead, we use resource limits set in your Kubernetes environment per best practices.

  • Stranded resources: Resources that become unusable due to bad Pod placement. When too many CPU-intensive Pods are placed in one Node, this strands RAM. Even if RAM is available and not used, Pods will not be assigned due to insufficient CPU in the Node. For example: Evicted pod example

    In this example, the team:

    • Paid for 10 GB RAM and 10 CPU (5 per Node per resource type)
    • Needed 8 GB RAM and 9 CPU
    • Used 5 GB RAM and 8 CPU
    • Still had their pod evicted
  • Resource limits: The Kubernetes configuration that will provide minimum and maximum resource constraints for a Pod or container.

Find resource inefficiencies

With Kubernetes Monitoring, you can more easily discover unused and stranded resources, improve Pod limits and resource placement, and expose imperfections in resource management policy.

Examine resource management at a high level

Examine a high-level view of your resource management policies with the Cluster navigation page.

Cluster navigation page

Understand resource usage peaks

Resource usage peaks show you the maximum utilization that occurred during the last 6 hours. They are available for any Kubernetes component.

Deployment page

Solve resource inefficiencies

To help solve inefficient use of your resources, you can use Kubernetes Monitoring to:

  • Correlate data
  • Highlight awareness and accountability

Correlate data

Avoid performance degradation by correlating data between average and peak resource usage.

Cluster navigation page

Ideally, you want the average resource usage of your Cluster to remain stable. However, in certain time frames, you may receive complaints from your users about sluggish performance of an application they are using. You could have a peak in the Cluster’s resource usage. The 6h Max CPU and Memory indicator is helpful for troubleshooting and defining the root cause of the issues that your users are facing.

Highlight awareness and accountability

If your organization manages multiple Clusters and cloud providers, you can use per-Cluster and per-cloud-provider data to make well-informed decisions, and raise awareness and accountability about resource use.

Kubernetes Monitoring provides an out-of-the-box Efficiency dashboard. To access it, select Dashboards from the main menu and click Efficiency under the heading Cluster Dashboards. At this dashboard, you can see the most valuable efficiency indicators. For example, you can compare:

  • Created versus evicted pods, to indicate Pod placement issues and Node sizing improvements
  • Average versus maximum measures for CPU, memory, and storage

Efficiency dashboard