Skip to main content
FinOps

Azure VM Rightsizing: How to Cut Costs Without Guessing

How to choose the right Azure VM size using CPU, memory, disk, network and application data, with a practical test plan and honest savings calculations.

9 min read
Microsoft Azure logo

An Azure VM has averaged 8% CPU for a month. Moving it to a smaller size seems obvious. Then you check memory and find it is already close to full during the nightly import.

That is why Azure VM rightsizing needs more than one chart. You are choosing capacity for the work the machine must do, including the busy periods that an average can hide.

The practical approach is to collect representative data, check the workload's limits, test a suitable size, and compare both performance and cost afterward. Sometimes that means a smaller VM. Sometimes it means a different family, a schedule, or more capacity.

Decide whether the VM needs to run first

Before comparing sizes, ask the owner what would happen if this VM stopped.

A machine left over from a completed test may need to be retired. A development environment used only during office hours may benefit more from scheduling. A service that runs continuously but uses little of its allocated capacity is a better rightsizing candidate.

This avoids spending a week finding the perfect size for a machine nobody needs.

It also helps separate low use from deliberate spare capacity. A failover server can be mostly quiet and still be correctly sized for the load it must carry during an outage. Ask about that expected load before making a recommendation.

What to measure for Azure VM rightsizing

CPU matters, but the VM also has memory, disk, and network limits. A smaller size can change several of them together.

SignalWhat to examineWhy it can block a smaller VM
CPUBusy periods, sustained use, and hot individual coresAn average can hide short peaks or a single busy thread
MemoryUsed and available memory, paging, application limitsHalving RAM can create memory pressure even when CPU is low
DiskIOPS, throughput, latency, and throttlingThe smaller VM may support less storage traffic
NetworkTraffic peaks and workload throughput needsNetwork capacity can become the new limit
ApplicationResponse time, errors, queue age, and job durationInfrastructure charts do not tell you whether users are getting acceptable service

Azure provides host metrics without additional setup. Guest operating system data may need extra collection. Microsoft's VM monitoring guide describes Azure Monitor Agent and data collection rules for guest data.

Check that memory data is actually being collected. A blank chart does not mean the VM is using no memory.

For disks, compare the target VM's limits as well as the disks' own limits. A disk that can deliver enough IOPS does not help if the VM cannot pass that traffic through. The Azure VM size documentation is the place to check the candidate's specifications.

Choose a period that includes the real workload

A week can tell you about a weekly cycle. It cannot tell you what happens during month-end reporting if month-end is outside that week.

For an initial review, 14 to 30 days is a useful starting point. Extend it when the application has monthly jobs, seasonal peaks, or infrequent imports. This is a practical starting point, not an Azure requirement.

Keep the context with the chart. Was this a normal working month? Was traffic unusually low? Did a dependency fail and prevent jobs from running? A period with little completed work is poor evidence for the capacity a healthy system needs.

Look at percentiles as well as averages. P95 is the value at or below which 95% of the samples fall. It shows more of the busy periods, but the remaining 5% can still contain an important batch job. Inspect those peaks rather than treating one percentile as the answer.

Also check the chart's time interval. A five-minute average can smooth out a short burst that matters to response time. Keep application latency and job completion data beside the infrastructure metrics.

Use Azure Advisor as a starting point

Azure Advisor provides cost recommendations to resize or shut down underused VMs. Its resize analysis considers CPU, memory, and outbound network utilization. The default lookback is seven days, with longer configurable periods available. It also checks factors such as regional availability and supported capabilities. See Microsoft's recommendation methodology.

Review the recommendation against what you know about the application. Does the observation period include your largest batch? Is the machine part of a failover pair? Is disk throughput the reason it was sized this way?

Treat a recommendation as a candidate for a change. It is useful evidence, but the application owner still needs to confirm that the proposed capacity fits the work.

Advisor's estimated savings also need a billing check. A cheaper retail price does not tell you what happens to your existing reservations or savings plan.

Work through a candidate before changing it

Suppose a VM has 8 vCPUs and 32 GiB of RAM. Over a representative period, its P95 CPU is 20%, its P99 memory use is 11 GiB, and its highest observed memory use is 12 GiB.

A candidate with 4 vCPUs and 16 GiB deserves a test. As a rough first estimate, the same CPU work could use about 40% of four comparable vCPUs. The observed 12 GiB memory peak would use 75% of the smaller VM's RAM.

