(gentle piano music)
(relaxing music)
- [Kayode] This is Kayode with Azure Monitor Team.
In this video tutorial,
I'll walk you though the process of configuring Autoscale
to change the number of virtual machines in a scale set
based on user-defined performance criteria.
Autoscale enables you to provision just the right amount
of resources to support the load on your application.
The amount of resources can be quickly increased
during periods of high load, such as flash sales
and seasonal workloads in customer-facing applications.
On the other end of the spectrum,
resources can be reduced during periods of low loads,
such as nights and weekends for corporate apps.
Autoscale may be applied to several resources in Azure
including virtual machine scale sets,
app service web apps, and API management services.
By navigating to Azure Monitor and then to Autoscale,
I can view all the resources
for which Autoscale is applicable
along with their current Autoscale status.
The major benefit of Autoscale
is that it allows you to dynamically increase
or decrease the available resources that will be consumed by
and billed to a subscription,
depending on the load on the system.
Another entry point for configuring Autoscale
is to start in the resource plate,
which is what I'll do in this case.
I'll start by looking at my resource group
that contains a VM scale set made up
of three virtual machines
and a load balancer that distributes traffic across them.
In this example, there's very little user traffic
or low load on my app.
I may be running three VMs
in a case that can be easily supported by a single one.
And on the other extreme,
if there's an unexpected increase in the number
of concurrent users or a spike in load,
an admin would typically have to manually respond
to allocate more resources on the fly.
Instead, Autoscale can be used here to scale in
and scale out the number of available VMs
based on user-defined performance metrics
for predetermined time intervals.
Now we'll go ahead and configure the Autoscale condition
on the VM scale set to reduce the number of VMs
to as few as only one or to as many as five VMs,
depending on the number of connection requests received
at the load balancer.
First, I'll start by editing the default condition.
I'll set the default maximum and minimum VM instances
to three, five, and one respectively.
Next, I'll add an Autoscale rule
to scale out by one instance
when the load balancer receives more than 50 SYNs.
SYNs here refer to the number of TCP connection requests
from the client side.
Because I'd like the total number
of SYNs during a given time period,
I'll choose sum as my aggregation.
I'm setting this rule
to an artificially low threshold of 50 SYNs,
so it can be breached quickly in this demo environment.
And it's always best practice
to create a matching rule to scale in
when the Autoscale-created resources are no longer required.
I'll do so now and add a rule to scale in by one instance
when the number of connection requests drop to 50 or below.
Note here that I could have easily selected other options
from a range of available metrics
to define my Autoscale condition.
For example, CP usage on the VMs
with the number of HTTP requests in an application gateway
could also be good candidate for this scenario.
Once the Autoscale condition is set up,
I can view the history of its actions directly
in the scaling blade by selecting the Run History tab.
Here you can see that there were two spikes
in connection requests,
one at 7:00 p.m. and another at eight.
The Autoscale rule successfully provisioned additional VMs
that accommodate these spikes,
initially by scaling out from one to two VM instances
before scaling back into one
and then scaling out to four instances
during our busiest period.
Autoscale operations are also visible
as events in the activity log.
Finally, in this demonstration,
I've only configured Autoscale via the portal
to explain the concept.
However, Autoscale can be deployed and managed
with automation using resource manager templates,
PowerShell, and Azure CLI.
Thanks for watching this short tutorial.
Remember, you can take advantage
of Autoscale to improve your efficiency
as well as reduce the consumption costs
of Azure Compute Resources.
(bright piano music)