Resource Optimization with AWS Compute Optimizer - Instance Rightsizing
Analyze CloudWatch metrics with ML to generate rightsizing recommendations for EC2, Lambda, EBS, and ECS Fargate. Learn about Graviton migration recommendations and improving accuracy with enhanced metrics.
Overview of Compute Optimizer
AWS Compute Optimizer is a service that analyzes CloudWatch metrics with ML and provides rightsizing recommendations for EC2 instances, Lambda functions, EBS volumes, and ECSFargate tasks. It detects over-provisioned resources and presents cost reduction opportunities in dollar amounts. Recommendations are generated to reduce costs while maintaining current performance. While Trusted Advisor also provides resource optimization recommendations, Compute Optimizer performs more sophisticated ML-based analysis and goes further by suggesting specific instance types. Cost Explorer recommendations focus on Reserved Instance and Savings Plans purchases, whereas Compute Optimizer focuses on resource size rightsizing.
Recommendation Types and Graviton Migration
EC2 recommendations present comparisons between current and recommended instance types, estimated cost savings, and performance risk. Recommendations come in three patterns: instance family changes (m5 to m6i), size changes (xlarge to large), and Graviton migration (m5 to m6g). Graviton instance migration recommendations are particularly noteworthy, with up to 40% cost reduction expected from migrating x86 to Arm. Lambda recommendations present memory size optimization, reducing excessive memory allocation. Since Lambda allocates CPU proportionally to memory, memory optimization also leads to shorter execution times. EBS recommendations suggest migration from gp2 to gp3 and optimization of IOPS and throughput. gp3 offers higher baseline performance compared to gp2 and allows independent configuration of IOPS and throughput, enabling cost reduction in most cases.
Enhanced Metrics and Applying Recommendations
By default, recommendations are generated based on 14 days of CloudWatch metrics, but enabling enhanced infrastructure metrics provides more accurate recommendations based on 93 days of data. This captures usage patterns that cannot be observed in short periods, such as month-end batch processing or quarterly peak loads. Recommendations display performance risk on a 1-5 scale, and you should prioritize applying recommendations with lower risk. Since recommendations must be applied manually, establish a routine of reviewing recommendations regularly (monthly) and gradually changing instance types. Integration with Organizations enables centralized management of recommendations across all accounts, visualizing cost reduction opportunities across the entire organization. For practical guidance on resource optimization, you can also check related books on Amazon.
Compute Optimizer Pricing
Compute Optimizer's basic features are free to use. Enhanced infrastructure metrics (93-day metric analysis) is a paid option at approximately $0.0003272 per resource per month. Even with enhanced metrics enabled for 1,000 EC2 instances, the cost is only about $0.33 per month, making it strongly recommended given the cost savings from improved recommendation accuracy. External metric ingestion (from APM tools like Datadog and Dynatrace) is also available at no additional charge, allowing metrics from sources other than CloudWatch to be included as recommendation inputs.
Summary
AWS Compute Optimizer is a service that reduces costs while maintaining performance through ML-based resource optimization recommendations. It analyzes resource sizes for EC2, Lambda, EBS, and ECS Fargate and presents specific recommendations including Graviton migration. Use enhanced metrics for stable recommendations based on 93 days of data, and gradually rightsize resources.