You can autoscale based on the average CPU utilization of a managed instance group (MIG).
Using this policy tells the autoscaler to collect the CPU utilization of the instances in the group and determine whether it needs to scale. You set the target CPU utilization the autoscaler should maintain and the autoscaler works to maintain that level.
-
Go to the Instance groups page.
-
If you have an instance group, select it and click Edit group. If you don't have an instance group, click Create instance group.
-
Under Autoscaling, select On.
-
Under Autoscale based on, select CPU utilization.
-
Enter the Target CPU utilization you want. This value is treated as a percentage. For example, for 60% CPU utilization, enter 60.
-
Provide a number for the maximum number of instances that you want in this instance group. You can also set the minimum number of instances and the cool down period. The cool down period is the number of seconds the autoscaler should wait after a VM has started before the autoscaler starts collecting information from it. This accounts for the amount of time it can take for a VM to initialize, during which the collected data is not reliable for autoscaling. The default cool down period is 60 seconds.
-
Save your changes.