The right metrics
- CPU: the P95 over 30 days, not the average, which hides peaks.
- Memory: the P95 of used memory. It is only visible with the Azure Monitor agent inside the VM; without it, rightsizing stays risky.
- Disks and network: IOPS and throughput, compared with the limits of the target size.
Azure Advisor is a good starting point: it lists underused VMs, with a configurable threshold and lookback period. We always cross its recommendations with detailed metrics and with application teams, who know the month-end or closing peaks.
The thresholds we apply
| Situation over 30 days | Action | Effect on price |
|---|---|---|
| P95 CPU and P95 RAM below 50% | Drop one size in the same family | About half the price |
| Low P95 CPU, high P95 RAM | Move to a memory family (E) | Same RAM, fewer vCPUs |
| High P95 CPU, low P95 RAM | Move to a compute family (F) | Less RAM paid for nothing |
| Very low average CPU, short peaks | Consider the B family (burstable) | Cheaper, if credits are enough |
| No activity | Stop, then delete after validation | Compute disappears |
Within a family, price follows size: in West Europe, a D2s_v5 costs exactly half a D4s_v5 according to public prices. On a Windows VM, the licence is also billed per vCPU: shrinking the size shrinks the licence too.
Choose the right family
- D: general purpose, 4 GB of RAM per vCPU. The default choice.
- E: memory, 8 GB per vCPU. For databases and RAM-hungry applications. An E2s_v5 costs about 34% less than a D4s_v5, for the same memory.
- F: compute, 2 GB per vCPU. For CPU-bound jobs.
- B: burstable, with CPU credits. For lightly used VMs with brief peaks. Watch out: once credits run out, performance drops.
Move to recent generations
The v5 and v6 generations are cheaper or more powerful than older ones. According to public prices in West Europe, a D4s_v5 costs slightly less than a D4s_v3, and AMD variants (D4as_v5) about 10% less than Intel ones. The v6 costs a few percent more per hour than the v5, but its power per vCPU often lets you drop one size. Changing generation is often the moment to change size as well.
Do not forget disks
Each VM size has a disk IOPS and throughput cap. Before shrinking, check that the target size can handle the measured IOPS peaks. Conversely, a Premium disk oversized to get IOPS can often be replaced by a Premium SSD v2, where capacity and performance are set separately.
Shrink step by step, then reserve
Resizing restarts the VM: schedule it in a maintenance window. Drop one size at a time, watch for one to two weeks, and repeat if the metrics allow. Once the size is settled, reserve: we use an assumption of 54% savings on average with Reserved Instances or a savings plan on an always-on VM. On a D4s_v5 in West Europe, public prices give about 38% over 1 year and 60% over 3 years.