Skip to main content

Automatic Right-Sizing Recommendations and Rules

Cloud service provider relevance: EKS, AKS, and GKE.

This topic shows how to view right-sizing recommendations for workloads and containers and work with right-sizing rules.

Before you begin, see Ocean Cluster Automatic Right-Sizing for a full description of this feature.

To view your right-sizing recommendations and rules:

  1. In the left main menu, click Ocean > Cloud Clusters.
  2. Select a cluster from the list of clusters.
  3. Click Right Sizing > Advanced Optimization.

The Advanced Optimization tab contains these lists:

  • Workloads Optimization List.
  • Automation Rules List.

Your workload optimization activities impact the status of the workloads in the Right Sizing Savings panel.

Workloads Optimization List

right-sizing-example-table-ex

This list shows your right-sizing recommendations per workload and lets you drill down per container.

  • Right-sizing rules that are attached to specific workloads.
  • Workload optimization status: If the workload is attached to a right-sizing rule, the name of the rule appears under the Rules column. The rule can have one of these workload (colored) optimization statuses:
    • Green (Optimized): The workload is fully optimized, and no action is required.
    • Orange (Limited): Ocean applied recommendations to the workload, but there are limitations due to overhead, HPA, etc.
    • Blue (Pending): The rule has been attached to the workload but is out of schedule.
    • Red (Not Optimized): There are issues due to user configuration such as thresholds or exclude preliminary recommendations.
    • Gray (Rollback): Ocean rolled back to the original deployment request and suspended the workload's attachment to the rule.
    • Brown (Not Attached): The workload is not optimized.
  • Workload type and names.
  • vCPU and memory right-sizing recommendations per deployment. Recommended increases have a green arrow, and recommended decreases have a red arrow.
  • HPA: If the workload is configured with HPA, ON is displayed under HPA. Hover over the entry for information about the specific HPA trigger (CPU/Memory/other).
  • Potential monthly maximum savings if you accept the recommendations.
note
  • Hover over the Limited and Not optimized statuses to view more details.
  • There are no vCPU/memory recommendations or potential monthly maximum if a workload is fully optimized. Savings are shown for the workload because Ocean is already optimizing it.
  • If appears on the right of the screen, workloads were moved to rollback status. See Acknowledge a Workload Rollback.

If a message about VPA not reporting is shown:

  • You cannot attach rules to workloads.
  • If at least one rule was previously attached to a workload, the workload is not optimized due to the missing VPA installation in the cluster.

The indicators above the list shows the breakdown of these workload optimization statuses.

To view a list of your potential savings and recommendations per container:

  • Click on the arrow to the left of a workload to drill down to the containers. For each container, you can then view:

    • vCPU request: showing current and average utilization and a recommended increase or decrease (in vCPU units). If no changes are required, a Keep icon appears.
    • Memory request: This shows current and average utilization and a recommended increase or decrease (in MiB units). If no changes are needed, a Keep icon appears.
    • Right-sizing Recommendations: Show the recommended changes in vCPU and memory. Copy to save these changes for later.

Automation Rules List

automation-rules-e

This list shows your existing right-sizing rules.
Each rule entry shows relevant information about the parameters that trigger the rule and its scheduling plan.

Work with Right Sizing Rules

You can create right-sizing rules to trigger immediately after a specific set of requirements is met or at a specific time after the requirements are met.

Create or Edit a Right-Sizing Rule

