azurecost-optimizationvirtual-machinesright-sizing

Azure VM right-sizing guide: cutting compute waste by family

Most Azure VM bills carry oversized instances that never touch their allocated CPU or memory. Right-sizing to the correct family and size, then layering reservations, is the highest-return Azure cost move. Here is how to do it.

The C3X Team··6 min read

Quick answer

Right-sizing an Azure VM means matching the family and size to real CPU, memory, and disk usage instead of a guess. A D4s v5 (4 vCPU, 16 GB) runs about $0.192 per hour, roughly $140 per month, while a D2s v5 at half that is about $70 per month, so dropping one size on an idle VM halves its cost. The steps are: read Azure Monitor for CPU and memory percentiles over two to four weeks, drop to the smallest size that keeps P95 utilization under about 70 percent, switch memory-light workloads from E-series to D-series, and then reserve the steady VMs for a further 40 to 60 percent off.

Virtual machines are usually the largest line on an Azure bill, and most of that line is avoidable. Teams pick a size once, during a rushed provisioning, and the VM keeps that size for years while its actual load sits far below what it pays for. Right-sizing is the discipline of matching the VM family and size to measured usage, and on Azure it is the single highest-return cost action you can take.

What a size drop actually saves

SizevCPU / RAMApprox per hourApprox per month
D2s v52 / 8 GB$0.096~$70
D4s v54 / 16 GB$0.192~$140
D8s v58 / 32 GB$0.384~$280
E4s v54 / 32 GB$0.252~$184

Azure VM pricing is close to linear in size, so every step down roughly halves the cost. A D8s v5 that idles at 15 percent CPU is paying about $280 per month to do the work of a D2s v5 at $70. The saving from one honest right-sizing pass across a fleet often reaches 30 to 50 percent, before any commitment discount.

Reading the numbers before you cut

Pull two to four weeks of CPU and memory data from Azure Monitor and look at the 95th percentile, not the average. Averages hide short peaks that matter; P95 tells you what the VM truly needs. If P95 CPU sits under 35 percent and memory has ample headroom, the VM is a size too big. Aim to land the new size so P95 utilization is around 60 to 70 percent, which leaves margin for spikes without paying for idle. This is the Azure version of the same discipline in the EC2 right-sizing guide.

Family matters as much as size

Picking the wrong family wastes money even at the right size. The D-series is general purpose with a balanced CPU-to-memory ratio; the E-series is memory-optimized and costs more per vCPU because it carries extra RAM. A CPU-bound service running on E-series is paying for memory it never uses, so moving it to D-series cuts cost with no performance loss. The F-series suits compute-heavy work, and the B-series suits bursty, mostly idle workloads, covered in the B-series burstable guide. Match the family to the shape of the workload before you argue about size.

Then reserve what is steady

Right-sizing and reservations compound. Once a VM is the correct size and you know it will run steadily for a year or more, a one-year reservation cuts roughly 40 percent and a three-year cut roughly 60 percent off the pay-as-you-go rate, as the Azure reservations guide details. The order matters: reserve first and you lock in an oversized VM for three years. Right-size first, then reserve the correct size, and the two savings stack. For non-production VMs that tolerate interruption, spot VMs cut up to 90 percent instead.

Making right-sizing continuous

Right-sizing is not a one-time cleanup. Workloads change, so re-check utilization quarterly and after major releases. Azure Advisor surfaces right-sizing recommendations automatically, and tagging VMs by owner and environment makes it clear who should act on an oversized instance. The best time to catch an oversized VM, though, is before it is deployed. Price the VM size against the resource catalog at design time so the cost of a D8s v5 versus a D2s v5 is a number in the pull request, not a surprise on the invoice.

FAQ

How do I right-size an Azure VM?

Pull two to four weeks of CPU and memory data from Azure Monitor, look at the 95th percentile rather than the average, and drop to the smallest size that keeps P95 utilization around 60 to 70 percent. Because Azure VM pricing is roughly linear in size, each step down halves the cost, so a D8s v5 idling at low CPU can often move to a D2s v5 and cut its bill by three quarters.

How much does right-sizing Azure VMs save?

A single honest right-sizing pass across a fleet commonly cuts 30 to 50 percent before any commitment discount, because most VMs are provisioned a size or two larger than their measured load. A D4s v5 at about $140 per month dropping to a D2s v5 at about $70 halves that VM's cost, and the savings stack with reservations once the correct size is locked in.

Should I use D-series or E-series Azure VMs?

Use D-series (general purpose, balanced CPU to memory) for most workloads and E-series (memory-optimized) only when the workload genuinely needs the extra RAM. E-series costs more per vCPU because it carries more memory, so a CPU-bound service on E-series pays for memory it never uses. Moving such a workload to D-series cuts cost with no performance loss.

Should I right-size or reserve first?

Right-size first, then reserve. Reserving first locks an oversized VM into a one or three year commitment, so you pay a discounted rate on capacity you do not need. Right-sizing to the correct size and then buying a reservation on that size stacks the two savings: roughly 30 to 50 percent from right-sizing and a further 40 to 60 percent from the commitment.

How does C3X help with Azure VM right-sizing?

C3X prices VM sizes from your Terraform before you deploy, so the difference between a D8s v5 and a D2s v5 is visible in the pull request rather than discovered on the monthly bill. That lets you catch an oversized VM at design time, choose the correct family and size upfront, and confirm a reservation is being bought against the right size.

What to do next

Catch oversized Azure VMs before they deploy. C3X reads your Terraform and prices your resources against a live catalog. Start with the quickstart.

Try C3X on your own Terraform

Free and open source. No API key required. One command to install, one command to estimate.