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.
Recommended workflow
Start in the HPA view
Filter by HPA to list the workloads that scale horizontally and see which ones have HPA recommendations.
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.
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.
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.
Raise low triggers
Lower triggers inflate requests and cost.
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.
Re-check after the Revisions Timeline shows the change
Confirm in the Replicas widget that scaling behaves as expected.
Last updated
Was this helpful?