As Amazon releases new instance types, these are often better built and surprisingly cheaper than their predecessor. In light of this I decided to review my estate's old instances (anything m3 or older). I found we have quite a large amount but we could achieve a better price / performance by swapping to the m5 family (on a 'per core' basis). The m5 instance offers a balance of compute, memory, and networking resources for a broad range of workloads.
You can see below the price difference for a year for different instance types. As you can see the newer version is cheaper than the oldest version and by upgrading your stakeholders will be thanking you for reducing their bill.
Linux on m1.large - $ 139.08 Linux on m3.large - $ 106.88 Linux on m5.large - $ 78.33
These prices aren't hugely different but we are not talking about 1 instance, we are talking about multi-tiered architecture with multiple environments. Well at least I am, and this is where the impact of upgrading is shown.
Now, if you have an m3 pet which is old and delicate and you are just trying to keep it alive I understand why it would be a pain to upgrade. However, if you have lots of cattle which you can chop and change then why not get the best performing instance type for your project?
Amazon’s EC2 m5 instances are the next generation of the Amazon EC2 General Purpose compute instances. M5 instances are built on the AWS Nitro System which delivers practically all of the compute and memory resources of the host hardware to your instances resulting in better overall performance.
How to check where you have older generations
If you have a small set of accounts it is certainly worth checking to see what instances you have, and if you, too, can benefit from upgrading. However, if you have a large number of accounts and aren’t sure how to check this, the good news is, you can use your billing data! If you haven’t set up your Cost and Usage Report in AWS then you can learn more about it in this previous post.
In the meantime you can use AWS Cost Explorer to give you some information by following these steps:
1. Log into your AWS billing account and go to the Billing Console
2. Click Cost Explorer on the left, then cost & usage
3. Filter by instances types you need to find. For example m1.small etc
4. Group by Account ID so you can see where they are
From this you can track down these instances and update where needed.
If you do have your Athena table setup (which is awesome) you can then query your Athena table by doing:
SELECT line_item_usage_account_id, line_item_resource_id
FROM <database>.<Table>
Where product_instance_type like 'm1%'
Group by line_item_usage_account_id , line_item_resource_id
How to do a live price comparison
Now if you want to be sure that when you upgrade you will be getting a cheaper instance then it's important to compare your actual usage of EC2 against the upgraded value, giving you a comparable set of data.
I have built a Terraform version of the recent Pricing Lab by Nathen Besh so I could collect EC2 pricing data to make comparison for Savings plans(SPs) and On Demand(OD) instances. This can also help us in this situation.
This code will deploy lambdas to download the OD and SP data of instances. However, before you buy, why not focus on upgrading first. Using these Athena Queries to create views of the data means you can then compare older versions of EC2 with newer ones and see what savings you can make from your live usage.
Bear in mind these statements should work unless your names of columns are different for any reason. This will give you the results you seek!
As AWS releases new technology, such as instance types, it is important to stay up to date and use the type that will benefit you the most. Like Apple's iPhone, the next version is always waiting round the corner, but with AWS at least you won’t have to queue for it!.
Note:
-With all these suggestions please test your instance change in a development environment before rolling to prod
-Check if EC2 has sustained CPU bursts and is m to a T needs to not have that (m3.medium) as this costs more money. If burst then use m5.large.
m3.medium → t3.medium https://aws.amazon.com/ec2/previous-generation/
Comments