Bound scaling and capacity headroom
As the noon cutoff approaches, Contoso's quote queue can grow because a release failed or because more shops are placing orders. Adding a VM helps with demand only if the new VM can process quotes. Once the release is healthy, you'll use CPU measurements, quota, and Contoso's five-VM ceiling to decide whether to add capacity, remove it, or leave it unchanged.
To keep a capacity change separate from a rollout or repair, Contoso allows only one of these operations at a time:
| Phase | Rollout | Automatic repairs | Scaling |
|---|---|---|---|
| Baseline | Manual | Disabled | Four VMs |
| Release and containment | One rolling operation; no new releases | Disabled | Frozen at four |
| Recovery | One reviewed instance update at a time | Disabled | Frozen at four |
| Individual VM repair | No active rollout | Approved repair action | Frozen |
| Capacity change | No active rollout | Disabled for the independent change | Minimum three, default four, maximum five |
CPU is the worked autoscale signal here, not proof that quotes will finish on time. Also inspect the available queue backlog and oldest outstanding request age, compare arrival and successful completion rates, and assess whether work is progressing within the agreed processing target and remaining time before noon. If the available evidence can't establish that progress, record the uncertainty and escalate it. If progress is inadequate, identify whether quote computation, the queue, or the order system is limiting throughput. A fifth VM might arrive too late or fail to help a downstream bottleneck. Keep the approved five-VM ceiling; escalate a capacity or deadline risk rather than treating a healthy portal summary as sufficient evidence.
In Scaling > Custom autoscale, inspect the active profile, metric, aggregation, bounds, and cooldown. Each minute, statistic: Average produces one CPU average across the VMs. Then timeAggregation: Average averages the last five samples. Autoscale compares that five-minute value with the rule threshold. A fleet average can hide high CPU usage on one VM processing a large shop order, while a maximum can overreact to that VM. Check how work is distributed before tuning the thresholds.
Contoso scales out by one above 70% CPU and in by one below 30%, with a five-minute cooldown. The morning queue illustrates the decisions this policy makes:
| Observation | Capacity decision and reason |
|---|---|
| Four VMs average 80% CPU over the window. | Add one VM, bringing the count to five. Confirm that the quote service on the new VM reports v1 and returns the reference quote. A sixth VM would exceed the approved ceiling. |
| Load drops immediately after scale-out. | Hold during cooldown. After the cooldown, if average CPU remains below 30%, autoscale can remove one VM, leaving four. It can remove another only after the next cooldown if the scale-in conditions still hold. Stop at three. |
| Metrics disappear when the scale set has five VMs. | Missing CPU data doesn't mean CPU usage is 0%. If five VMs are running, autoscale won't remove one just because the default capacity is four. If metrics are unavailable at three, autoscale can increase capacity to the safe default of four. Inspect metric availability, dimensions, and evaluation history. |
| Someone proposes a 65% scale-in threshold while four VMs average 64% CPU. | Assuming unchanged, evenly distributed work, three VMs would average 64% x 4 / 3, or about 85.3%. That's above the 70% scale-out threshold. Defer the reduction to avoid an immediate reversal. |
With multiple rules, any satisfied scale-out rule can trigger growth, but all applicable scale-in rules must hold for a reduction. Separated thresholds and cooldown reduce flapping; they don't guarantee it won't occur. Consult Run history and the Activity log for the actual decision, including failed, deferred, or adjusted changes. A manual capacity change demonstrates allocation or removal, not metric-rule evaluation.
Before an approved manual change, freeze competing automation and verify headroom. Adjust capacity by one VM at a time. After each change, check the actual VM count, application health, and reference quote; before scaling in, confirm that in-flight requests can finish or retry safely. Azure's scale-in choice depends on policy, zone balance, and protection, not an assumed deletion order. An autoscale maximum or a template parameter limit can't constrain every privileged API call, surge allocation, or other controller. Contoso enforces its ceiling with one authorized operator, no surge, no overprovisioning or overlapping termination notifications, and observed counts.