Question

Difficulty: MediumConfigure Azure Monitor Autoscale Rules and Metrics

A background data synchronization service runs on an Azure App Service plan (Standard S2 tier) that is currently scaled to 33 instances. You need to configure autoscale rules for the App Service plan based on the CPU percentage metric. You define the following rules:

* Scale-out rule: Increase the instance count by 33 when the average CPU percentage is greater than 75%75\% for 10 minutes.
* Scale-in rule: Decrease the instance count by 33 when the average CPU percentage is less than a target threshold for 10 minutes.

Under a constant workload, you must prevent the autoscale engine from flapping (repeatedly scaling out and scaling in).

Which of the following configurations should you implement?

  1. A
    Set the scale-in threshold to 40%40\%.
  2. B
    Downgrade the App Service plan to the Basic B2 tier and set the scale-in threshold to 35%35\%.
  3. Set the scale-in threshold to 30%30\%.Answer
  4. D
    Set the scale-in threshold to 45%45\%.

Answer

Set the scale-in threshold to 30%30\%.
The correct option is to set the scale-in threshold to 30%30\%. To avoid flapping, the scale-in threshold must be strictly less than the average CPU load of the scaled-out instances under a constant workload. With 33 instances at a 75%75\% scale-out threshold, the total workload is 225%225\%. When the service scales out by 33 instances to a total of 66, the workload is distributed, resulting in an average CPU load of 37.5%37.5\%. Since 30%30\% is strictly less than 37.5%37.5\%, the scale-in rule will not immediately trigger, preventing flapping.

Step-by-Step Solution

1
Calculate the total CPU capacity load required to trigger the scale-out rule.
3×75%=225%3 \times 75\% = 225\% total CPU load
This represents the minimum combined CPU capacity utilized across all instances just as the scale-out threshold is crossed.
2
Determine the new instance count after the scale-out action occurs.
3 instances+3 instances=6 instances3 \text{ instances} + 3 \text{ instances} = 6 \text{ instances}
The scale-out rule increases the capacity by 33 instances from the current base of 33.
3
Calculate the new average CPU percentage across all instances under the same constant workload.
225%/6=37.5%225\% / 6 = 37.5\% average CPU
Dividing the total CPU load by the new instance count gives the expected average CPU usage per instance after scaling.
4
Select a scale-in threshold that is strictly lower than the post-scale-out average CPU percentage.
30%30\% is the only valid configuration that is strictly lower than 37.5%37.5\% while remaining on a supported App Service tier.
If the scale-in threshold is greater than or equal to 37.5%37.5\% (e.g., 40%40\%, 45%45\%), the autoscale engine will immediately scale back down to 33 instances, causing flapping.

Key Concept

Avoiding Autoscale Flapping in Azure Monitor
Rate this question