Skip to content

Commit 2fa9137

Browse files
jm-francpr00se
andauthored
Update keps/sig-autoscaling/4951-configurable-hpa-tolerance/README.md
Add a scaling scenario. Co-authored-by: Patryk Prus <[email protected]>
1 parent 71ed0a6 commit 2fa9137

File tree

1 file changed

+11
-2
lines changed
  • keps/sig-autoscaling/4951-configurable-hpa-tolerance

1 file changed

+11
-2
lines changed

keps/sig-autoscaling/4951-configurable-hpa-tolerance/README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,17 @@ updates.
143143
[Horizontal Pod Autoscaler][] (HPA) regularly estimates how many replicas a given Deployment (or other resource with a `/scale` subresource) should instantiate.
144144
HPAs define one (or more) metrics (e.g. CPU utilization) on which autoscaling is based. The number of replicas is derived from the ratio between the *expected* and *current* value of this metric ([Algorithm details][]).
145145

146-
To avoid flapping, the number of replicas is left unchanged if this ratio is approximately 1, within a *tolerance* set to 10%. This proposal adds a parameter
147-
to HPAs allowing users to configure this tolerance.
146+
For example, for a workload with 100 `currentReplicas` and a usage ratio
147+
(`currentMetricValue`/`desiredMetricValue`) of 1.07, the calculated `desiredReplicas`
148+
would be 107 (100 * 1.07).
149+
150+
However, to avoid flapping, scaling actions are skipped if the usage ratio is approximately 1, within a
151+
globally-configurable *tolerance*, set to 10% by default. In the example above, no scaling action would
152+
take place, since the ratio is within this tolerance.
153+
154+
This proposal adds a parameter to HPAs allowing users to configure this tolerance per HPA resource.
155+
For the example above, we could configure the tolerance in the workload's HPA to 5%, which would
156+
allow the scale-up to 107 replicas to proceed.
148157

149158
[Horizontal Pod Autoscaler]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
150159
[Algorithm details]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#algorithm-details

0 commit comments

Comments
 (0)