Soru

Zorluk: OrtaConfigure Azure Monitor Autoscale Rules and Metrics

An Azure App Service plan named `asp-gateway` is currently running a microservice API gateway on the Standard S1 tier with 22 instances. You configure a scale-out autoscale rule that increases the instance count by 11 when the Average CPU percentage is greater than 80%80\% for 1010 minutes. To optimize costs when traffic decreases, you need to define a scale-in rule that decreases the instance count by 11. Which configuration should you choose to prevent autoscale flapping and ensure the rules function correctly?

  1. Configure the scale-in rule with a threshold of 50%50\% CPU percentage using the Average metric aggregation.Cevap
  2. B
    Configure the scale-in rule with a threshold of 60%60\% CPU percentage using the Average metric aggregation.
  3. C
    Configure the scale-in rule with a threshold of 70%70\% CPU percentage using the Average metric aggregation.
  4. D
    Configure the scale-in rule with a threshold of 50%50\% CPU percentage and downgrade the App Service plan to the Basic B1 tier.

Cevap

Configure the scale-in rule with a threshold of 50%50\% CPU percentage using the Average metric aggregation.
The configuration with a threshold of 50%50\% CPU percentage using the Average metric aggregation prevents flapping. When running on 22 instances at 80%80\% CPU utilization (total of 160%160\%), scaling out to 33 instances reduces the average CPU utilization per instance to approximately 53.3%53.3\%. Since 53.3%53.3\% is greater than the 50%50\% scale-in threshold, the autoscale engine will not immediately trigger a scale-in. Additionally, the Standard S1 tier supports autoscale rules.

Adım Adım Çözüm

1
Calculate the total CPU capacity utilized at the scale-out threshold.
Total capacity utilized is 2×80%=160%2 \times 80\% = 160\%.
Before scaling out, the workloads are distributed across 22 instances, each approaching 80%80\%. The total load across all instances is the product of the instance count and the average CPU utilization threshold.
2
Calculate the average CPU utilization per instance immediately after scaling out.
New average utilization is 160%/353.3%160\% / 3 \approx 53.3\%.
When a scale-out is triggered, the instance count increases by 11 (totaling 33 instances). The total workload of 160%160\% is now distributed across these 33 instances, assuming uniform load distribution.
3
Determine the maximum allowable scale-in threshold to prevent flapping.
The scale-in threshold must be strictly less than 53.3%53.3\%.
If the scale-in threshold is set to a value higher than 53.3%53.3\% (such as 60%60\% or 70%70\%), the autoscale engine will immediately trigger a scale-in action after a scale-out event, creating a continuous loop of scaling up and down (flapping).
4
Verify hosting plan compatibility.
The App Service plan must remain on at least the Standard S1 tier.
Custom autoscale rules based on metrics require the Standard, Premium, or Isolated tier. Downgrading to the Basic B1 tier disables the autoscale engine's capabilities.

Anahtar Kavram

To prevent autoscale flapping, the scale-in metric threshold must be sufficiently lower than the post-scale-out utilization value, and the hosting plan must support autoscaling.
Tahmini Süre:1m 30s
Bu soruyu puanla