It’s very common for people to buy more compute power than is really needed. Unless you have experience running similar workloads, you might be unsure which instance type to use. AWS’s Compute Optimizer is a tool that can help you figure that out.
What Is Compute Optimizer?
The concept is very simple. Once enabled, Compute Optimizer will analyze your running EC2 instances, using CloudWatch logs and other metrics, and give you a recommendation for a different instance type, if a change is needed. You are then free to upgrade or downgrade the given EC2 instance to the optimized type.
It won’t make first guesses for you—you’ll still have to set up your instance with the programs it will be running, and hit them with a real workload. The best thing to do here is to over-provision with large instances, then cut back once Compute Optimizer has had a few days to analyze what is really necessary.
Compute Optimizer works with EC2 instances as well as auto-scaling groups. If you’re not using auto-scaling, you might want to consider setting it up, as it will allow your compute power to scale throughout the day and more closely match the workload it is handling. Compute Optimizer can be used to give you a recommendation for the underlying instances in the auto-scaling group.
Using the Compute Optimizer
If you want to test it out, turning it on is just one button. Head over to the Compute Optimizer in the AWS Management Console, and click “Opt In” to turn it on.
It will take around 12 hours to collect data and report back with recommendations. When it’s done, you’ll see a graph showing you what percentage of your instances are optimized, in need of upgrading, or in need of downgrading.
If you want to view the specifics, select either “EC2 Instances” or “Auto Scaling Groups” in the sidebar, depending on the type you’re using.
You’ll see a list of all of your running instances, current prices, and the recommendations. Under “Price Difference,” you’ll see how much you’ll save (or spend) by switching to the recommended instance.
Here, the compute optimizer found that the current running instance is fairly optimized, and isn’t having issues using a t2.micro. However, it still recommends upgrading to the new generation t3.micro, which saves a tiny bit per hour.
You can filter results by the verdict Compute Optimizer gives it—optimized, under-provisioned (needs upgrading), or over-provisioned (needs downgrading). This will filter out the Optimized instances, allowing you to check what really needs a change. You can also filter by region here.
Compute Optimizer will do its thing in the background, and regularly update with new recommendations.