AWS Compute Optimizer Cost Optimization EC2 EBS FinOps

AWS Compute Optimizer — Stop Guessing, Start Rightsizing

P90 vs P99.5. Max savings vs Max performance. 14, 32, or 93-day lookback. Locking recommendations to your dedicated host family. Everything you need to actually tune Compute Optimizer for your workloads — not just accept the defaults.

VR
Vishnu Rachapudi
Cloud & AI Engineer · AWS Community Builder (Security)
4 Utilization presets
3 Lookback windows
1093 Instance types to pin
$0 Cost for 32-day lookback

AWS Compute Optimizer has been recommending right-sized EC2, EBS, Lambda, RDS, Aurora, and ECS resources since 2019. Most teams enable it, glance at the dashboard, and leave everything on defaults. That's a missed opportunity — because the defaults are conservative by design, and your workload almost certainly isn't a one-size-fits-all pattern.

In this post I'll walk through every tunable knob in Compute Optimizer's Rightsizing Preferences: what each setting actually means, when to change it, and how to lock recommendations to the exact instance families running in your environment.

What Compute Optimizer does — and what it covers

Compute Optimizer uses machine learning on CloudWatch utilization metrics to detect over-provisioned and under-provisioned resources and recommend optimal replacements. It works across:

EC2 Instances
Instance type, size, and family recommendations. Supports CPU + memory headroom and threshold tuning.
EC2 Auto Scaling Groups
Same signals as EC2, applied at the ASG level with launch configuration awareness.
EBS Volumes
Volume type and size recommendations. Lookback period configurable (14 or 32 days).
Lambda Functions
Memory size recommendations based on duration and cost patterns.
RDS & Aurora
DB instance class recommendations. Only lookback period is configurable for RDS.
ECS on Fargate
CPU and memory allocation recommendations for Fargate task definitions.

Rightsizing preferences — the focus of this post — apply primarily to EC2 and EC2 ASG recommendations, with lookback period options also available for EBS and RDS.

Rightsizing Preferences — the overview

Navigate to Compute Optimizer → Preferences → Rightsizing. Select the resource type (EC2 instances including ASG is the most feature-rich) and preference level (organization, account, or regional).

You'll land on the current defaults summary. For EC2 + ASG, the default state shows:

EC2 and EC2 Auto Scaling groups Default regions
Preferred EC2 instances
Instance types and sizes
Show preferred resources
CPU utilization
Headroom: 20% (default)
Threshold: P99.5 (default)
Memory utilization
Headroom: 20% (default)
Lookback period
14 days (default)

Hit Edit and you're walked through a four-step wizard: Regional scope → Lookback period & metrics → Preferred EC2 instances → Review & save.

Lookback period: 14, 32, or 93 days

This is the first thing to tune. The lookback period determines how many days of CloudWatch utilization data Compute Optimizer uses to generate recommendations.

14
Days — Default
Captures two weeks of data. Good for workloads with stable, daily patterns. Free.
32
Days — Free
Captures ~one month. Accounts for month-end processing, monthly patches, and maintenance reboots. Free. Strongly recommended as a baseline.
93
Days — Paid (Enhanced)
Requires Enhanced Infrastructure Metrics (~$0.25/month per EC2 instance). Captures quarterly cycles — best for workloads with end-of-quarter spikes.
Practical advice: Switch to 32 days for free as your baseline. You'll catch monthly patterns — patch windows, scheduled jobs, month-end batch runs — that a 14-day window can miss entirely, leading to under-provisioned recommendations.

The 93-day option requires enabling Enhanced Infrastructure Metrics. When you click it in the console, you'll see the confirmation dialog before it activates:

Enable enhanced infrastructure metrics

An extended lookback period of 93 days is available as part of Enhanced infrastructure metrics. This is a paid feature by region.

For EBS volumes, the console shows only 14 or 32 days (no 93-day option). Same for ECS. The 93-day window is EC2/ASG-specific.

Utilization presets: Max savings → Max performance

This is the most impactful setting most teams never touch. Compute Optimizer gives you four named presets that bundle a CPU threshold (P90/P95/P99.5) and CPU headroom (0%/20%/30%) together into a single choice.

Utilization presets
Choose a preset that reflects the performance sensitivity and cost optimization goals for your workload. The preset configures CPU threshold and headroom together.
Max savings
Balanced
Default
Max performance

Here's exactly what each preset configures under the hood:

