For cluster autoscaler, how is the factor for scaling up/down determined

Hi,

For horizontal cluster scaling, if the metric configured is based on allocated memory, how is the factor for scaling up and down determined.

Thanks.

Hi @unmaunni,

currently we only have one strategy for determining the scaling factor. It will look at three values: the count, the metric and target.

  • count is how many “things” you currently have. In the case of cluster scaling, the count will be how many clients are running.

  • metric is the query result, so if your query returns allocated memory, metric will be how much memory is currently allocated (or a percentage).

  • target is the value that you define in your policy.

The scaling factor is then calculated to be proportional to your target, so the new number of clients in your cluster will be:

count * (metric/target)

So let’s run through an example. Supposed you currently have 3 nodes and would like that no more than 70% of their memory is allocated. If you query returns 75%, the new count will be:

3 * (75/70) = 3.214

Since we can’t have a fraction of a VM, the Autoscaler will create an extra client so that you will end with 4 in total. With the extra client, your metric will then drop since the total available memory has increased.

I hope this explanation helps you understand it better. We will be adding more strategies to the Autoscaler in future releases.

1 Like