I will give a detailed look at the configuration and operation of auto-scaling in my Azure app service plan. Along with my comments and experiences.
To support auto-scale, you need to have pricing plans of either Standard, Premium or Isolated. This is apart from the cheaper free, shared and basic plans. Click here for pricing details.
For how-to and intro based resources, you can read the following
- Create an Autoscale Setting for Azure resources based on performance data or a schedule
- Autoscaling Azure Web Apps
- General Best Practices: Autoscaling
The auto-scale blade is found in two places
- The App Service Plan > Scale out blade.
- Azure App Service Web App. But as indicated, this applies to the App Service Plan level opposed to just the one web app.
So, don’t get confused. They point to the same configuration.
I have setup two auto scale profiles
1) Default Profile
Note that this rule occurs last as noted in the Schedule. So watch out as this wasn’t that clear to me at first. I felt the order of precedence was by order of top to bottom as the UI.
Within the scale condition, I have two rules
- Scale out.
Another instance is added when the Average CPU over a 5-minute duration is greater than 30%. The 5-minute cool down is so to prevent another trigger of scale operations. This for situations where it is known to be a period of many spikes in the metrics and so allow the environment to stabilize. You normally want this to be much longer such as 1 hour or more, but depends on the performance requirements and capacity.
- Scale In
The instance count is decremented by 1 when the average CPU over 10-minute period is less than 5%.
2) 2nd Scale Profile
This 2nd scale condition has precedence over the default scale condition. Based on its schedule, 2 instances are increased when the average CPU > %50 over 5-minute period. I I have configured to cap the instance count to a maximum of 3 instances.
To see the operation of the auto-scale, read part 2 Auto-scaling Azure App Service Part 2 of 2