Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Combining vertical (Podfit) and horizontal (HPA) optimization

Optimize VPA resource requests and HPA settings together to reduce waste without compromising workload scaling

VPA right-sizing and HPA scaling are closely connected because HPA triggers are calculated as a percentage of resource requests.

Why VPA and HPA are connected

An HPA trigger determines how much of the requested CPU or memory must be used before HPA scales the workload. PerfectScale uses observed usage and the trigger value to calculate the recommended request.

For example:

  • 50% trigger: the recommended request is about 2× the observed usage.

  • 80% trigger: the recommended request is about 1.25× the observed usage.

The relationship works both ways. Resource requests and limits also affect the highest HPA trigger that can be reached before CPU throttling or a memory limit causes the container to be killed. After right-sizing, review the HPA triggers to make sure they still allow the workload to scale as expected.

1

Start in the HPA view

Filter by HPA to list the workloads that scale horizontally and see which ones have HPA recommendations.

2

Apply vertical right-sizing first

Apply the CPU and memory request recommendations, manually or with automation. Requests that match real usage give the HPA a correct baseline.

Use the Optimization Policy to set headroom. If a workload needs more resilience, set a higher policy such as ExtraHeadroom rather than a very low trigger.

3

Review HPA recommendations

A new request changes the highest usable trigger, so a trigger that worked before can be no longer relevant. Check the recommendations after the new revision have been running.

4

Fix minReplicas

Lower values left over from past incidents. This is the largest source of idle capacity on HPA workloads, and it does not depend on request sizing.

Treat at max replicas as a scaling signal, not a sizing problem. If a workload stays at maxReplicas, vertical right-sizing will not fix it. Review maxReplicas and scale-down behavior yourself, since PerfectScale does not recommend changes to them.

5

Raise low triggers

Lower triggers inflate requests and cost.

Use container-level triggers for multi-container pods. A sidecar can hide the application's load in a pod-level average. Container triggers require a supported Kubernetes version, so check your cluster version first (we recommend Kubernetes version 1.33 or later)

6

Lower unreachable triggers

Align them with the highest usable trigger, or adjust the limit if the trigger value is intentional. HPA needs enough headroom above the utilization target to trigger scaling. Resource limits can restrict this headroom, making higher targets unreachable or increasing the risk of OOM kills.

7

Re-check after the Revisions Timeline shows the change

Confirm in the Replicas widget that scaling behaves as expected.

Last updated

Was this helpful?