Introduction to Auto Scaling

Lab Details:

  1. This lab walks you through GCP Autoscaling based on CPU Utilization.

  2. You will be creating an Instance Template defining the instance configuration.

  3. You will be creating an Instance Group defining the Autoscaling Policy.

  4. Region: us-central1

  5. Duration: 45 minutes

Note: Do not refresh the page after you click Start Lab, wait for a few seconds to get the credentials.
In case while login into Google, if it asks for verification, please enter your mobile number and verify with OTP, Don't worry this Google Account will be deleted after the lab.

What is Auto Scaling?

Let's understand Auto Scaling with the help of an example, imagine you being a web developer and you have developed a web application, now you are ready to go live on a single front end server. You have different layers in your applications like the web layer (front end), business layer, and database layer. On day 1, you are assuming 10 concurrent users which will ideally use 50% of your CPU Utilization but as the demand increase, you might see an increase in users from 10 to 20 or maybe more during peak time, also at some point in time, you might see a very fewer user. If you add some front end server manually then it can be a huge overhead if your application is big and again you have to decrease the server manually. To overcome the scenario, AutoScaler came to the rescue, where you just define the instance template means the configuration of every server and instance groups where you define your scaling policy. Here we are going to show you CPU Utilization over 80% policy. Autoscaling mostly used with Load Balancer to have a single IP of all the running instances. We will cover about Load Balancer in the next lab.

Compute Engine offers both managed and unmanaged instance groups, only managed instance groups can be used for Autoscaling.

While creating an Instance group, you must specify which autoscaling policy and utilization level that the Autoscaler should use to determine when to scale the group. There are three policies:

  • Average CPU utilization.

  • HTTP load balancing.

  • Cloud Monitoring metrics.

The Autoscaler keeps on collecting usage details based on the chosen policy, and then compares actual utilization to your target utilization, and uses this information to determine whether the instance group needs to remove instances or add instances.

For example, if you choose CPU utilization policy, you can set your target utilization level at 80%, so once the CPU Utilization cross or equals 80%, the autoscaler will add more instances to the group.

Cool Down period:

The Autoscaler keeps on collecting usage details but while your instance is spinning up, its metrics information might be irrelevant to be considered for the autoscaling policies. To avoid that scenario, always set a Cool Down period so that Autoscaler waits till cool down period finish before collecting the metrics information from the instances.

Architecture Diagram:

Lab Tasks:

  1. Login into GCP Console.

  2. Creating an Instance Template

  3. Creating an Instance Group

  4. Checking the running Instance

Join Whizlabs_Hands-On to Read the Rest of this Lab..and More!

Step 1 : Login to My-Account
Step 2 : Click on "Access Now" to view the course you have purchased
Step 3 : You will be taken to our Learn Management Solution (LMS) to access your Labs,Quiz and Video courses

Open Console