Optimize Kubernetes Costs with Resource Recommendations

Updated 5 days ago by Archana Singh

Harness Continuous Efficiency (CE) provides recommendations for your Kubernetes clusters. These recommendations show you resource optimization opportunities to potentially reduce your monthly spend.

The recommendations are computed by analyzing the past utilization of CPU and memory of your workload. The implementation uses a decaying histogram of CPU and memory peaks weighted by recency.

Before using recommendations in your cluster environment, ensure that its impact is evaluated thoroughly. The person reviewing the recommendations should be able to understand the impacts identified in recommendations, as well as the impact on the infrastructure and business.

Using recommendations without proper assessment could result in unexpected changes, such as issues with system performance or poor reliability.

In this topic:

Before You Begin

How are Recommendations Computed?

In Harness CE, the recommendations are computed by analyzing the past utilization of CPU and memory of your workload. The implementation uses a decaying histogram of CPU and memory peaks weighted by recency. The recommendation resources are computed as the following:

  • The lower bound is based on the 80th percentiles of CPU samples and memory peaks.
  • The upper bound is based on the 95th percentile for memory peaks and no upper bound for CPU samples.

Decaying Histogram

Histograms compute statistics about the distribution of values in a data set. The decaying histogram exponentially favors recent values over older ones, making it suitable for use cases such as monitoring the state of long-running processes.

Decaying happens in discrete time units called a half-life. Half-life is the time required for the weight of a sample to be halved. CE uses 1 day as half-life when computing recommendations.

View Recommendations

You can view recommendations for your cluster from the Cost Explorer Overview and Cluster tab. Cost Explorer makes recommendations to optimize your workloads to potentially reduce your monthly cloud cost.

Currently,

Step: View Recommendations From the Overview Tab

The Overview page displays the top recommendations for your Kubernetes clusters. To view recommendations from the Overview tab, perform the following steps:

  1. In Continuous Efficiency, click Explorer.
  2. In Overview, click TOP RECOMMENDATIONS.
    Top Recommended Actions are listed. The list is sorted based on the highest potential savings.
    The Overview page lists the recommendations only if the monthly cost-saving is greater than 20$. However, you can view all the recommendations for that workload in the workloads detail view under the Cluster tab.
  3. Click on the Recommended Action for which you want to view the details. You can also use the right arrow button.
    Recommended Actions are displayed. In this example, the recommendation engine has analyzed 8 days of data. Based on the analysis the recommended actions are provided to optimize your resources to potentially save $375.49 in the monthly bill.
  4. Click on the Workload to view further granular details. Alternatively, click <- arrow to go back to the Overview page.
    The root cost analysis for the selected workload is displayed. For more information, see Root Cost Analysis for Workloads.

You can use this information to optimize your resources to potentially reduce your monthly cloud costs.

Step: View Recommendations From the Cluster Tab

To view recommendations from the Cluster tab, perform the following steps:

  1. In Continuous Efficiency, click Explorer and then click Cluster.
  2. Select the date range for the costs you want to analyze.
  3. In Group by, select Workload to list all the workloads. Use the Filter settings to select a specific workload. You can also use the search option to search from the available workloads.
  4. Click on the workload for which you want to view the recommendations and click VIEW RECOMMENDATIONS.
    Recommended Actions are displayed. In this example, the recommendation engine has analyzed 8 days of data. Based on the analysis the recommended actions are provided to optimize your guaranteed and burstable resources to potentially save $375.49 in the monthly bill.
    You can use this information to optimize your resources to potentially reduce your monthly cloud costs.


How did we do?