AWS Compute Optimizer
Right-sizing recommendations for EC2, Auto Scaling, EBS, Lambda, Fargate and databases, based on how the resources are really used.
Not in the course slides
AWS Compute Optimizer is on the exam's in-scope list, but the slides don't cover it. This page is written from the AWS documentation.
What it is
People usually pick instance sizes once, at launch, and guess generously. A year later many servers are far bigger than they need to be, and a few are too small and slow. Finding them by hand means reading weeks of graphs for every resource.
AWS Compute Optimizer does that analysis automatically. It looks at the configuration and the utilisation metrics of the account's resources and gives right-sizing recommendations that lower costs, improve performance, or both. It also finds idle resources that can be stopped or deleted.
- Free. Only the optional enhanced infrastructure metrics feature is paid.
- Opt in first: it analyses nothing until the opt-in, for one account or for a whole AWS organization from the management account.
How it works
- After the opt-in, Compute Optimizer reads each resource's specifications and its CloudWatch metrics from the last 14 days: CPU use, network, disk reads and writes, and more.
- It uses machine learning to compare that usage with what other instance types and sizes would give.
- Each resource gets a finding:
- Over-provisioned: bigger than needed. Downsize to save money.
- Under-provisioned: too small for the workload. Upsize for performance.
- Optimized: about right.
- Idle: barely used. Stop or delete it.
- For each resource it shows up to three recommended options, with the expected price and performance risk, and graphs of what the utilisation would look like.
A resource needs enough data before it gets a recommendation: for example at least 30 hours of metrics for an EC2 instance.
What it covers
EC2 instances, EC2 Auto Scaling groups, EBS volumes, Lambda functions (memory size), ECS services on Fargate, RDS and Aurora databases, commercial software licences, and more, including NAT gateways and some other database services.
Better recommendations
- Memory metrics: CPU is collected by default, but memory isn't. Installing the CloudWatch agent (or sending memory metrics from tools such as Datadog) gives much better EC2 advice.
- Enhanced infrastructure metrics (paid, about $0.0003 per resource per hour): looks back 93 days instead of 14, to catch monthly or quarterly peaks.
- Preferences: these set how much headroom to leave, or which instance families to prefer, such as Graviton.
Where it fits
- Compute Optimizer: is each resource the right size?
- Cost Explorer and AWS Budgets (Cost Management group): how much is being spent, and on what?
- Savings Plans and RIs: how can steady, always-on usage cost less?
Right-size first, then commit: buying a Savings Plan for oversized servers locks in the waste.
Exam tips
- "Recommend optimal instance types / sizes based on utilisation", "right-sizing", "identify over-provisioned EC2 instances" → AWS Compute Optimizer.
- "Recommend Lambda memory size" or "EBS volume type" → Compute Optimizer too.
- "Include memory utilisation in recommendations" → install the CloudWatch agent.
Common traps
- "Compute Optimizer changes the instances for you." It only recommends; the changes are applied separately.
- "Recommendations appear the moment you opt in." It needs about a day to analyse, and enough metric history per resource.
Hands-on lab: opt in and check back
Goal: turn on Compute Optimizer and read its findings once your resources have enough history.
Free
Opting in and the standard recommendations are free. Don't turn on enhanced infrastructure metrics, which is paid.
Opt in
Open AWS Compute Optimizer in the console and choose Get started. Choose Only this account (or all accounts if you're in the management account of your lab organization) and Opt in.
Look at the dashboard
The dashboard is empty at first and says data is being analysed. If you have an instance that has been running for more than 30 hours, check back the next day.
Read a recommendation
When findings appear, open EC2 instances, choose an instance and read its finding, the three recommended options, and the utilisation graphs. A small lab instance usually shows Optimized or Over-provisioned.
Expected result: Compute Optimizer is active for your account and starts producing findings once resources have enough metrics.
Clean up: nothing costs money. You can opt out again in the Compute Optimizer account settings if you prefer.
AWS documentation
Hybrid and edge compute
Running AWS compute outside a Region, with AWS Outposts in the customer's data centre, Local Zones near cities, Wavelength in 5G networks, and VMware workloads on AWS.
Storage: Block & File
Block, file and object storage on AWS, and the services in this group (EBS, instance store, EFS and FSx).