Soru

Zorluk: ZorConfigure Azure App Service Web Apps

An Azure App Service plan currently hosts a single instance of a web application. You configure a scale-out rule to add one instance to the plan when the average CPU usage exceeds 80%80\% for 1010 minutes. You need to configure a scale-in rule to remove one instance when the traffic decreases. Assuming the workload is distributed evenly across all instances after scaling out, which of the following is the maximum CPU threshold you should set for the scale-in rule to prevent autoscale flapping?

  1. 35%35\%Cevap
  2. B
    45%45\%
  3. C
    55%55\%
  4. D
    75%75\%

Cevap

The maximum CPU threshold for the scale-in rule should be set to 35%35\% to prevent autoscale flapping.
When the web app is running on a single instance and CPU usage hits 80%80\%, the scale-out rule triggers, increasing the instance count to two. Since the workload is distributed evenly, the CPU usage on each of the two instances will drop to approximately half of the total load: 80%÷2=40%80\% \div 2 = 40\%. If the scale-in threshold is set to 40%40\% or higher, the new CPU usage level of 40%40\% will immediately satisfy the scale-in condition. This triggers a scale-in back to one instance, causing the CPU usage to spike back to 80%80\%, triggering another scale-out, and creating an infinite loop (flapping). To prevent this, the scale-in threshold must be set below the expected post-scale-out CPU usage. A threshold of 35%35\% is strictly below 40%40\% and will prevent flapping.

Adım Adım Çözüm

1
Calculate the expected CPU usage per instance after a scale-out event.
With one instance scaling out to two instances under an 80%80\% CPU load, the expected CPU per instance is 80%×12=40%80\% \times \frac{1}{2} = 40\%.
This determines the new operating baseline CPU level immediately after the scale-out action occurs.
2
Analyze the flapping condition for scale-in thresholds.
To prevent immediate scale-in, the scale-in threshold must be strictly less than the post-scale-out CPU level of 40%40\%.
If the scale-in threshold is equal to or greater than the post-scale-out CPU usage, the scale-in rule triggers immediately, causing a loop.
3
Identify the correct option that satisfies the condition.
A threshold of 35%35\% is selected since 35%<40%35\% < 40\%, while all other options are greater than or equal to 40%40\%.
This is the only threshold configuration that successfully avoids autoscale flapping.

Anahtar Kavram

App Service Autoscale Rule Metric Configuration and Flapping Prevention
Bu soruyu puanla