What the Heck is 'Right-Sizing' and Why Should I Care
What is ‘Right-sizing?’
The simplest definition that I can think of is modifying your AWS infrastructure to match actual demand.
Although there are numerous services in AWS which can be ‘right-sized’ most commonly when someone refers to ‘right-sizing’ they are probably talking about the Elastic Compute Cloud (EC2) or Relational Database Service (RDS). Why? Because in the majority of cases the majority of your monthly costs associated with AWS will be in one of these services.
Why is ‘Right-sizing’ important?
‘Right-sizing’ is important because it helps you identify resources which are not being used efficiently. Once you’ve identified under utilized infrastructure you can develop an action plan which may include adjusting the resources assigned to that instance a.k.a, ‘Right-size’ it, or another action like decommissioning.
Why are you paying for this?
Think of AWS as a utility provider. Just like your local electricity company. If you leave the lights on when no one’s home you still pay for your usage. AWS is no different, if you deploy compute and database instances with low utilization you are still paying for that resource regardless of how few people are using them.
Which metrics should I use to help me ‘Right-size’
I get this question all the time and I’ll answer it the same way I always do, ‘it depends’. In your business you may have Key Performance Indicators (KPI) that you can use to help you identify which resources have been over provisioned.
If you’re not sure where to start I’d suggest that you use CPU, and Memory Utilization as a starting point. The good news? You can get CPU utilization from CloudWatch (which is a free service from AWS). The bad news? Getting memory utilization data is going to require a little more work. CloudWatch relies on the hypervisor for information, which means that it’s not able to collect operating system metrics like memory utilization.
So what can you do? While there are a number of solutions, here are my two favourites.
You can extend CloudWatch with custom metrics. AWS has a great write up that will help you get started.
You can use a third-party SaaS tool, like Datadog, to provide the additional data you need to make informed decisions on which infrastructure components are candidates for resizing.
Picking the Right Instance Type
Currently, Amazon offers six instance types (Burstable, General Purpose, Compute, Memory (X and R), GPU, and Storage Optimized (Dense and I/O)). Understanding how your applications use resources (CPU and Memory) is important to understand before moving to AWS. Selecting the right instance type for your workloads helps ensure that you’re getting the most performance for your application running on the AWS platform.