Kubernetes HPA replica calculator

Enter how many pods run now, the current metric value (for example average CPU utilisation in percent) and the target from your HorizontalPodAutoscaler. The calculator applies the HPA's scaling rule and shows the replica count it will aim for, whether it scales up, down or holds, and whether a limit was hit.

%
Desired replicas6
DecisionScale up
Metric ÷ target
1.5
Unrounded replicas
6
Limit applied
None

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Enter the current replicas and the metric’s current value, in the same unit as the target (percent for CPU utilisation, requests per second for a custom metric, and so on).
  2. Enter the target from the HPA spec, and its minReplicas and maxReplicas.
  3. Keep the tolerance at 10 % unless your cluster sets a different horizontal-pod-autoscaler-tolerance.

Formula

  • ratio = current metric ÷ target
  • If |ratio − 1| ≤ tolerance: desired = current (no scaling)
  • Otherwise: desired = ceil(current replicas × ratio)
  • Then desired is clamped to minReplicas … maxReplicas

Worked example

A deployment runs 4 pods at 90 % average CPU, the target is 60 %, limits 2…10:

  • Ratio: 90 ÷ 60 = 1.5, outside the 10 % band.
  • Unrounded: 4 × 1.5 = 6; desired replicas 6.
  • Decision: Scale up; limit applied: None.

Tips

  • Set maxReplicas with headroom. If the result often shows “Capped at maxReplicas”, pods stay overloaded; raise the limit or the node capacity.
  • A lower target scales earlier. A 50 % CPU target leaves room for traffic spikes while new pods start; 80 % runs leaner but reacts later.
  • Check requests first. If CPU requests are far from real use, utilisation figures mislead the autoscaler.

Frequently asked questions

How does the HPA calculate desired replicas?

desiredReplicas = ceil(currentReplicas × currentMetricValue ÷ desiredMetricValue). With 4 pods at 90 % CPU and a 60 % target: 4 × 90 ÷ 60 = 6 pods. The result is then kept between minReplicas and maxReplicas.

Why does the HPA not scale when the metric is a little above target?

The controller skips scaling while the ratio metric ÷ target stays within a tolerance of 1.0, which is 0.1 (10 %) by default. 8 pods at 64 % against a 60 % target give a ratio of 1.067, so nothing changes, even though ceil(8.53) would be 9.

Is CPU utilisation measured against limits or requests?

Against requests. A Utilization target of 60 % means 60 % of the CPU each pod requests, averaged across the pods. Pods without a CPU request cannot be scaled on CPU utilisation.

What does this calculator leave out?

Only the core formula is modelled. The real controller also uses a scale-down stabilisation window (5 minutes by default), scaling policies that limit how fast pods are added or removed, special handling of pods that are not ready or have no metrics yet, and takes the largest result when several metrics are set.

More in Developer

All tools in this category: Developer ·Updated November 7, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.