Rightsizing without hurting performance: the safe way to cut cost
Naive rightsizing trims CPU and memory until latency spikes and you roll it back. The safe method holds a performance budget (p95, error rate, headroom) while cutting cost. Here's the method and the traps.
Quick answer
Rightsize against a performance budget, not average utilization. Set explicit limits, p95 latency, error rate, peak headroom, and cut cost only as far as those hold. Size to peak percentiles, leave more margin on memory than CPU, and validate before you deploy. That's the difference between a saving that sticks and one that gets reverted after the next spike.
Rightsizing is the most-recommended and most-reverted cost action there is. The recommendation is easy, "you're at 30% CPU, downsize", and so is the rollback, the first time a spike blows latency. The fix isn't to stop rightsizing; it's to size against the thing that actually breaks.
Averages lie; peaks decide
A daily average of 30% CPU can hide a 95% peak at 9am. Latency and throttling are decided by those peaks, not the mean. Rightsize to the average and you've fit the quiet hours and starved the busy ones. Size against p95/p99 CPU and memory, and peak concurrency, so the configuration survives the moment that matters.
Set a performance budget first
Decide what you won't cross before you cut: p95 under your SLO, error rate under a threshold, and a minimum headroom at peak (say 30%). Now the stopping condition is the budget, not the savings. You cut until the budget says stop, which keeps the win on the right side of the line.
Memory is less forgiving than CPU
Overshoot CPU and you get slower; overshoot memory and you get OOM-killed, a restart, dropped requests, a latency and availability event. Size memory to the peak working set (including cache and buffers) plus margin, and leave more slack on memory than on CPU. This is where aggressive rightsizing does its worst damage.
Watch burstable and credit-based instances
Burstable classes (like the T family) look cheap and idle on average, then fall off a cliff when CPU credits run out under sustained load. If the workload has real baseline demand, a burstable size that fits the average will throttle at peak. See rightsizing EC2 instances for the class-by-class detail, and m5 vs m6i vs m7i for where a newer generation gives more performance per dollar without cutting capacity.
Validate before you ship
The cheapest way to avoid a rollback is to not deploy the undersized configuration in the first place. Compare candidate sizes on cost and modeled performance up front, the same idea as simulating cost and performance before deploy , so the size you ship is already known to meet the budget.
FAQ
Why does rightsizing so often get rolled back?
Because it's driven by average utilization alone. Averages hide the peaks that decide latency. Trim to fit the average and the next spike blows p95 or triggers throttling, so someone reverts the change. Rightsizing sticks only when it's sized against peak behavior and a performance budget, not the mean.
What is a performance budget for rightsizing?
An explicit limit you refuse to cross while cutting cost, for example p95 latency under 200ms, error rate under 0.1%, and at least 30% CPU headroom at peak. You cut spend only as far as the budget allows; the budget, not the savings number, is the stopping condition.
Which signals should I size against?
Peak percentiles, not averages: p95/p99 CPU and memory, peak concurrent requests, and memory working set (including cache and buffers). Also watch credit-based instances (burstable CPU) where the average looks fine but you exhaust credits under sustained load.
Isn't more headroom just wasted money?
Some headroom is insurance, not waste. It absorbs spikes, tolerates a node failure, and keeps tail latency low. The goal isn't zero idle capacity; it's the least capacity that still meets the performance budget. Cutting past that trades a small saving for a large reliability risk.
How do I rightsize memory safely?
Size to the peak working set plus margin, not average usage. Memory is less forgiving than CPU: overshoot the limit and the process is OOM-killed or the container restarts, which is a latency and availability event, not a slow-down. Leave more margin on memory than on CPU.
Can I rightsize before deploying, not after?
Yes. You can compare candidate sizes on cost and modeled performance from the infrastructure definition and expected load before provisioning, so you don't ship an undersized configuration and roll it back. C3X Cloud is building this cost-and-performance simulation on top of the open-source estimator.
What to do next
Price the sizes you're weighing with the open-source C3X CLI, straight from your Terraform. To compare them on cost and modeled p95 before deploy, join the C3X Cloud waitlist. The quickstart gets you a first estimate in minutes.
Share this post
Try C3X on your own Terraform
Free and open source. No API key required. One command to install, one command to estimate.