Auto Scaling in azure appService

Posted By : Ankit Kumar | 28-Aug-2019

 

AutoScaling Definition:

Auto scaling allows us to add resources to handle increases in load and also automatically remove the resources when the load is below the specified level. Here we specify a minimum and maximum number of instances to run and add or remove VMs automatically based on the defined rules. Setting a minimum makes sure our application is always running even under no load. Setting a maximum limits our total possible hourly cost. We automatically scale between these two extremes using rules we define.

 

Available Scale Options In Azure Portal:

  1. Scale UP -  When you want to scale by changing the app service Plan:

  2. Scale OUT-  When you want to scale by increasing the resources within the same app service plan

 

Make sure to configure Scale-Out as well as Scale-In rule:

 

Step 1.

Navigate to app-service plan, as scaling is done at ServicePlan level

Select Scale Out(App Service Plan)

Choose Custom AutoScale

Click on Add rule

 
Step 2.

Now lets setup a Scale-Out rule
This will result in an increase in VM count when the load is above the defined threshold.
Here we’ll configure the rule based on the average CPU metric as,

 
Step 3.
Set the threshold  value to 70%, indicating whenever the CPU load > 70
% for 5 continuous minutes then increase the VM count by 1 instance
 
 
Step 4.
Now its time to setup a Scale-In rule:
This will result in a decrese in VM count when the load is below the defined threshold.
Again we’ll configure the rule based on the average CPU metric as,
 
 
Step 5.
Set the threshold  value to 50%, indicating whenever the CPU load < 50
% for 5 continuous minutes then decrease the VM count by 1 instance
 
Note:
To avoid Flapping choose the thresholds carefully for all metric types
 
 
Save it.
 
When the rule conditions are met, one or more autoscale actions are triggered automatically.
 
Step 5.
To Enable the autoscaling notification :
Click the notify icon and enter the emails separated by commas.
 
Setting Performance Test
Now let's create a load test to check our newly created auto-scale settings:

Step1. 

Navigate:

      [resource_group]      [app_service]

Home   >>   my-stage-resources    >>    my-stage-appService

 

Step2. 

Select: Performance Test

 

Step3.

Select + New to create a new performance test.

Create, set up, and run your performance test

 

Step4.

Set the details and run the test.

 
It’ll take some time to complete the test. Once the test is performed you will receive emails based on your scale-in and scale-out rules.
 
 

About Author

Author Image
Ankit Kumar

RedHat certified in System Administration as well as Ansible Automation. A self-motivated professional with excellent research skill, enthusiasm to learn new things and always try to do his best

Request for Proposal

Name is required

Comment is required

Sending message..