Question

Difficulty: Very hardConfigure Azure Monitor Autoscale Rules and Metrics

You are designing autoscale rules for a production Azure Virtual Machine Scale Set (VMSS) hosting a microservice API. The VMSS has a minimum instance count of 33 and a maximum instance count of 1010.

The current autoscale settings are configured as follows:
* Scale-out rule: When the CPU Percentage (aggregated as Average) is greater than 80%80\% for 1010 minutes, increase the instance count by 22.
* Scale-in rule: When the CPU Percentage (aggregated as Average) is less than T%T\% for 1010 minutes, decrease the instance count by 22.

You need to configure the scale-in rule to prevent autoscale flapping (repeated scale-out and scale-in cycles) under constant workload conditions.

Which two changes should you implement? (Select two.)

  1. Set the scale-in threshold TT to 45%45\%.Answer
  2. Set the scale-in threshold TT to 55%55\% and change the scale-in action to decrease the instance count by 11.Answer
  3. C
    Set the scale-in threshold TT to 55%55\%.
  4. D
    Set the scale-in threshold TT to 65%65\% and change the scale-in action to decrease the instance count by 11.

Answer

To prevent autoscale flapping under constant workload, you should either set the scale-in threshold to 45% or set the scale-in threshold to 55% and change the scale-in action to decrease the instance count by 1.
To prevent autoscale flapping, the average CPU percentage after a scale-in event must remain below the scale-out threshold of 80%. When using the default configuration (decrement by 2), the most restrictive scale-in scenario occurs when scaling from 5 to 3 instances. A scale-in threshold of 45% ensures that the total workload is less than 5×45%=225%5 \times 45\% = 225\%, which translates to a post-scale-in average CPU of less than 75%75\% on 3 instances. Alternatively, reducing the decrement to 1 instance allows a higher threshold of 55%. In this case, the most restrictive scenario is scaling from 4 to 3 instances. A threshold of 55% ensures the total workload is less than 4×55%=220%4 \times 55\% = 220\%, leading to a post-scale-in average CPU of less than 73.3%73.3\%. Both options successfully prevent immediate scale-out.

Step-by-Step Solution

1
Analyze the scale-in condition when scaling from 5 to 3 instances with a decrement of 2.
The scale-in triggers when the average CPU is less than T%T\%, meaning the total workload is less than 5×T%5 \times T\%. After scaling down to 3 instances, the new average CPU is 5×T%3\frac{5 \times T\%}{3}.
We must find a threshold TT such that the new average CPU is strictly less than the scale-out threshold of 80% to avoid immediate scale-out.
2
Calculate the maximum safe threshold TT for a decrement of 2.
5×T3<80    5T<240    T<48%\frac{5 \times T}{3} < 80 \implies 5T < 240 \implies T < 48\%. Thus, T=45%T = 45\% is safe.
Setting TT below 48% ensures that the post-scale-in CPU load remains below the scale-out trigger.
3
Analyze the scale-in condition when scaling from 4 to 3 instances with a decrement of 1.
The scale-in triggers when the average CPU is less than T%T\%, meaning the total workload is less than 4×T%4 \times T\%. After scaling down to 3 instances, the new average CPU is 4×T%3\frac{4 \times T\%}{3}.
We need to verify if changing the decrement to 1 allows a higher threshold like 55%.
4
Calculate the maximum safe threshold TT for a decrement of 1.
4×T3<80    4T<240    T<60%\frac{4 \times T}{3} < 80 \implies 4T < 240 \implies T < 60\%. Thus, T=55%T = 55\% with a decrement of 1 is safe.
Setting TT below 60% with a decrement of 1 ensures the post-scale-in CPU load remains below the scale-out trigger.

Key Concept

Autoscale flapping occurs when a scale-in action reduces capacity to a point where the remaining instances immediately exceed the scale-out threshold, causing an endless loop. To prevent this, the scale-in threshold and scale-in step size must be configured such that the workload at the trigger point, when distributed over the reduced instance count, does not exceed the scale-out threshold.
Estimated Time:3m 0s
Rate this question