Updated on 2025-04-27 GMT+08:00

Resource Specifications Recommendation

CCE provides the resource specifications recommendation for Kubernetes-native workloads. By analyzing the historical CPU and memory usages of a workload, CCE can recommend appropriate requests for the workload. This helps you properly plan resources to optimize workload costs.

Overview

Gartner statistics reveal that enterprises are using less than 15% of their CPUs on average, causing a serious waste of resources. This is primarily due to improper resource allocation, which is evident in the following:

  • To ensure application stability and handle traffic bursts, workloads are often configured with resource requests higher than actual consumption, which leads to overallocation of resources.
  • When the resource requests of workloads are specified, the scheduler allocates resources for the workloads based on the node resource capacity. To ensure successful scheduling, resource requests are often lower than actual consumption. As a result, there are resource conflicts.

For better resource allocation, CCE provides the resource specifications recommendation. CCE recommends resource specifications for each container by calculating resource values based on the latest resource metrics of workloads. This helps plan resources appropriately.

When configuring the resource request or limit, you can design redundancy by using a value such as 1.2 times the recommended value. For key services, you can specify redundancy settings for the request and limit as needed to enhance reliability and fault tolerance.

Constraints

Currently, the resource specifications recommendation is available for two types of workloads: Deployments and StatefulSets.

Prerequisites

  • The cluster version must be v1.23 or later.
  • Cost Insights has been enabled, and cost data has been generated.

Enabling Resource Specifications Recommendation

To use the resource specifications recommendation, enable it first.

  1. Log in to the CCE console and click the cluster name to access the cluster console.
  2. In the navigation pane, choose Cloud Native Cost Governance > Cost Insights. Then, click View Details in Cost Optimization Suggestions.

  3. On the displayed page, click Enable to enable the resource specifications recommendation, which takes about 1 minute. The Volcano add-on is automatically installed.

Using Resource Specifications Recommendation

After the resource specifications recommendation is enabled for a workload, CCE directly modifies the resource request and limit of the workload based on the recommended values.

  • The recommended values generated based on historical metrics of workloads may be inaccurate. The recommended values are only for reference. You can adjust the resource request as required.
  • Adjusting the resource limit of a workload will trigger rolling update of the workload, which may cause service interruptions.
  • If a workload is deployed across multiple pods, all container metrics, including those with the same name, for the pods will be collected.
  • If the recommended minimum memory for a single pod is 250Mi, the recommended minimum memory for a single container in that pod is 250Mi/Number of containers. If the recommended minimum CPU for a single pod is 25m, the recommended minimum CPU for a single container in that pod is 25m/Number of containers.
  • Metrics of the last three days (or all metrics if Prometheus monitors metrics for less than three days) are collected to generate recommended values, which are updated every 24 hours.
  1. Log in to the CCE console and click the cluster name to access the cluster console.
  2. In the navigation pane, choose Cloud Native Cost Governance > Cost Insights. Then, click View Details in Cost Optimization Suggestions.
  3. Locate the workload and click Enable Recommendation.

  4. Click the workload name or click Execute in the Operation column to view the recommendation details.

  5. Configure the resource request and limit of a pod based on the recommendation values. When configuring the resource request or limit, you can design redundancy by using a value such as 1.2 times the recommended value. For key services, you can specify redundancy settings for the request and limit as needed to enhance reliability and fault tolerance.

  6. Click Submit. A rolling update will be performed on the workload.