-
Benefits
- Google Cloud offers server-side load balancing to distribute incoming traffic across multiple virtual machine (VM) instances
- Load balancing scales applications and supports heavy traffic
- Detects and automatically removes unhealthy VM instances using health checks
- Instances that become healthy again are automatically re-added
- Routes traffic to the closest virtual machine
- Uses forwarding rule resources to match certain types of traffic and forward it to a load balancer
- Google Cloud load balancing is a managed service, with redundant, highly available components
- If a load balancing component fails, it is restarted or replaced automatically and immediately
- Google Cloud offers several different types of load balancing that differ in capabilities, usage scenarios, and configuration
-
Autoscaling
- Compute Engine offers autoscaling to automatically add or remove VM instances from an instance group based on increases or decreases in load
- Autoscaling enables apps to gracefully handle increases in traffic, and reduces cost when the need for resources is lower
- After you define the autoscaling policy, the autoscaler performs automatic scaling based on the measured load
-
Policies
- At least one autoscaling policy must be specified when an autoscaler is created
- Autoscaling policy can be based on CPU utilization, load balancing serving capacity, or Cloud Monitoring metrics
- If multiple policies are used, the autoscaler scales an instance group based on the policy that provides the largest number of VM instances in the group
- CPU utilization is the most basic form of autoscaling
- Autoscaling policy tells the autoscaler to watch the average CPU utilization of a group of VM instances and add or remove instances from the group to maintain desired utilization
- Autoscaling policy is useful for configurations that are CPU intensive but might fluctuate in CPU usage
- When an autoscaler is setup to scale based on load balancing serving capacity, the autoscaler watches the serving capacity of an instance group and scales when the VM instances are over or under capacity
- The serving capacity of an instance can be defined in the load balancer's backend service and can be based on either utilization or requests per second
- Autoscaling can be setup to collect data of a specific operations metric and perform scaling based on a desired utilization level
- It is possible to scale based on standard metrics provided by Monitoring or by using any custom metrics