1

I have a managed instance group with an HTTP(S) LB in front of it. Currently, I have set up an auto-scaler policy to scale up or down based on CPU utilization and the threshold is set to 70%.
But I have observed that if there is any momentary spike in CPU usage for just a short while, new instances get added and immediately after a few minutes, some of the existing instances get deleted since the CPU usage would have come down.
I want the auto-scaler to ignore any momentary spikes by saying add more instances only if the CPU usage goes above 70% for more than 5 minutes.
How do I achieve this?

Regards,
Shobhana

Sunny J
  • 607
  • 3
  • 14

1 Answers1

0

Normally autoscaling dynamically creates or deletes VMs to meet the group target, not as per individual instance. These target are based on group overall utilization.

If you scale based on CPU utilization, you can set your target utilization level at 75% and the autoscaler will maintain the CPU utilization of the specified group of instances at or close to 75%.

For example

gcloud compute instance-groups managed set-autoscaling example-managed-instance-group --max-num-replicas 20 --target-cpu-utilization 0.75 --cool-down-period 90

Test: During periods of heavy CPU utilization, if utilization reaches close to 100%, the autoscaler estimates that the Group may already be heavily overloaded. In these cases, the autoscaler increases the number of instance by at least an extra 50% or a minimum of 4 instances, whichever is higher. There's no option currently available to specify the time interval for sequential monitoring of total utilization before scaling up or down.

You may report this as a feature request with Issue Trackers.

Sunny J
  • 607
  • 3
  • 14