Choosing the right instance type can sometimes be tricky. Especially so since the difference in cost between two instance sizes of the same family on AWS is 50%. This then means that if you are able to bring down the size of your instance by one then you save 50% on the cost of that instance, and bringing it down by sizes results in a whopping 75% savings.

Not just Performance, but Price vs Performance

So what’s the tricky part? Performance is not the only metric to look at when choosing the right resource size. It’s also important to look at price vs performance ratio. Identifying under-utilised Amazon Elastic Compute Cloud (EC2) instances that can be downsized within the same family can be done easily using AWS Cost Explorer Rightsizing Recommendations and many other cloud cost monitoring tools out there. AWS Cost Optimizer takes this further by analysing the history of resource consumption on your AWS account using machine learning. You then receive actionable recommendations for all the accounts under your master AWS Organisation.

Keeping price vs performance ration in mind, AWS Cost Optimizer identifies a list of optimal AWS resources for your workload requirement, and presents on-demand and reserved instance pricing, reserved instance utilisation, and reserved instance coverage. It also presents the expected resource efficiency to its recommendations.

Better than RIs for Non-production workloads

Note here that for non-production workloads, you might want to stay away from RIs and instead use on-demand or orchestrated spot instances with Lightwing’s AutoStopping, which gives you 2x-3x the savings compared to reserved instances, with all of the flexibility and portability of on-demand instances. Read more about it here: “Oops… we bought RIs for non-production machines!”

Precautions and Limitations of Rightsizing

It’s important to keep in mind, however, that while it is fairly straightforward to rightsize resources for stateless applications that scale horizontally, it might not be so with older applications. Hence it is advisable to thoroughly test out your application on the new recommended instance type before pushing anything to production.

AWS Cost Optimizer uses metrics from Amazon CloudWatch (CPU utilisation, disk IO, network IO) to provide recommendations. You will need to install a CloudWatch agent on your EC2 instance if you want AWS Cost Optimizer to take into account OS level metrics such as memory usage.

AWS Compute Optimizer is absolutely free to use, and is available on the AWS Management Console. It is currently available in the US East (N. Virginia), US West (Oregon), Europe (Ireland), US East (Ohio), and South America (São Paulo) AWS Regions.