Optimization Policy customization

Learn how to customize the optimization policy to tailor recommendations and automation to your services' specific needs

PerfectScale provides flexible customization options for configuring optimization policies to achieve greater control over optimization. With this feature, you can seamlessly align your optimization policy with your optimization goals to achieve the desired results efficiently.

circle-exclamation

Independent optimization policies for CPU and Memory

PerfectScale enables independent optimization policies for CPU and Memory, ensuring recommendations and automation are precisely aligned with your optimization goals while meeting reliability requirements.

Before setting the independent Optimization Policies, review the priority order to ensure the configuration leads to the desired outcome:

Workload Level (Highest Priority)

  1. Workload -> Custom CPU/Custom Memory Policy

  2. Workload -> Global

Cluster Level

  1. Cluster UI / Helm -> Custom CPU/Custom Memory Policy

  2. Cluster UI / Helm -> Global

Setting independent policies for the cluster

You can seamlessly set the independent CPU and Memory optimization policies for the already running cluster.

From the Overview screen, navigate to the Cluster Settings by clicking the gear icon next to the cluster. Open the Optimization Policy dropdown, and select Custom CPU & Mem Policies. Then select the desired policies for both CPU and Memory, and click the Save changes button.

Setting independent policies for the cluster

Setting independent policies for the workload

Click the specific workload to open the Zoom-in window. In the top-right corner, open the Optimization Policy dropdown, select Custom CPU & Mem Policies, elect the desired policies for both CPU and Memory, and click the Save button.

Setting independent policies for the workload

Memory request = memory limit policy

For memory-sensitive workloads, PerfectScale allows you to apply a Memory Request = Memory Limit policy on top of your optimization policy. This helps reduce the risk of OOM events and prevents noisy-neighbor effects by ensuring guaranteed memory allocation for your critical services.

circle-info

In some cases, higher-priority constraints may affect recommendations and take precedence over the Memory Request = Limit setting, including:

  • ResourceQuota

  • LimitRange

  • Automation CRD restrictions

  • Avoid setting limits for young workloads

triangle-exclamation

Setting memoryRequestEqualsLimit for the cluster

You can seamlessly set the memoryRequestEqualsLimit policy for the already running cluster.

From the Overview screen, navigate to the Cluster Settings by clicking the gear icon next to the cluster. Open the Optimization Policy dropdown, and select Memory Request = Limit. Then click the Save changes button.

Setting Memory Request = Limit policy for a cluster

Setting memoryRequestEqualsLimit for the workload

Click the specific workload to open the Zoom-in window. In the top-right corner, open the Optimization Policy dropdown, select Memory Request = Limit, and click the Save button.

Setting Memory Request = Limit policy for a workload
circle-info

Once Memory Request = Limit is enabled, PerfectScale automatically applies independent optimization policies for CPU and memory for this workload.

Custom optimization policy time window

PerfectScale uses the default data maturity time window for the recommendations, depending on the selected Optimization Policy. This algorithm allows PerfectScale to collect sufficient data to ensure reliable recommendations and accurately adjust resources through automated actions.

However, there may be situations when the default setup is not efficient enough due to known and predictable resource spikes within a known timeframe. PerfectScale allows you to set a Custom time window for the optimization policy to tailor recommendations and automation to your services' specific needs.

You can adjust the time window for the optimization policy for both the entire cluster and a specific workload.

Setting a custom time window for the cluster

You can easily specify the custom time window for the optimization policy when onboarding the cluster, or modify it for an already running cluster.

When onboarding a new cluster, enable the toggle Custom time window in the Optimization Policy drop-down and select the policy and the desired time window.

circle-info

If the exporter was installed with a specified custom policy, the subsequent upgrades should also include it. PerfectScale recommends using the upgrade command in the UI, as it keeps your fields from the installation. Find out more about upgrading the agent here.

Custom time window

If you want to modify the custom time window for the already onboarded cluster, navigate to the Cluster Settings by clicking the gear icon next to the cluster. Open the Optimization Policy dropdown, and select the desired policy and custom time window.

circle-info

If a custom policy is set through the exporter when installing the PerfectScale Agent, it cannot be modified in the UI afterward. You can still change the custom policy by upgrading the exporter with the new value, or you can return it to the default by upgrading the exporter without specifying any value (this will also enable the option to change the custom time window through the UI).

Setting custom time window for the cluster

Once the custom time window is applied, it will be displayed next to the optimization policy in UI.

Setting a custom time window for the workload

To set the custom time window for the optimization policy of the particular workload, navigate to the Zoom-in window by clicking the workload, select the desired optimization policy and custom time window, and click Save button.

Setting custom time window for the workload

Reverting to default optimization policy settings

To revert to the default optimization policy settings, simply upgrade the exporter without specifying any value. This will also enable modifying the custom time window through the UI.

Last updated

Was this helpful?