Preset CPU Threshold CPU Headroom Best for
Max savings ↓ Cost P90 0% Non-production, dev/test environments where peak spikes are acceptable and cost pressure is high
Balanced P95 30% General-purpose workloads with moderate sensitivity to peak utilization — a good middle ground
Default Default P99.5 20% The out-of-box setting. Conservative — suited for most production workloads without customization
Max performance ↑ Perf P99.5 30% Mission-critical production where performance headroom matters more than cost savings
Key insight: "Max savings" doesn't mean Compute Optimizer ignores cost elsewhere — it means the recommendation algorithm uses P90 threshold (ignores top 10% of spikes) and 0% headroom. The resulting instance size suggestion will be smaller, so actual savings depend on whether your workload can tolerate that tighter fit.

CPU metrics: threshold (P90 / P95 / P99.5) + headroom

Understanding P-values here is important. The threshold determines which data points Compute Optimizer considers when analyzing your CPU history.

Threshold — what P90, P95, P99.5 mean in practice

Over a 14-day period at 5-minute CloudWatch resolution, you have roughly 4,032 data points per instance.

  • P99.5 (default) — ignores the top 0.5% of highest CPU data points (~20 data points). Best for sensitive production workloads where occasional spikes genuinely stress the system.
  • P95 — ignores the top 5% (~200 data points). More tolerant of brief spikes. A reasonable middle ground for workloads that burst occasionally but not critically.
  • P90 (least sensitive) — ignores the top 10% (~400 data points). Aggressive. The recommendation will be tuned to non-peak steady-state load. Use only for workloads where those spikes genuinely don't matter — dev/test, batch jobs with retry logic, etc.
CPU usage — Max savings preset (P90 threshold, 0% headroom)
Max savings
Balanced
Default
Max performance
Threshold: P90 (least sensitive)  |  Headroom: 0% (no added capacity)
CPU utilization (simulated)
100% 80% 60% 40%
14 days (Lookback Period) · t-13 → t-0
CPU utilization Headroom Threshold

Headroom — buffer capacity on top of observed peak

Headroom adds a percentage buffer above the observed utilization ceiling, so the recommended instance has room to absorb burst above what history recorded.

  • 0% headroom — no extra capacity. Recommendation is sized exactly to the threshold utilization level. Maximises savings, minimises buffer.
  • 20% headroom (default) — recommended instance has 20% CPU overhead above the observed threshold peak. The AWS-tested sensible default.
  • 30% headroom — higher buffer. Used in Balanced and Max performance presets. Good when your workload has unpredictable growth or you want a comfortable safety margin in production.
Example: If your instance's P99.5 CPU peak over 14 days is 55%, Default preset (P99.5 + 20% headroom) will recommend an instance sized to handle ~66% CPU. Max performance (P99.5 + 30% headroom) targets ~71.5%. Max savings (P90 + 0%) will look at a lower percentile peak and add nothing — much smaller recommendation.

Memory utilization headroom

Memory preferences are simpler — there's no threshold setting, only headroom (10%, 20%, or 30%). The memory headroom chart shows a much smoother utilization line than CPU, which is typical — memory tends to be allocated rather than bursty.

Memory usage — 30% headroom selected
Headroom Info
Utilization headroom is added memory capacity beyond historical usage.
Memory utilization (simulated)
100% 80% 60% 40%
14 days (Lookback Period)
Memory utilization Headroom
Note: Memory metrics require the CloudWatch agent to be installed and reporting memory utilization. If you don't have the CloudWatch agent configured on your EC2 instances, Compute Optimizer won't have memory data and this setting won't affect your recommendations.

Preferred EC2 instances — locking to your host family

This is the setting that directly answers the dedicated host question. If your organisation has committed to a specific instance family — say r6i on dedicated hosts — you don't want Compute Optimizer suggesting m7g, c6a, or anything outside your licensed footprint. Preferred instances let you constrain the recommendation output.

Preferred EC2 instances Info
Choose the EC2 instances you want in your recommendation output. This doesn't prevent Compute Optimizer from generating recommendations for any of your workloads.
Any instance type
Compute Optimizer considers all instance types and sizes when generating recommendations.
Limit to specific instance types and sizes
Choose the EC2 instances you want in your recommendation output.
Preferred instance types and sizes (1093/1093)
▼ Search by instance families
🔍 Find instance types 1 2 3 ›

