@@ -10,6 +10,7 @@ feature:
10
10
Scale your application up and down with a simple command, with a UI, or automatically based on CPU usage.
11
11
content_type : concept
12
12
weight : 90
13
+ math : true
13
14
---
14
15
15
16
<!-- overview -->
@@ -131,14 +132,17 @@ From the most basic perspective, the HorizontalPodAutoscaler controller
131
132
operates on the ratio between desired metric value and current metric
132
133
value:
133
134
134
- ```
135
- desiredReplicas = ceil[currentReplicas * ( currentMetricValue / desiredMetricValue )]
135
+ ``` math
136
+ \begin{equation*}
137
+ desiredReplicas = \left( currentReplicas \times { currentMetricValue \over desiredMetricValue } \right)
138
+ \end{equation*}
136
139
```
137
140
138
141
For example, if the current metric value is ` 200m ` , and the desired value
139
- is ` 100m ` , the number of replicas will be doubled, since `200.0 / 100.0 ==
140
- 2.0` If the current value is instead ` 50m`, you'll halve the number of
141
- replicas, since ` 50.0 / 100.0 == 0.5 ` . The control plane skips any scaling
142
+ is ` 100m ` , the number of replicas will be doubled, since
143
+ \\ ( { 200.0 \div 100.0 } = 2.0 \\ ).
144
+ If the current value is instead ` 50m ` , you'll halve the number of
145
+ replicas, since \\ ( { 50.0 \div 100.0 } = 0.5 \\ ). The control plane skips any scaling
142
146
action if the ratio is sufficiently close to 1.0 (within a globally-configurable
143
147
tolerance, 0.1 by default).
144
148
@@ -173,8 +177,8 @@ since it started. This value is configured with the
173
177
` --horizontal-pod-autoscaler-cpu-initialization-period ` flag, and its
174
178
default is 5 minutes.
175
179
176
- The ` currentMetricValue / desiredMetricValue ` base scale ratio is then
177
- calculated using the remaining pods not set aside or discarded from above.
180
+ The \\ ( currentMetricValue \over desiredMetricValue \\ ) base scale ratio is then
181
+ calculated, using the remaining pods not set aside or discarded from above.
178
182
179
183
If there were any missing metrics, the control plane recomputes the average more
180
184
conservatively, assuming those pods were consuming 100% of the desired
0 commit comments