AWS EC2 (Amazon Elastic Compute Cloud) is the most famous product from AWS. Amazon EC2 is a web-based service that allows you to securely rent computing power to run your applications.
The main advantage of EC2 is the flexibility as users can scale or resize capacity within minutes and choose from a large variety of options: processor, storage, networking, operating system, deployed regions and purchase model.
Paradoxically the EC2 flexibility has created complexities for users to configure their servers and forecast costs. Actually, with CPU, storage, network, regions, OS and pricing model, there are limitless possible configurations implying different costs! In other words, it has become not humanly possible to select the best options.
At Holori we are fully aware of this complexity. This is the main reason why we released our cloud calculator to help you find the best deals.
Let’s dive deeper into the topic:
Categories and Type of instances:
AWS offers different EC2 instances types optimized for various purposes. Instance types comprise varying combinations of CPU, memory, storage, deployed region and networking capacity enabling the appropriate mix of resources to satisfy customers applications.
Main instance types categories are:
- General Purpose: The most popular; used for web servers, development environments, etc. They are a good way to start when beginning on AWS
Type : A1, M5, T3/T3a, T2, M6G, M5A, M5N, M4
- Compute Optimized: Good for compute-intensive applications such as scientific modeling or high-performance web servers.
Type: C5, C4, c5N
- Memory Optimized: Good for anything that needs memory-intensive applications, such as real-time big data analytics or Hadoop/Spark clusters.
Type: X1, High Memory, Z1
- Accelerated Computing: If you need additional computing power, you can use dedicated resources such as GPUs, FPGAs Ex: Ethereum mining or machine learning.
Type: P3, G3, F1
- Storage Optimized: Convenient for tasks that require huge storage capacity
Type : I3 D2 H1
The first option is to select the AWS region. It is the pre-requisite to access your AWS console. Each region has multiple Availability Zones, which are independent data centers that are located in the same geographical area. The west coast of the US, for example, has two regions: US-West-1, in Northern California, and US-West-2, in Oregon. Availability Zones are used for redundancy.
Most AWS customers choose a region where they or their end users are based. But they are many other factors to take into account when selecting the availability zone such as cost per location, speed and resiliency.
One of the most important one is certainly the price. Very important to know, the price varies by region and availability zone and there are substantial differences between zones. It’s possible to find price difference up to 70% between the cheapest and most expensive zones.
Billing on demand
Basically it’s “pay for what you use” depending on which instances you run with no long terms or upfront payment. There is no commitment, it’s a « contract » that you can revoke at any time.
The billing on demand is made for greater flexibility as you can decide to scale or decrease capacity instantaneously and pay the specified hourly rates for the instance you use.
As explained earlier you can choose between the wide catalogue of instance types and even make adjustments to configure something very specific to your need.
This purchase model is very suitable for short term applications or for unpredictable applications where traffic peaks are hard to forecast.
For example, the on-demand prices for an m5.large instance in the US West (Oregon) region look like this:
- Linux = $0.096 per hour
- Windows = $0.188 per hour
- RHEL = $0.156 per hour
The on-demand prices for the same instance in the EU (Ireland) region look like this:
- Linux = $0.107 per Hour
- Windows = $0.199 per hour
- RHEL = $0.167 per hour
A very well know practice in the AWS community is to reserved instances (RIs). The advantage is a very significant discount (up to 75%) compared to On-demand instance pricing. When you purchase Reserved instances, you have a long-term commitment (1 to 3 years). Thus, RIs are very suitable for production applications with predictable workloads and high availability requirements. Unlike on demand instances, RIs grant you capacity reservation in a specific Availability Zone. This way if you are scared of scarce capacities in a specific location, you can use reserved instances to mitigate this risk.
There are multiple payment options for Reserved instances:
- No upfront: Low savings
- Partial upfront: Moderate savings
- All upfront: This option brings the most savings
Basically, the larger the upfront payment, the greater the discount.
Finally, as you all know AWS is a subsidiary of Amazon the largest e-commerce marketplace worldwide. So, AWS decided to apply some principles of the mother company into their business. It’s called the RI Marketplace which enables to purchase or sell RIs at discount prices. For the seller this, Marketplace can be very useful to sell your excess capacity, if you are changing regions or simply if you need a different instance type. For the buyer, it’s a good to buy capacity with shorter term commitment at lower price.
Reserved Instances can save money on your AWS bill, but can also be a waste if unused. In case your needs for RIs change overtime, you can always mitigate this risk using the RI Marketplace
EC2 spot instances are spare capacity from AWS that you can purchase at an important discount compared to on-demand. Discount can go up to 90% making it the cheapest option to get EC2 capacity. The spot price of each instance type is different in each availability zone and varies based on supply and demand.
Despite its huge cost advantage, EC2 spots also have drawbacks.
The main one is that your instance can be revoked, either because there is no more spare capacity or because the spot price exceeded the price you were ready to pay (your bid price).It makes spot instances more suitable for applications with flexible start and end period such as computing large scale data analytics or when you have urgent computing needs.
Late 2019, AWS introduced a new purchase model: the saving plans. Alike Reserved instances, saving plans enables you to anticipate and plan your cloud budget with the advantage to bring even more flexibility. In a nutshell, you can commit to a compute spend per hour at a discount rate over 1 – 3 years. If your usage exceeds the commitment, AWS will charge the regular on-demand rates.
AWS is offering two different types of Savings plans:
- Compute saving plans:
This plan provides the most flexibility and can get you a discount of up to 66%. This is way simpler than RI’s as the discount applies regardless of instance family, size, AZ, region or tenancy.
For example, with a Savings Plan you can switch from a T2 to an M5 instance and shift the workload from the US to the EU region, and automatically continue to pay the savings plans price.
- EC2 Instance Savings Plans:
It provides the lowest prices and you can get discounts up to 72% in exchange for commitment to usage of an instance family in a specific region (e.g. M5 usage in North Virginia). It provides the ability to switch the OS, size, AZ, and tenancy.
The complexity of reserved instances has been decreased with Savings Plans. There is less need for planning around which type of RI or which instance type you need in the long run.
An EC2 dedicated instances is a physical server dedicated to your application. Dedicated servers typically provide better loading times than shared hosting as well as a stronger security.
As you may have understood by now, there are many attributes that impact the price of an EC2 instance. So how do you find the instance that is the right one for you?
How to choose your EC2 instance?
Manually find an instance
You can determine the hourly price of an instance on the AWS EC2 Pricing page. Selecting the OS and AWS Region will provide you with a list of matching instance types, organized by instance family and type. The hourly price is displayed in the right column for each instance configuration.
This approach requires that you know what you’re looking for and are aware of the options and additional costs which might be associated with each instance.
Using the AWS Pricing calculator
The AWS Pricing calculator generates a cost estimate for your Amazon EC2 workload with On-Demand, Reserved, or a mix of both pricing models.
You first select your region, choose your OS, then select your instance type with the attributes you want (Storage, memory, CPU, network..) and the pricing model.
The pricing calculator will give you an estimate based on the criteria you have selected. It is really good to get a comprehensive estimate with different AWS services.
The disadvantage of the tool is that you can’t look for alternatives. It doesn’t compare instance types between regions within a comparable price range and with similar capabilities. You get a single estimate for what you have selected but it’s not optimized for users to get a list of possibilities. Of course, users can test manually different possibilities, but it will take a huge amount of time to be guaranteed to get the best price between all the possibilities.
Using Holori cloud calculator
Holori cloud calculator allows user to select allowable ranges for vCPUs, GPU, Memory, Price, Disk and location. Soon we will also offer the possibility to have additional options such as OS, instance type and purchase model.
Holori will then automatically find all the best offers matching your defined criteria ranges.
It is way faster to find offers with Holori than using the AWS pricing calculator or looking manually for the best offer especially because you can check simultaneously the matching offers from all the other cloud providers.
Feel free to play with it, it will help you better understand how costs can vary based on the providers and settings.
Holori’s cloud comparator is accessible here: https://app.holori.com