Here's how to configure this for a dedicated host running r6i instances:

1
Select "Limit to specific instance types and sizes"
This enables the instance type picker. It narrows the recommendation output but does not prevent Compute Optimizer from analyzing other instance types — it only affects what shows up in your recommendation results.
2
Search for your instance family (e.g. r6i)
Use the "Search by instance families" dropdown or type directly in "Find instance types". With 1,093 types available across all families, filtering by family first is fastest. Select all sizes within r6i (r6i.large through r6i.metal) that are valid on your dedicated host capacity.
3
Save preferences at the right scope
Apply at the regional level (e.g. us-east-1 only) if your dedicated hosts are region-specific, rather than account-wide. This way other regions still get broader recommendations.
4
Wait ~24 hours for recommendations to regenerate
Compute Optimizer reprocesses recommendations within 24 hours of a preference save. After that, your rightsizing suggestions will only reference sizes within your pinned family.
Why this matters for dedicated hosts: Dedicated hosts are licensed and billed per host, not per instance. A recommendation to move from r6i.4xlarge to m7g.2xlarge is useless — you can't run m7g on an r6i host. Pinning to the r6i family means every recommendation is a rightsizing move you can actually execute without touching your host allocation or licence coverage.

EBS volume preferences

EBS has its own preferences section, separate from EC2. The options are simpler — only lookback period is configurable (14 or 32 days). No threshold or headroom controls.

EBS volumes Default regions
If you haven't set any rightsizing preferences, Compute Optimizer considers all available EBS volumes and uses the default values to generate recommendations.
Lookback period
Lookback period
14 days (default)

Switching EBS to 32 days is free and worth doing — monthly storage patterns (snapshot schedules, nightly ETL writes, month-end archiving) won't show up in a 14-day window and can lead to over-sized volume recommendations if your workload is genuinely spiky on a monthly cadence.

Regional scope + how preferences propagate

Every preference set is scoped. The hierarchy is: Organization → Account → Region. A more specific scope overrides a broader one for that resource.

Regional scope
Specify the Regions where you want Compute Optimizer to apply your rightsizing recommendation preferences.
Any region
Compute Optimizer applies preferences to all available Regions.
Custom regions
Compute Optimizer only applies preferences for the Regions you specify.
Regions
✅ US East (N. Virginia) us-east-1
✅ US East (Ohio) us-east-2
✅ US West (Oregon) us-west-2
✅ Asia Pacific (Hyderabad) ap-south-2
✅ Asia Pacific (Mumbai) ap-south-1
✅ Asia Pacific (Singapore) ap-southeast-1
Important: "Any new changes you might make could affect existing Region rightsizing preferences" — the console warns you of this on the review page. If you've previously set region-level overrides, an org-wide or account-wide change won't automatically override them. Check your region-specific settings after any broad update.

Which preset should you actually use?

Here's a practical decision matrix based on workload type — not the marketing names:

Workload Recommended preset Lookback Notes
Dev / test environment Max savings 14 days Cost matters more than peak headroom. Workload retries are acceptable.
Batch / scheduled jobs Max savings or Balanced 32 days 32-day lookback essential to capture monthly batch patterns.
General web / API workloads Default 32 days P99.5 + 20% headroom + 32-day lookback is a solid general-purpose config.
Stateful production (DB, cache) Max performance 32 or 93 days P99.5 + 30% headroom. If quarterly patterns exist, enable enhanced metrics for 93 days.
Dedicated hosts (r6i, etc.) Default or Max performance 32 days Pin preferred EC2 instances to the host family. This is the critical step — without it the preset choice is secondary.

None of this is a "set and forget" configuration. As your workloads evolve — new deployments, scaling events, architectural changes — revisit your preferences. The Rightsizing preferences page shows a summary of current settings, and every preference change regenerates recommendations within 24 hours.

Quick wins checklist:
✓ Switch EC2 lookback to 32 days (free, immediate improvement)
✓ Pin preferred instance families if you're on dedicated hosts or have licensing constraints
✓ Use Max savings preset on non-prod to surface more aggressive recommendations for dev/test
✓ Enable the CloudWatch agent if you haven't — memory metrics are off without it
✓ Set regional scope carefully if you have dedicated host regions with specific family constraints

Compute Optimizer is one of the few AWS services where the recommendations improve the more you tell it about your constraints. The defaults are intentionally conservative — override them where you know better.