You are on page 1of 8

Part 2:

Compute Engine Instance Groups


Monitoring and Stress Testing
In Part 1 we created 2 autoscaling groups
In Part 2 we will test the autoscaling functionality
• Now that we have created out instance template and used it to create
two autoscaling instance groups we return to the Compute Engine and
we see that we have one VM running from each group.
• There is only one VM because we specified a minimum of 1 and a
maximum of 8 VMs. But we would see 3 VMs if that was our minimum

Presnetion by Michael Weiss / Cloud Credits provided by


2
Google Educate
Now we will put stress on the CPU and we should
see more VMs created as a result of the autoscaling
• If we click into one of the instance group VMs we can do monitoring:

Presnetion by Michael Weiss / Cloud Credits provided by


3
Google Educate
Now we will put stress on the CPU and we should
see more VMs created as a result of the autoscaling

Presnetion by Michael Weiss / Cloud Credits provided by


4
Google Educate
Log into one of the instance group VMs and
run the following Linux commands:
1. sudo apt-get update –y <- gets updates
2. sudo apt-get install stress <- installs the stress program
3. uptime
4. sudo stress - -cpu 8 - -timeout 20
5. uptime

Presnetion by Michael Weiss / Cloud Credits provided by


5
Google Educate
Below we see the results of higher levels of CPU usage
causes the autoscaler to create new VM instance in
response to the stress. Also note that multiple
availability zones within the region are used

Presnetion by Michael Weiss / Cloud Credits provided by


6
Google Educate
You can cancel stress at any time by pressing
<ctrl> <c> → now we are back to ‘normal’

Note that the CPU had hit 97% as shown above


Presnetion by Michael Weiss / Cloud Credits provided by
Google Educate 7
Note to students: this tutorial was made in 2020 and the cloud
platform interface has changed slightly.
Therefore some of the interfaces may be different that the ones shown
in these slides but that will not effect the results that you get.

Presnetion by Michael Weiss / Cloud Credits provided by


8
Google Educate

You might also like