A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/compute/docs/autoscaler/multiple-signals below:

Using an autoscaling policy with multiple signals | Compute Engine Documentation

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.

Before you begin How autoscaler handles multiple signals

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:

In this example, suppose the autoscaler measures the following average utilization values for a MIG that contains 10 VMs at the time of measurement:

Using the preceding values, the autoscaler calculates the recommended number of VMs based on each signal:

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:

Console
  1. In the Google Cloud console, go to the Instance groups page.

    Go to Instance groups

  2. Click the name of a MIG from the list.

  3. Click Edit.

  4. Click Group size & autoscaling to expand the section.

  5. In the Autoscaling mode list, make sure that On: add and remove instances to the group is selected.

  6. In the Minimum number of instances field, enter the minimum number of VMs that you want for this MIG. The minimum size of this MIG is always maintained regardless of its autoscaling signals.

  7. In the Maximum number of instances field, enter the maximum number of VMs that you want for this MIG. The maximum size of this MIG is never exceeded regardless of the recommended size generated by its autoscaling signals.

  8. For each metric-based autoscaling signal that you want to add, click Add a signal.

  9. For each schedule-based autoscaling signal that you want to add, in the Autoscaling schedules section, click Manage.

    1. Click Create schedule.

    2. In the Create scaling schedule pane, complete the required fields, and then click Save.

    3. In the Scaling schedules pane, click Done.

    For more information, see Scaling based on schedules.

  10. In the Initialization period section, enter the number of seconds that your application needs to initialize. This period lets your VMs finish initializing before the autoscaler considers its usage data reliable. For more information, see Initialization period.

  11. Optional: to enable scale-in controls, in the Scale-in controls section, select the Enable scale-in controls checkbox. For more information, see scale-in controls

  12. Click Save.

gcloud

To create an autoscaler with multiple signals, use the set-autoscaling command. Pass in multiple signal specifications using their respective command-line flags.

For example, the following command creates an autoscaler that uses CPU utilization, load balancing serving capacity, two custom metrics, and one scaling schedule. The --max-num-replicas and --min-num-replicas flags restrict how big or small the MIG can get.

gcloud compute instance-groups managed set-autoscaling MIG_NAME \
   --target-cpu-utilization=0.8 \
   --target-load-balancing-utilization=0.6 \
   --custom-metric-utilization metric=PATH_TO_CUSTOM_METRIC_1,utilization-target=1000.0,utilization-target-type=GAUGE \
   --custom-metric-utilization metric=PATH_TO_CUSTOM_METRIC_2,utilization-target=2000.0,utilization-target-type=DELTA_PER_SECOND \
   --set-schedule=workday-capacity \
   --schedule-cron="30 8 * * Mon-Fri" \
   --schedule-duration-sec=30600 \
   --schedule-min-required-replicas=10 \
   --schedule-description="Have at least 10 VMs every Monday through Friday from 8:30 AM to 5 PM UTC" \
   --min-num-replicas=1 \
   --max-num-replicas=50

Replace the following:

With the exception of the custom metric flags, you can only pass in one flag maximum for each metric type per gcloud command. For custom metrics, you can provide multiple custom metrics in a single command by repeating the --custom-metric-utilization flag.

For more information about how to configure the flags for each type of autoscaling signal, see the following pages:

REST

To create an autoscaler, use the autoscalers.insert method for a zonal MIG or the regionAutoscalers.insert method for a regional MIG.

For example, the following request creates an autoscaler that uses CPU utilization, load balancing serving capacity, two custom metrics, and two scaling schedules. The maxNumReplicas and minNumReplicas fields restrict how big or small the MIG can get.

POST https://compute.googleapis.com/compute/v1/projects/PROJECT/zones/ZONE/autoscalers

{
  "autoscalingPolicy" : {
    "cpuUtilization":{
      "utilizationTarget": 0.8
    },
    "loadBalancingUtilization":{
      "utilizationTarget": 0.6
    },
    "customMetricUtilizations":[
      {
        "metric": "PATH_TO_CUSTOM_METRIC_1",
        "utilizationTarget": 1000,
        "utilizationTargetType":"GAUGE"
      },
      {
        "metric": "PATH_TO_CUSTOM_METRIC_2",
        "utilizationTarget": 2000,
        "utilizationTargetType": "DELTA_PER_SECOND"
      }
    ],
    "scalingSchedules": {
      "workday-capacity": {
        "minRequiredReplicas": 10,
        "schedule": "30 8 * * Mon-Fri",
        "durationSec": 30600,
        "description": "Have at least 10 VMs every Monday through Friday from 8:30 AM to 5 PM UTC"
      },
      "january-30-2030-schedule": {
        "minRequiredReplicas": 30,
        "schedule": "0 0 30 1 * 2030",
        "timeZone": "America/New_York",
        "durationSec": 86400,
        "description": "Schedule a minimum of 30 VMs all day for January 30, 2030"
      }
    },
    "maxNumReplicas": 50,
    "minNumReplicas": 1
  },
  "target": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instanceGroupManagers/MIG_NAME",
  "name": "MIG_NAME"
}

Replace the following:

As shown in this example, you can provide multiple custom metrics and scaling schedules in the same request.

For more information about how to configure the fields for each type of autoscaling signal, see the following pages:

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["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 2025-08-07 UTC."],[[["Autoscaler with multiple signals will scale based on the signal that calculates the highest number of virtual machines (VMs) needed in the managed instance group (MIG)."],["The autoscaler can manage multiple signal types such as CPU utilization, load balancing, custom metrics, and scaling schedules, with limitations on the number of each signal."],["When configuring an autoscaler, you define target values for each signal, and the autoscaler will recommend the number of VMs needed based on current usage and schedule requirements."],["Creating an autoscaler with multiple signals involves setting up the desired signals and their specifications via the Google Cloud console, `gcloud` CLI, or REST API."],["The minimum and maximum size for a MIG is defined and will always be maintained, regardless of the signals that the autoscaler uses."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4