I’ve been playing around with Azure capabilities and I was really interested in the scaling out capacity. Mostly because I believe that it allows you to save money while having the capacity to support the demands on your apps. Today we will look at autoscaling a cloud service with virtual machines hosting a web app on IIS connected to a SQL backend.
When you scale an application up or down that is running Virtual Machines, new machines are not created or deleted, but are turned on or turned off from an availability set of previously created machines.
Adding a VM to an availability set.
In my Cloud service called CanITProCamp I have 3 vms running my web app.
(yes I know my numbering needs a little work… LOL)
I selected WEBFE06
And in the Configure tab, I added that machine to the “East” availability set.
Now that we have all our machines in the availability set. We are ready to automatically scale an application running on our Virtual Machines.
On the Scale tab for our cloud service, we can configure your cloud service to automatically increase or decrease the number of instances or Virtual Machines that are used by your application. You can configure scaling based on average CPU.
in the scale by Metric section, select CPU and set the other slide bars to the desired levels and click Save in the bottom action bar.
When the average percentage of CPU usage goes above the maximum setting, more Virtual Machines are turned on. When the average percentage of CPU usage goes below the minimum setting, Virtual Machines are turned off.
remember that calculating the average percentage of CPU usage and the average is based on use over the previous hour.
That’s it . your cloud service will now adjust the number of instances and ensure that you use your resources effectively.
try it out!