Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



Autoscalers

An Autoscaler resource represents an autoscaler, which scales the number of virtual machine instances in a Replica Pool , based on the specified parameters.

For a list of methods for this resource, see the end of this page.

Resource representations

A Compute Engine Autoscaler resource.

{
  "name": string,
  "target": string,
  "autoscalingPolicy": {
    "minNumReplicas": integer,
    "maxNumReplicas": integer,
    "coolDownPeriodSec": integer,
    "cpuUtilization": {
      "utilizationTarget": double
    },
    "customMetricUtilizations": [
      {
        "metric": string,
        "utilizationTarget": double
      }
    ],
    "loadBalancingUtilization": {
      "utilizationTarget": double
    }
  },
  "description": string,
  "id": unsigned long,
  "creationTimestamp": string,
  "selfLink": string
}
Property name Value Description Notes
autoscalingPolicy nested object The configuration parameters for the autoscaling algorithm. You can only define one of the following utilization policies per autoscaler:
  • cpuUtilization - Indicates that this autoscaler should scale based on average CPU usage of a group of virtual machines. This is measured in the amount of used cores.
  • customMetricUtilizations -  Indicates that this the autoscaler should scale based on a Cloud Monitoring metric. Currently, you can only provide one metric of your choice for this policy.
  • loadBalancingUtilization - Indicates that the autoscaler should scale based on the serving capacity of a group of virtual machines.
If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.8 or 80%.
autoscalingPolicy. coolDownPeriodSec integer The number of seconds that the autoscaler should wait between two successive changes to the number of virtual machines. You should set an interval that is at least as long as the initialization time of a virtual machine and the time it may take for the replica pool to create the virtual machine. The default is 60 seconds.

Virtual machine initialization times might vary because of numerous factors. It is recommended that you test how long a virtual machine may take to initialize by manually creating one and timing the process.

autoscalingPolicy. cpuUtilization nested object Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a replica pool.
autoscalingPolicy.cpuUtilization. utilizationTarget double The target CPU utilization that the autoscaler should maintain. Must be a float value in the range (0, 1]. If not specified, the default is 0.8.

If the CPU level is below the target utilization, the autoscaler scales down the number of replicas until it reaches the minimum number of replicas you specified or until the average CPU of your replicas reaches the target utilization.

If the average CPU is above the target utilization, the autoscaler scales up until it reaches the maximum number of replicas you specified or until the average utilization reaches the target utilization.



autoscalingPolicy. customMetricUtilizations[] list Defines the configuration parameters of autoscaling based on a custom Cloud Monitoring metric .
autoscalingPolicy.customMetricUtilizations[]. metric string The identifier of the Cloud Monitoring metric. The metric can not have negative values and should be an utilization metric, which means that the number of virtual machines handling requests should increase or decrease proportionally to the metric. The metric must also begin with compute.googleapis.com/instance/*, although this alone does not guarantee that the metric is valid.

For example, the following is a valid metric:
compute.googleapis.com/instance/network/received_bytes_count
The following is not a valid metric because it does not increase or decrease based on the virtual machine usage:
compute.googleapis.com/instance/cpu/reserved_cores


autoscalingPolicy.customMetricUtilizations[]. utilizationTarget double Target value of the metric which Autoscaler should maintain. Must be a positive value.
autoscalingPolicy. loadBalancingUtilization nested object Configuration parameters of autoscaling based on load balancer.
autoscalingPolicy.loadBalancingUtilization. utilizationTarget double Sets the utilization target based on the load balancing capacity settings. This value is used as the fraction of the backend capacity utilization that the autoscaler should maintain. This must be a positive float value. If not defined, the default is 0.8.

For example, if you set the maxRatePerInstance capacity for a HTTP load balancing configuration to 10 requests per second (RPS) and you would like the autoscaler to keep the maximum rate per instance at 70% of the capacity, then set this target value to 0.7. The autoscaler would then maintain the virtual machines in the replica pool to 70% of the maxRatePerInstance capacity, or 7 RPS.

If the HTTP load balancing configuration uses the maxUtilization property instead of the maxRatePerInstance property, autoscaling would work in the same manner, where the target utilization is a fractional percentage of the maxUtilization . For example, if the load balancer has a maxUtilization value of 50% and you set the autoscaler target value at 50%, the autoscaler will maintain the virtual machines at 50% of the maxUtilization value, which is 25%.



autoscalingPolicy. maxNumReplicas integer The maximum number of replicas that the autoscaler can scale up to. This is required when creating or updating an autoscaler.
autoscalingPolicy. minNumReplicas integer The minimum number of replicas that the autoscaler can scale down to. If not specified, the default is 2.
creationTimestamp string [Output Only] Creation timestamp in RFC3339 text format.
description string An optional textual description of the resource provided by the client.
id unsigned long [Output Only] Unique identifier for the resource; defined by the server.
name string Name of the Autoscaler resource. This name must be unique per project and per zone. This is required when creating or update an autoscaler.
target string The fully-qualified URL of the entity that this autoscaler will scale. Currently, the only supported value is a Replica Pool URL. This is required when creating or updating a Autoscaler resource. For example:
https://www.googleapis.com/replicapool/v1beta1/projects/projectName/zones/zone/pools/poolName

Note: It is illegal to specify multiple Autoscaler resources for the same target.

Methods

delete
Deletes the specified Autoscaler resource. This requests returns a Zone Operation resource, which allows you to view the status of your request. You can query the corresponding zone operation for an update status of your request. Once the zone operation returns DONE ,  the Autoscaler resource was successfully deleted.
get
Gets information about the specified Autoscaler resource.
insert
Adds a new Autoscaler resource.
list
Lists all Autoscaler resources in this zone.
patch
Update the entire content of the Autoscaler resource. This method supports patch semantics.
update
Update the entire content of the Autoscaler resource.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.