Right-Sizing Instances Without Hurting Performance
Right-sizing cuts waste only when you measure first. This guide covers the metrics that prove an instance is oversized, a safe resizing procedure, and the workloads to leave alone.
Most cloud bills carry a layer of fat that nobody chose deliberately. Someone picked a size during a rush, the service worked, and the size stuck. Right-sizing is the unglamorous work of matching the machine to the job, and it is usually the cheapest saving available because it needs no architectural change and no contract negotiation.
It is also the easiest optimisation to get wrong. Shrink a database that looks idle on a Tuesday afternoon and you will find out what it does at month end. The difference between a saving and an incident is almost entirely in how you measure before you act.
What right-sizing actually means
Right-sizing is the process of changing the resources allocated to a running workload so that allocation tracks demand with a deliberate margin on top. That margin is the part people skip. You are not aiming for an instance that runs at full utilisation; you are aiming for one that runs comfortably at its normal peak and still has headroom for the spike you have not seen yet.
It applies to more than virtual machines. Oversized block volumes, provisioned throughput nobody uses, managed database tiers chosen for a traffic level that never arrived, and load balancers sitting in front of a single backend all belong in the same review. Compute is simply where the numbers are largest and the evidence is easiest to collect.
Measure before you resize
Collect at least two weeks of data, and preferably a full billing cycle. A shorter window hides the weekly and monthly shape of your traffic. If your business has a quarter end, a payroll run, a sales campaign or an academic term, your sample needs to contain one of them or you are guessing.
Record peaks, not averages. Average CPU across a month is a nearly useless number because it flattens exactly the events that determine the size you need. Capture the 95th and 99th percentile instead, plus the absolute maximum, and look at them per hour so you can see when load arrives. Two servers with identical averages can need entirely different sizes if one is flat and the other is spiky.
If you are working inside an account you inherited rather than built, start by confirming what is actually running. Our guide to securing an inherited cloud account covers the inventory step, and it is worth doing before you touch any instance size, because unused resources are a bigger win than resized ones.
The metrics that prove an instance is oversized
CPU is the obvious one and the least reliable on its own. A machine at low CPU may be waiting on disk, blocked on a lock, or limited by a single threaded process that cannot use the cores it has. Read these signals together:
- Sustained CPU below a quarter of capacity at peak. Not at the average, at the peak. If the busiest hour of the busiest day stays low, the machine is too big.
- Memory committed but never touched. Look at working set and page cache separately. A database that fills memory with cache is using it; an application server holding a flat allocation is not.
- Disk throughput far under provisioned limits. Provisioned IOPS and throughput are billed whether or not you consume them, and this is a frequent source of silent waste.
- Network transfer well below the instance tier it was chosen for. Some sizes exist mainly for their network allowance.
- Run queue length near zero. If processes never wait for a core, extra cores are decoration.
The pattern to look for is a resource that is oversupplied on every axis at once. A machine that is low on CPU but constantly short of memory is not oversized, it is the wrong shape, and the fix is a different family rather than a smaller size.
Changing shape instead of changing size
Providers group instances into families tuned for compute, memory, storage or general use. Moving sideways between families often saves more than moving down within one. A workload that pins memory while leaving cores idle costs less on a memory oriented family at a smaller core count than on a general purpose family sized up until memory fits.
Architecture choice matters here too. Several providers price machines with different underlying processor architectures differently for a similar amount of work. If your stack is interpreted, containerised and built from packages with broad architecture support, testing the alternative is a short experiment with a durable payoff. If you ship a compiled binary with native dependencies, budget real engineering time before you assume it will work.
A resizing procedure that does not cause an outage
Treat every resize as a change with a rollback, because that is what it is. The sequence below has held up across a lot of estates:
- Write down the current size, the observed peak, the target size and the specific metric that would tell you the change was wrong.
- Set an alert on that metric before you change anything, so detection does not depend on someone watching a dashboard.
- Change one instance in a redundant group first. If the workload is a single machine with no replica, add redundancy before you resize, not after.
- Hold at the new size through at least one full traffic cycle, including the weekly peak.
- Only then apply the same change to the rest of the group, and leave a gap between each.
Resizing usually requires a stop and start rather than a live change, which means any data on local ephemeral storage disappears. Confirm what is on the instance before you stop it. Public addresses can also change on stop and start unless they are statically assigned, which surprises people whose firewall rules or external integrations reference the old address. The cloud networking baseline guide explains how to pin addressing so this is a non-event.
Workloads you should leave alone
Some things look wasteful and are not. Resist the urge to shrink these without a strong reason:
- Primary databases. Memory in a database is a cache. Taking it away moves reads to disk, and the latency effect shows up for every query, not just the ones you tested.
- Anything holding a large in-memory index. Search nodes and caches degrade sharply rather than gracefully once the index no longer fits.
- Batch jobs with a deadline. A nightly job that finishes with ninety minutes to spare has ninety minutes of buffer, not ninety minutes of waste.
- Build and CI runners. Slow builds cost engineering hours that dwarf the instance saving.
- Anything with a licence tied to core count. Reducing cores can look clever until the licence terms make the smaller machine more expensive per unit of work.
Right-sizing and the billing model you chose
Resizing interacts with commitments. If you have pre-purchased capacity, dropping to a smaller size may leave part of that commitment stranded, and the saving on paper never reaches the invoice. Do the right-sizing pass first, let the new sizes settle, and buy commitments against the shape you end up with. The relationship between the two is covered in more depth in reserved, spot and on-demand pricing.
The underlying pricing structure differs sharply between providers, which changes how much right-sizing is even available to you. Providers that sell fixed plans give you fewer, coarser steps, so the gap between two sizes can be large. Metered providers offer finer granularity and reward frequent small adjustments. The Hetzner vs DigitalOcean comparison shows that contrast clearly, and if a flat plan suits your pattern better, a Buy Hetzner Account listing or a Buy Contabo Account listing gives you capacity at a price you can predict without any right-sizing at all.
Keeping sizes right after the first pass
A single right-sizing exercise decays. Traffic grows, features ship, and six months later the estate has drifted again. The teams that keep the saving do three things.
They put a recurring review on the calendar, usually quarterly, with a named owner and a short written output. They tag resources at creation with an owner and an environment so the review has something to sort by. And they treat the size as code rather than a console setting, so a change is reviewed, recorded and reversible.
Automatic scaling helps with the daily shape but does not remove the need for the review, because scaling groups still have a configured instance size and that size is just as likely to be wrong. Scaling the wrong size horizontally multiplies the waste instead of removing it.
Finally, check that right-sizing is the right lever at all. If most of your bill is storage, egress or managed services, shaving compute is effort spent in the wrong place. Read the invoice by line item first. The guide on building a cloud budget walks through that breakdown, and if the exercise shows you are paying hyperscaler rates for workloads that do not need hyperscaler features, a Buy Vultr Account option may reduce the bill further than any resize would.