Question

Difficulty: HardConfigure Azure App Service Web Apps

An organization deploys a web application to an Azure App Service web app. You configure the following autoscale rules for the App Service plan:

* Scale-out rule: Increase the instance count by 2 when the average CPU percentage is greater than 70% over a 10-minute duration.
* Scale-in rule: Decrease the instance count by 1 when the average CPU percentage is less than 75% over a 10-minute duration.

During periods of moderate, stable load, the application experiences flapping, where instances are repeatedly added and removed.

You need to resolve the flapping behavior and ensure stable scaling of the web application.

Which of the following modifications should you make?

  1. A
    Decrease the scale-out duration from 10 minutes to 2 minutes while keeping the thresholds unchanged.
  2. Change the scale-in threshold to trigger when the average CPU percentage is less than 40%.Answer
  3. C
    Change the scale-in threshold to trigger when the average CPU percentage is less than 85%.
  4. D
    Change the scale-in rule to decrease the instance count by 2 instead of 1.

Answer

Change the scale-in threshold to trigger when the average CPU percentage is less than 40%.
Changing the scale-in threshold to less than 40% CPU usage resolves the flapping behavior. When the web app scales out by 2 instances, the average CPU percentage drops. By setting the scale-in threshold to a significantly lower value (40%), you prevent the system from immediately triggering a scale-in action when the CPU usage drops after scaling out. This creates a stable scaling profile.

Step-by-Step Solution

1
Identify the cause of flapping in the autoscale settings.
The current scale-in threshold of 75% is higher than the scale-out threshold of 70%, meaning there is a logical overlap where both conditions can be met, leading to constant scaling.
Understanding the logic error in the autoscale rules is necessary to find the right resolution.
2
Determine how instance capacity changes affect CPU metrics.
When the scale-out rule adds 2 instances, the overall CPU usage per instance drops. The scale-in threshold must be low enough to not immediately trigger a scale-in command when this drop occurs.
Autoscale thresholds must account for the change in metric values that occurs as a direct result of scaling actions.
3
Select a scale-in threshold that provides a safe margin.
Changing the scale-in threshold to 40% CPU usage creates a safe margin below 70%, preventing flapping and ensuring stable operation.
This configuration ensures that scaling in only happens when the workload has genuinely decreased.

Key Concept

Autoscale rules must have a sufficient safety margin (cool-down gap) between scale-out and scale-in thresholds to prevent flapping.
Rate this question