That calculation is only a screening step. It assumes similar CPU performance and unchanged workload behavior. It does not account for changes in caching, concurrency, processor generation, or storage and network limits.

Now change one fact: the workload needs 25 GiB during its main import. The 16 GiB candidate no longer fits, however attractive its CPU chart looks. You could investigate a memory-focused size, tune the application, or keep the existing capacity until you have a better option.

This is a useful way to discuss rightsizing with an owner: show the constraint that determines the size, rather than asking them to accept a percentage saving without context.

Compare families as well as sizes

You do not always need a smaller version of the same VM.

A workload using substantial memory but little CPU may fit a different memory-to-CPU ratio. A newer generation may offer better value, provided the application and region support it. An architecture change needs its own compatibility testing; do not assume existing software will run unchanged.

Burstable B-series VMs deserve a separate check. They build CPU credits below their baseline and spend credits above it. Once credits run out, CPU performance falls back to the baseline. A low monthly average does not prove that a long busy period will fit. Check credit behavior using Microsoft's B-series CPU credit model.

Compare total cost too. Include operating system and application licensing where applicable. A lower infrastructure rate may not produce the same percentage reduction in the full workload bill.

Plan the resize as an application change

Changing the size of a running Azure VM causes a restart. Some changes require deallocation because the current hardware cluster cannot provide the target size. Microsoft's resize guide also documents compatibility restrictions, including disk-related differences between sizes.

Before the change, record the current size, the target, the baseline performance, and the rollback steps. Confirm backups and recovery procedures for stateful workloads. Check region and zone availability, quota, disk and network capabilities, and temporary storage use.

Then test in staging or on a suitable member of a redundant service. Make the change during an agreed window and compare the same application measures you collected before it.

Set rollback conditions in advance. For example, the owner might require rollback if response time exceeds the service target, the batch misses its deadline, or sustained paging starts. Use the application's requirements to choose those conditions.

Keep the previous configuration ready, but remember that capacity is not guaranteed just because the old size worked earlier. Plan for allocation failure as well as application failure.

Calculate savings without counting them twice

Use comparable rates and the same period for both options. Here is an example using illustrative compute prices, 28 days, and no commitments:

OptionHourly compute rateRunning hoursCompute cost
Current VM, always running$0.40672$268.80
Smaller VM, always running$0.24672$161.28
Smaller VM, 10 hours each weekday$0.24200$48.00

Rightsizing alone saves $107.52, or 40% of compute cost in this example. Rightsizing plus scheduling saves $220.80, or about 82% against the original baseline. You cannot add the separate percentage savings because the schedule applies to the new hourly rate.

Disks, networking, monitoring, automation, and software costs need their own calculation. Use your actual contracted rates rather than treating these numbers as an Azure price quote.

Check commitments before reporting a cash saving. A reservation can transfer to matching usage within its scope, but unused reserved hours do not carry forward. See how Azure reservation discounts apply. Review savings-plan utilization too when the change reduces eligible spend.

Confirm the result after the change

Observe the resized VM through a complete relevant workload cycle. If a monthly import determined the original size, a quiet afternoon cannot validate the new one.

Compare response time, errors, memory pressure, disk latency, and job completion time. Check the billing data once the changed usage appears. Keep estimated savings separate from the savings you can actually verify.

CloudYali's Cost Savings view brings opportunities from supported cloud providers into one place and tracks their progress. Pair that with Cost Explorer when checking whether a completed change reduced spend.

For the first change, choose a VM with a known owner and a workload you can test. Record why the new size fits, what would trigger rollback, and what the change actually saved. That gives the next team a useful example to follow.

Common questions

Is low CPU enough to rightsize an Azure VM?

No. Check memory, disk, network, and application performance. Low CPU can also mean that the application is waiting on another bottleneck.

How much spare capacity should I keep?

There is no single percentage that fits every workload. Leave room for observed peaks, expected growth, and any failover load. Test against the service's response-time or completion-time requirements.

Does Azure VM rightsizing cause downtime?

Resizing a running VM causes a restart, and some changes need deallocation. A redundant application may maintain service through the change, but that depends on its design and rollout procedure.

  • #Azure
  • #Virtual Machines
  • #Rightsizing

Related reading

More on FinOps