Question

Difficulty: HardConfigure Virtual Machine Scale Sets (VMSS)

A company hosts a web application on an Azure Virtual Machine Scale Set (VMSS) named `vmss-web`. The scale set is configured with Uniform orchestration mode, has a current instance count of 33, and uses a Manual upgrade policy. You configure an autoscale setting with the following rules:

* A scale-out rule that increases the instance count by 33 when the average CPU percentage is greater than 80%80\% for 1010 minutes.
* A scale-in rule that decreases the instance count by 33 when the average CPU percentage is less than 50%50\% for 1010 minutes.

During a peak load event, the scale set scales out to 66 instances. However, immediately after the scale-out completes, the average CPU percentage drops to 45%45\%, which triggers a scale-in back to 33 instances. This loop of scaling out and scaling in continues repeatedly. You need to prevent this thrashing behavior.

What configuration change should you implement?

  1. A
    Change the VMSS upgrade policy from Manual to Automatic.
  2. B
    Change the orchestration mode of the VMSS from Uniform to Flexible.
  3. Decrease the scale-in CPU threshold to 35%35\%.Answer
  4. D
    Increase the scale-out CPU threshold to 95%95\%.

Answer

Decrease the scale-in CPU threshold to 35%35\%.
Decreasing the scale-in threshold to 35%35\% prevents the scale-in rule from triggering immediately after a scale-out. When the scale set expands from 33 to 66 instances, the average CPU load is divided by two, dropping from 80%80\% to 40%40\%. Because 40%40\% is greater than the new 35%35\% threshold, the instances remain running and thrashing is avoided.

Step-by-Step Solution

1
Calculate the total CPU load baseline prior to scaling.
The total CPU capacity utilized just before scale-out is approximately 3×80%=240%3 \times 80\% = 240\%.
This establishes the total amount of computational work being performed by the instances.
2
Calculate the post-scale-out CPU load distribution.
When 33 instances are added, the scale set size increases to 66 instances. The average CPU per instance becomes 240%/6=40%240\% / 6 = 40\%.
This identifies the average load per virtual machine after the additional capacity is provisioned.
3
Compare the new load against the scale-in threshold.
The post-scale-out average CPU of 40%40\% is lower than the current scale-in threshold of 50%50\%, triggering an immediate scale-in.
This shows why the scale-in rule is immediately satisfied, resulting in instance thrashing.
4
Identify the threshold adjustment to prevent the loop.
Setting the scale-in CPU threshold to 35%35\% (which is below the post-scale-out load of 40%40\%) stops the scale-in rule from triggering.
This maintains the scale set at 66 instances during the high-load period without falling into a loop.

Key Concept

Autoscale Thrashing Mitigation in VMSS
Rate this question