To create/edit a right-sizing rule:

  1. Click the Advanced Optimization tab.

  2. To create a new rule, click + Add new rule above the rules list (or edit an existing rule).

    screen that shows how to create or edit a right-sizing-rule
  3. In Configure Automation Rule, enter a unique rule name.

  4. Select when to apply the recommendation:

    • Once available: The recommendation is applied immediately after it becomes available.
    • Specific time: You select when to apply the recommendation after it becomes available.
  5. Turn on Exclude preliminary recommendation if you want to suppress recommendations as long as the workload has preliminary status (4 days).

  6. Select one of the Restart replicas options:

    • All workloads.
    • Workloads with more than 1 replica only.
    • No restart.
    note

    If you have Kubernetes 1.33 or above, in most cases, Ocean can automatically apply the recommendations without restarting pods. For feature limitations, see [Kubernetes documentation].(https://kubernetes.io/docs/tasks/configure-pod-container/resize-container- resources/#limitations).

  7. Set the recommendation baseline (right-sizing percentile) for the workload to calculate the vCPU and memory recommendations.

The lower the percentile, the stronger the recommendations. By default, both vCPU and memory use the 85th percentile.

important

Changing the percentiles will impact any recommendations that were already applied (this may take a few minutes to update) and will also override the values set at cluster level for this workload.

  1. Click Set the resources percentage change to apply the recommendation (CPU and memory percentage thresholds). This is the minimum percentage change from the current request for applying a recommendation. If the right-sizing recommendation exceeds the percentage threshold for either CPU or memory, it will be applied to both, and the resulting status will be fully optimized. Ocean does this because the original purpose of the threshold is to prevent unnecessary pod deletion. However, if Ocean needs to delete a pod and relaunch a new one for one resource, it will do the same for the other.

  2. Click Set recommendation ranges for resources, and enter the upper and lower boundary values for CPU (millicpu) and memory (MiB) requests to apply a recommendation. By default, the minimum values are 10 millicpu for CPU and 32 MiB for memory. No lower values will be accepted.

    • If a recommendation is above the set boundaries, automatic right-sizing will apply the recommendation using the maximum value configured in the rule.
    • If a recommendation is below the set boundaries, automatic right-sizing will apply the recommendation using the minimum value configured in the rule.
  3. Click Set overhead for resources, and set the CPU and memory percentage overhead. An overhead specifies the percentage of extra resources to add to the new request recommendation.

  4. Ocean supports automatic right-sizing for workloads associated with HPA. Click Apply HPA on associated workload to enable.

  5. Turn on Auto-attach if you want to automatically attach rules to workloads based on selected criteria.

    • In the Auto-attach area, select required namespaces and/or labels.

  6. The saved rule appears in the area under the Workloads Optimization list.

    note
    • Default values for Overhead and Automation Threshold are 10% and 5% respectively.
    • The 10% default overhead is calculated within the recommendation.
    • Threshold value is only used for down-sizing cases.

Attach a Right-Sizing Rule to One or More Workloads

Options:

Auto-attach

Turn on auto-attach and let Ocean automatically attach rules to workloads based on selected criteria. See Create or Edit a Right-Sizing Rule.

note

Auto-attach attaches rules to existing and newly-added workloads.

Manual attach

To manually attach a rule:

  1. Select one or more workloads in the Workloads Optimization list.

  2. From Actions, click Attach Rule.

    attach-rule-to-workload

  3. You can either attach an existing or new rule you create from scratch (a new rule will be attached to the workload(s) you selected earlier):

  4. Save and apply the rule.

Detach a Right-Sizing Rule from One or More Workloads

To detach a rule from one or more workloads:

  1. Select workloads in the Workloads Optimization list.
  2. From the Actions drop-down menu above the list, click Detach Rule.
important

For Kubernetes issues, detach workloads from rules and roll them in your cluster.

Delete a Right-Sizing Rule

To delete a right-sizing rule:

  1. To the right of the row for the rule in the list, click the wastebasket icon.
  2. When the confirmation message appears, click Delete, or Cancel (if you are unsure).
important

You cannot restore a deleted right-sizing rule. You cannot delete a rule that is attached to a workload.

Acknowledge a Workload Rollback

If a workload triggers an OOM error, Ocean rolls back to the original deployment request and suspends the workload's attachment to the rule. The workload moves to rollback status. When at least one workload has rollback status, the button appears at the top-right of the screen.

To acknowledge a workload rollback:

  1. Click Acknowledge Rollback to view all the workloads with the rollback status.

    • The rollback drill-down list includes:
      • Workload Name.
      • Namespace.
      • CPU Update in vCPUs (before and after rollback).
      • Memory Update in MiBs (before and after update).
      • Rollback Time: In format MM/DD/YYYY HH:MM:SS AM/PM.
  2. Select the checkboxes for the required workloads.

  3. Click I Acknowledge the Rollback.

The workloads appear in the Workloads Optimization List without any attached rules. Before attaching a rule to a rolled-back workload, first fix the issue.

Set the vCPU and Memory Percentiles at Cluster Level

These are the global percentile settings at the cluster level and apply to all workloads in the cluster.

Any percentile change you make for a specific workload in a right-sizing rule overrides the setting at cluster level.

To change the settings:

  1. Click Cluster Settings above the workloads optimization list.

  2. Click vCPU or Memory as required (vCPU is shown in the example).

  3. Change the values and save.

Best Practices

These are the Right-Sizing Best Practices:

  • Workload limits should not have the same values as requests.
  • If you set overheads for resources, start with a relatively high overhead (20%) and decrease it with time.
  • If you set boundaries (recommendation ranges for resources), avoid applying the same rule to all workloads. All services have different purposes.