Soru

Zorluk: OrtaScale Azure App Service Web Apps

You manage an Azure App Service Web App named ImageResizerAPI that is deployed on a Standard (S2) App Service plan. The Web App is currently scaled to 3 instances. You configure an autoscale rule to scale out by increasing the instance count by 1 when the average CPU percentage exceeds 80%80\%. You need to configure a scale-in rule to decrease the instance count by 1 when the CPU load decreases. To prevent autoscale flapping, which scale-in CPU threshold should you configure?

  1. 50%Cevap
  2. B
    65%
  3. C
    70%
  4. D
    75%

Cevap

A scale-in threshold of 50% should be configured.
A scale-in threshold of 50% is correct because when the App Service scales out from 3 instances to 4 instances at a CPU utilization of 81%, the load is redistributed. The new average CPU per instance becomes 60.75%60.75\% (81%×3481\% \times \frac{3}{4}). Since 60.75% is greater than 50%, the scale-in rule is not triggered, preventing an immediate scale-in loop (flapping).

Adım Adım Çözüm

1
Calculate the total CPU load when a scale-out is triggered.
Total CPU load is 81%×3=243%81\% \times 3 = 243\%.
At 3 instances with a threshold of 80%80\%, a scale-out triggers when average CPU exceeds 80%80\% (for example, 81%81\%).
2
Calculate the new average CPU per instance after scaling out.
New average CPU per instance is 60.75%60.75\%.
When 1 instance is added, the total CPU load of 243%243\% is distributed across 4 instances: 243%4=60.75%\frac{243\%}{4} = 60.75\%.
3
Determine the scale-in threshold that is lower than the new CPU load to prevent flapping.
A threshold of 50%50\% prevents flapping.
To prevent the scale-in rule from triggering immediately after scaling out, the scale-in threshold must be set to a value below 60.75%60.75\%.

Anahtar Kavram

Autoscale flapping prevention in Azure App Service
Bu soruyu puanla