
Datadog Vertical Rightsizing: Ending the VPA and HPA Conflict
Enterprise Developer PlatformsMost Kubernetes workloads use less than 25% of their requested CPU and less than half their requested memory, yet the standard fix, the Vertical Pod Autoscaler, is advised against for most of them, Datadog argues in its vertical rightsizing announcement. For platform teams paying for that idle capacity, the problem is that four out of five HPA deployments scale on CPU or memory, the exact metrics VPA would change.
How It Works
The upstream VPA documentation advises against running VPA and the Horizontal Pod Autoscaler on the same resource metric, and Datadog’s post explains why. An HPA scaling on CPU calculates utilization as usage divided by request. Lower the request and utilization rises even though usage hasn’t changed.
Datadog’s example: a pod uses 0.5 CPU against a 1 CPU request, so utilization is 50% under a 70% HPA target. Cut the request to 0.6 CPU and utilization jumps to roughly 83%, which can trigger a scale-out. The extra replicas lower per-pod usage, which can prompt VPA to cut requests again, and the loop continues.
Datadog’s answer is HPA compatibility in its Pod Autoscaler. It reads the HPA’s configuration, such as a 60% CPU target, and treats the HPA as the owner of horizontal scaling. It then runs the same algorithm as Datadog’s multidimensional scaling mode but applies only vertical changes, so the HPA keeps managing replicas as configured. Workloads with no HPA can use multidimensional mode to let the Pod Autoscaler handle both directions.
The setup form now recommends a configuration from three signals. A workload with three or fewer replicas for at least a week and no HPA, such as a leader-elected controller, gets vertical scaling preselected. A workload with an existing HPA gets the HPA-compatible option. A workload with CPU spikes at startup gets burstable mode, which removes the CPU limit but keeps rightsizing the request. Datadog Cluster Agent v7.86.0 and later also ship a built-in vertical balanced profile alongside the existing cost, balance and performance profiles. GitOps users enable HPA compatibility with an annotation on the DatadogPodAutoscaler resource.
What This Means for You
Stepped scale-down addresses the other risk in rightsizing: cutting too far at once. Datadog’s example is a service requesting 4 CPU but averaging 1, where jumping straight to a recommended 1.5 CPU leaves little room for spikes or batch jobs, and limits that shrink with requests can cause throttling or OOM kills. Datadog says VPA applies its recommendation directly with no configurable step size. Stepped scale-down cuts CPU and memory requests in small reductions, checks for OOM kills and memory usage before each further cut, and pauses if memory rises above a per-workload objective, such as 60% CPU and 50% memory utilization.
The caveats: HPA compatibility and stepped scale-down require signing up for the Preview, while the recommended configurations are available now to Kubernetes Autoscaling users. The case against plain VPA comes from a vendor selling the alternative, though the HPA arithmetic is upstream Kubernetes behavior. This extends the rollout patterns we covered in deploying Datadog Kubernetes Autoscaling at scale.
The So What
If your HPA-scaled services request far more CPU than they use, sign up for the Preview and trial HPA-compatible rightsizing with stepped scale-down on one stateless service with a CPU-based HPA, then watch replica counts alongside requests for a week to confirm the scale-out loop doesn’t appear before widening it.
Source: Datadog
Content created with AI assistance and reviewed for accuracy.
Join the conversation
Stack Insiders is our free community for readers who want to go deeper — share resources, ask questions, and connect with others across every vertical we cover.
Join Stack Insiders →