Resource Optimization with AWS Compute Optimizer - Instance Rightsizing

Analyzes CloudWatch metrics with ML and generates recommendations that optimize resource sizes for EC2 / Lambda / EBS / ECS Fargate. This article explains how to use Graviton migration recommendations and improve accuracy with enhanced metrics.

Overview of Compute Optimizer

AWS Compute Optimizer is a service that analyzes CloudWatch metrics with ML and provides recommendations that optimize the resource sizes of EC2 instances, Lambda functions, EBS volumes, and ECSFargate tasks. It detects over-provisioned resources and presents cost reduction opportunities as monetary amounts. Recommendations are generated toward reducing costs while maintaining current performance. Trusted Advisor also provides resource optimization recommendations, but Compute Optimizer analyzes usage with ML and goes as far as showing specific instance type candidates. Whereas Cost Explorer recommendations center on optimizing purchases of Reserved Instances and Savings Plans, Compute Optimizer focuses on rightsizing resources.

Recommendation Types and Graviton Migration

EC2 recommendations present a comparison of the current instance type with the recommended type, the estimated cost savings, and the performance risk. Examples of recommendations include changing the instance family (m5 → m6i), changing the size (xlarge → large), and migrating to Graviton (m5 → m6g). AWS states that Graviton-based instances cost up to 20% less than comparable x86-based EC2 instances (as of October 2026). Lambda recommendations present memory size optimizations, which let you reduce excessive memory allocation. Because Lambda allocates CPU in proportion to memory, optimizing memory also leads to shorter execution times. EBS recommendations suggest migrating from gp2 to gp3 and optimizing IOPS and throughput. Because gp3 has higher baseline performance than gp2 and lets you configure IOPS and throughput independently, moving from gp2 can lower costs in some cases.

Enhanced Metrics and Applying Recommendations

By default, recommendations are generated based on the past 14 days of CloudWatch metrics, but by enabling enhanced infrastructure metrics, you can obtain more accurate recommendations based on 93 days of data. Recommendations are then generated that take into account usage patterns that a short period cannot capture, such as month-end batch processing and peaks during quarterly closing. Recommendations come with a performance risk assessment, and one approach is to apply the low-risk recommendations first. One possible operating practice is to review recommendations regularly (for example, monthly) and change instance types step by step. Through integration with Organizations, you can manage recommendations for all accounts centrally and make cost reduction opportunities across the whole organization visible.

Compute Optimizer Pricing

The basic features of Compute Optimizer are available for free. Enhanced infrastructure metrics (metrics analysis over 93 days) are paid, at about $0.0003360215 per resource per hour of running time (as of October 2026). Because charges are proportional to the number of resources and their running time, one way to use the feature is to limit what you enable it for to resources that need metrics over a long period. A feature is available that adds metrics from APM tools such as Datadog and Dynatrace to the inputs of recommendations.

Reading Recommendations and Making Decisions

Compute Optimizer analyzes whether a resource is over-provisioned or under-provisioned and presents candidates for an appropriate size. When you look at recommendations, you check not only the projected savings shown but also the performance risks that come with the change. Over-provisioned resources can be scaled down to lower costs, but under-provisioned resources cause performance problems unless they are scaled up. Because recommendations show which metrics they are based on, you judge their validity by comparing them with the characteristics of your own workload. It is important not to follow them mechanically but to decide whether to adopt a recommendation while also considering peak load and future growth.

The Workflow for Applying Recommendations

When applying recommendations, you follow careful steps rather than reflecting them in production right away. First, confirm in a test environment that the target workload runs without problems at the recommended size. Especially when scaling down, you determine whether performance is sufficient even at peak times. If there are no problems, you apply the changes step by step starting with those with a small impact, and measure performance and cost after the change. You proceed while checking whether the expected effect is appearing and whether performance has degraded. Because changing a large number of resources at once makes it difficult to isolate the impact, running a cycle of validation / staged application / measurement leads to safe optimization.

Continuous Optimization Across the Organization

Resource optimization is not a one-time task but something to work on continuously. Because workloads change over time, you review recommendations regularly and adjust to the size that is optimal at that point. In organizations that operate multiple accounts, you grasp recommendations across the whole organization and address those with large savings first. By not leaving optimization to the judgment of individual staff members and instead building it into the organization as a regular review process, you can prevent wasted costs from accumulating. A mechanism for continuous optimization is the key to keeping cloud costs low over the long term.

Integration with Other Cost Tools

Compute Optimizer becomes more effective when combined with other cost management methods. You divide the roles: a cost visualization tool shows overall spending trends, Compute Optimizer determines the optimal size of individual resources, and commitment discounts lower the unit price of steady-state usage. If you first adjust resources to an appropriate size and then purchase discounts for that stable usage, you can keep costs down without waste. Combining these and running visualization / rightsizing / discount purchasing as one continuous cycle is how you put systematic cost optimization into practice.

Summary

AWS Compute Optimizer is a service that reduces costs while maintaining performance through ML-based resource optimization recommendations. It analyzes the resource sizes of EC2, Lambda, EBS, and ECS Fargate and presents specific recommendations, including Graviton migration. By enabling enhanced metrics, you can obtain recommendations based on 93 days of data, which serve as material for step-by-step rightsizing.

References (Official AWS Resources)

The primary sources for this page are the official AWS website and documentation. Check the official pages below for the latest specifications and pricing.

If this page and the official documentation disagree, treat the official documentation as authoritative.

Share