Kubernetes - Overallocated containers recommendation


The Overallocated containers recommendation identifies containers with underutilized resources (CPU or memory). 

Configuring recommendations

You can configure a recommendation as per your requirement by modifying the condition in the corresponding Optimizer rule. A user with administrative privileges can reconfigure or add new Optimizer rules to modify the recommendations. For more information, see Configuring and managing Optimizer rules.

The following recommendation details are provided:

  • Brief description of the issue
  • Severity or Efficiency level of the recommendation. The thresholds for calculating the efficiency level is defined in the associated optimizer rule.
  • Date when this recommendation is generated on. It is the date of the last run of the associated optimizer rule.
  • Name of the associated optimizer rule
  • Recommended action that suggests reconfiguring the container with the ideal configuration values to reclaim unused resources.
    BMC Helix Continuous Optimization detects saving opportunities combined with other potential resource usage optimizations. Hence, based on the resource usage pattern, the recommended action might suggest to reduce one resource and to increase another.
  • Actions that you can perform on your recommendations. For details, see Managing the recommendations.
  • Comparison between the current resource usage and the estimated future usage after reconfiguring the container
  • Criteria used for detecting the container as overallocated
  • Benefits of implementing the recommendation

enh_k8s_recom_over_containers_details_23.1.png

A container is detected to be overallocated if the resource demand, demand peak, and the corresponding headroom values are lower than the configured request and limit values:

  • CPU headroom
  • Memory headroom
  • Damping factor

Demand is used for recommendation of request and demand peak is used for recommendation of limit. 

You can change the default values of these thresholds on the Rules page in the Administration > Optimizer section. 

k8s_container_rule.png

For more information about modifying the Optimizer rules, see Configuring and managing Optimizer rules.

Identifying overallocation and suggesting recommendations

BMC Helix Continuous Optimization uses the formulas listed in the following table to compare a container's actual or forecasted resource usage with its configured request or limit. If the usage plus the headroom is less than the configured value, the container is considered overallocated.

Formula to detect overallocation of CPU Request

Formula: 

 CPU Demand + Headroom < CPU Request

Parameter breakdown
Part 1: Forecasted CPU Usage

Definition: Predicted CPU usage for the next 30 days, based on historical trends.

Computed as:
Forecasted CPU Usage = Forecast of BYCONT_CPU_USED_NUM [HOUR, AVG, 30D]

Part 2: Current CPU Demand

Definition: Recently observed CPU usage.

Computed as:

  • (Primary option): PCTL50 of BYCONT_CPU_USED_NUM_HM [HOUR, AVG, 30D]
  • (Fallback option): PCTL50 of  BYCONT_CPU_USED_NUM [HOUR, AVG, 30D]

The BYCONT_CPU_USED_NUM_HM metric is only available if the High Mark metrics are enabled in ETL.

The collected data is averaged at an hourly resolution. This means each data point represents the average CPU usage over one hour.

Represents a single average hourly data point over a 30-day period. It indicates the 50th percentile (PCTL50), which is the median, calculated from about 720 hourly data points (24 hours times 30 days).

Part 3: CPU Demand

Definition: The estimated CPU usage a container needs.

Computed as:
CPU Demand = MAX(Forecasted CPU Usage, Current CPU Demand)

Part 4: Headroom

Definition: A configurable value to avoid under-provisioning.

Default: 20% of CPU usage

For more information, see Configuring and managing Optimizer rules.

Part 5: CPU Request

Definition: The CPU amount guaranteed by Kubernetes for the container.

Recommendation:

CPU Request = CPU Demand + Headroom

Formula to detect overallocation of CPU Limit

Formula: 

 CPU Demand Peak + Headroom < CPU Limit

Parameter breakdown
Part 1: Forecasted CPU Usage

Definition: Predicted CPU usage for the next 30 days, based on historical trends.

Computed as:
Forecasted CPU Usage = Forecast of BYCONT_CPU_USED_NUM [HOUR, MAX, 30D]

Part 2: Current CPU Demand

Definition: Recently observed CPU usage.

Computed as:

  • (Primary option): PCTL95 of BYCONT_CPU_USED_NUM_HM [HOUR, AVG, 30D]
  • (Fallback option): PCTL95 of  BYCONT_CPU_USED_NUM [HOUR, AVG, 30D]

The BYCONT_CPU_USED_NUM_HM metric is only available if the High Mark metrics are enabled in ETL.

The collected data is averaged at an hourly resolution. This means each data point represents the average CPU usage over one hour.

^ Represents a single average hourly data point over a 30-day period. It corresponds to the 95th percentile (PCTL95), which indicates peak usage, calculated from about 720 hourly data points (24 hours times 30 days).

Part 3: CPU Demand Peak

Definition: The highest CPU usage expected.

Computed as:
CPU Demand Peak = MAX(Forecasted CPU Usage, Current CPU Demand Peak)

Part 4: Headroom

Definition: A configurable value to avoid under-provisioning.

Default: 20% of CPU limit

For more information, see Configuring and managing Optimizer rules.

Part 5: CPU Request

Definition: The CPU amount guaranteed by Kubernetes for the container.

Recommendation:

CPU Request = CPU Demand Peak + Headroom

Formula to detect overallocation of Memory Request

Formula: 

 Memory Demand + Headroom < Memory Request

Parameter breakdown
Part 1: Forecasted Memory Usage

Definition: Predicted memory usage for the next 180 days, based on historical trends.

Computed as:
Forecasted Memory Usage = MAX(Forecast of BYCONT_MEM_RSS[DAY, AVG,180D], Forecast of BYCONT_MEM_ACTIVE[DAY, AVG, 180D] )

Part 2: Current Memory Demand

Definition: Recently observed memory usage.

Computed as:
Max(BYCONT_MEM_ACTIVE[AVG] [Hour, AVG, 30D],
BYCONT_MEM_RSS[AVG] [Hour, AVG, 30D])

Part 3: Memory Demand

Definition: The estimated memory usage a container needs.

Computed as:
MAX (Forecasted Memory Usage, Current Memory Demand)

Part 4: Headroom

Definition: A configurable value to avoid under-provisioning.

Default: 20% of memory usage

For more information, see Configuring and managing Optimizer rules.

Part 5: CPU Request

Definition: The amount of memory guaranteed by Kubernetes for the container.

Recommendation:

Memory Request = Memory Demand + Headroom

Formula to detect overallocation of Memory Limit

Formula: 

 Memory Demand Peak + Headroom < Memory Limit

Parameter breakdown
Part 1: Forecasted Memory Usage

Definition: Predicted memory usage for the next 180 days, based on historical trends.

Computed as:
MAX(Forecast of BYCONT_MEM_RSS[DAY, MAX,180D], Forecast of BYCONT_MEM_ACTIVE[DAY, MAX, 180D])

Part 2: Current Memory Demand Peak

Definition: Recently observed memory usage.

Computed as:

MAX(BYCONT_MEM_ACTIVE[MAX][Hour, MAX, 30D],
BYCONT_MEM_RSS[MAX] [Hour, MAX, 30D])

Part 3: Memory Demand Peak

Definition: The estimated memory usage a container needs.

Computed as:
MAX (Forecasted Memory Usage, Current Memory Demand Peak)

Part 4: Headroom

Definition: A configurable value to avoid under-provisioning.

Default: 20% of the memory limit

For more information, see Configuring and managing Optimizer rules.

Part 5: CPU Request

Definition: The amount of memory guaranteed by Kubernetes for the container.

Recommendation:

Memory Request = Memory Demand + Headroom

 

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC Helix Continuous Optimization 25.4