Two popular options that provide rightsizing recommendations are AWS Compute Optimizer and AWS Cost Explorer.
AWS Compute Optimizer features
AWS Compute Optimizer is a service that analyses Amazon CloudWatch metrics and provides EC2 instance recommendations. It flags instances that it considers having an optimal resource allocation and provides a list of alternative EC2 instance types for each recommendation, as well as projected cost and expected savings for each option.
For example, it provides the expected CPU utilization percentage for each recommendation, compared to CPU utilization for the current instance type. The interface includes graphs for various relevant metrics, such as memory, network in, network out, network packets, Elastic Block Store (EBS) read/write operations and bandwidth, among others.
Figure 1. An example of recommendations for a deployed t3.medium EC2 instance.
Additionally, it applies AI and machine learning algorithms to find potential optimizations for EC2 instances, Auto Scaling groups, Amazon EBS volumes and AWS Lambda functions. It displays the resources that it identifies as running optimally and the ones for which it recommends optimizations.
AWS Cost Explorer features
AWS Cost Explorer helps users understand where money is spent in an AWS account or organization. The graphical interface visualizes incurred costs for current and past billing cycles. It shows daily and hourly costs, plus it forecasts future costs and usage. Users can use several variables to filter cost, such as AWS services, accounts, regions, tags, usage types and resources. Figure 2 shows what the main interface looks like in a test account.
Cost Explorer is powered by AWS Compute Optimizer, but the user interface is slightly different. It provides the option to find idle instances, as well as Reserved Instances and Savings Plans recommendations. These options are not available in the Compute Optimizer user interface.
The main interface displays a chart, which provides a quick way to understand cost and to identify any anomalies. This mechanism gives application owners a clear view of where money is spent and allows them to identify specific usage types or resources that contribute to high costs. It also has more granular capabilities, such as displaying hourly data, which helps identify specific usage patterns or situations resulting in high costs that take place within a specific time frame.
When to use AWS Compute Optimizer vs. Cost Explorer
Both services are useful tools for finding AWS cost optimization opportunities. While Cost Explorer provides a view for all usage types at the account and AWS organization level, AWS Compute Optimizer is more specific to compute resources, such as EC2 instances, Auto Scaling groups, Elastic Block Store (EBS) volumes and Lambda functions. If the top contributors to cost are not related to any of these services, then AWS Compute Optimizer becomes less relevant.
Also, both AWS Compute Optimizer and Cost Explorer provide an API and CLI. This allows developers to programmatically access cost data and recommendations. An admin user must enable AWS Compute Optimizer before they can access recommendations. Only relevant users have permissions to access billing information.
For users to access Cost Explorer, the root user must enable the IAM User and Role Access to Billing Information setting in the Billing and Cost Management console. Otherwise, access will be denied to non-root users. Once the user enables access, users will potentially be able to view information related to payment methods, billing, tax addresses and invoice history.
Start your cost optimization analysis in Cost Explorer, which will provide data across all usage types. If compute resources are top contributors to the AWS bill, then the rightsizing recommendations feature is a good place to start. The next step is to use AWS Compute Optimizer for a more detailed view of compute recommendations and to apply updates to applicable AWS components.