Using an autoscaling policy with multiple signals
Stay organized with collections
Save and categorize content based on your preferences.
When you create an autoscaling policy with multiple signals, the autoscaler
scales based on the signal that provides the largest number of virtual machine
(VM) instances in the managed instance group (MIG). This ensures that there
are always enough VMs to handle your application workloads and lets you
scale applications with multiple possible bottlenecks.
To learn more about the different types of autoscaling signals,
see Autoscaling policy.
If you haven't already, set up authentication.
Authentication verifies your identity for access to Google Cloud services and APIs. To run
code or samples from a local development environment, you can authenticate to
Compute Engine by selecting one of the following options:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and
APIs, you don't need to set up authentication.
gcloud
Install the Google Cloud CLI.
After installation,
initialize the Google Cloud CLI by running the following command:
An autoscaler handles multiple signals by calculating the recommended number of
VMs for each signal and then picking the signal that results in the largest
number of VMs in the MIG.
An autoscaler can handle one signal per metric type except in the case of
Cloud Monitoring metrics and scaling schedules.
You can choose up to 5 autoscaling signals for Cloud Monitoring
metrics and create up to 128 schedules
per MIG. For example, you can create an autoscaler that
uses up to 1 CPU utilization signal, up to 1 load balancing signal, up to 5
custom metric signals, and up to 128 scaling schedules.
For example, you can define an autoscaler with all of the following
signals:
cpuUtilization with target of 0.8
loadBalancingUtilization with target of 0.6
customMetricUtilization for metric1 with target of 1000
customMetricUtilization for metric2 with target of 2000
scalingSchedules
A minimum of 6 VMs every Saturday and Sunday at 12:00 AM for 24 hours
A minimum of 15 VMs every Monday through Friday at 9:00 AM for 8 hours
In this example, suppose the autoscaler measures the following average
utilization values for a MIG that contains 10 VMs
at the time of measurement:
0.5 for CPU utilization
0.4 load balancing utilization
1100 for metric1
2700 for metric2
Using the preceding values, the autoscaler calculates the recommended number of
VMs based on each signal:
7 VMs based on CPU utilization
7 VMs based on load balancing utilization
11 VMs based on metric1
14 VMs based on metric2
6 VMs every Saturday and Sunday for the entire day based on the first scaling schedule
15 VMs every Monday through Friday from 9:00 AM to 5:00 PM based on the second scaling schedule
The autoscaler picks the signal that results in the largest number of VMs in the
MIG and sets the MIG's
recommended size
to that value. In this case, the autoscaler resizes the MIG
to 15 VMs if the second schedule is currently active or to 14 VMs otherwise.
Create an autoscaler with multiple signals
Creating an autoscaler with multiple signals is slightly different depending
on whether you are using the Google Cloud console, gcloud CLI,
or REST.
Permissions required for this task
To perform this task, you must have the following
permissions:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-06-09 UTC."],[],[]]