Amazon EC2 Instance Types
Before I start explaining about Amazon EC2 Instance Types, I want to show you just how important this topic is by showing you an image of a “live” AWS account, what they’re spending on their Amazon EC2 instances and how much they could save if they used instead either a 1-Year Reserved instance or a 3-Year Reserved Instance. Refer to the image below:
Notice in the blue rectangles, Amazon EC2 Reserved Instances can be not only purchased for 1-Year or 3-Years, but you have the option of “No Upfront” cost, “Partial Upfront Cost”, or “All Upfront” cost – and as you can imagine, the cost goes down dramatically whether or not you pay any upfront cost or not – on top of what you’d be saving merely by using Reserved Instances. In this image, I’ve chosen the middle ground, “Partial Upfront” just to make a point. I’ll be referring to this image throughout this post.
When you launch an Amazon EC2 instance, most people click the convenient blue “Launch Instance” button, shown below:
What some people don’t realize, is there are other options.
When you click that blue launch button, you are launching what’s referred to as “On-Demand” pricing. The benefits of this type of Amazon EC2 instance is you pay by the hour with no long-term commitments or upfront fees. You “pay-as-you-go”. Launching your instances in this manner is ideal for development, testing, innovating, and other short-term workloads.
However, when you are in the Amazon EC2 dashboard, there’s a menu on the left that includes options for your “Instances”, as seen in the image above surrounded by a red rectangle.
Notice under the “Instances” menu, there is an option for “Reserved Instances”, as seen below:
Now we can discuss the first image, which I’ll copy here for convenience:
If the person responsible for the company referred to above used Reserved Instances vs. On-Demand pricing, the approximate 1-Year Reserved Instance pricing vs. On-Demand Instance pricing is a savings of $31,736.60. If they chose the 3-Year Reserved Instance pricing vs. On-Demand Instance pricing, the approximate savings is $95,209.80. Both of those savings are a lot of money!
Choosing Amazon EC2 Reserved Instances allow you to reserve compute capacity for 1 or 3 years in exchange for a significant discount (up to 75%) compared to On-Demand Instance pricing. It also provides capacity reservation so that you have confidence in your ability to launch the number of instances you have reserved when you need them.
Before you launch any EC2 Reserved Instances, refer to this page, because Amazon EC2 pricing changes often (mostly for your benefit!)
Also under the “Instances” menu, you’ll see “Scheduled Instances”. This refers to “Scheduled Reserved Instances”, which enable you to purchase capacity reservations that recur on a daily, weekly, or monthly basis, with specific start times and duration, for a 1-Year term. You assured compute capacity is available the second you need it.
Scheduled Instances are a good choice for workloads that don’t run continuously, but do run on a regular schedule. For example, you can use Scheduled Instances to run only during business hours or for a batch process that runs at the end of each week. For more information, click here.
“Spot Instances”, shown below, enable you to bid on unused EC2 instances, which can lower your EC2 instance price significantly.
The hourly price for a Spot Instance (of each instance type in each Availability Zone) is set by EC2 and fluctuates depending on supply & demand for Spot Instances. This is a cost-effective choice if you can be flexible about when your applications run and if your applications can be interrupted or not. Examples include data analysis, batch jobs, background processing, and optional tasks.
One key thing to note with Spot Instances is that because you bid for these EC2 instances at a certain price, and if the hourly price for or availability of Spot Instances changes, your instance can terminate. One popular way to benefit from Spot Instances is to launch a core group of On-Demand instances to maintain a minimum level of guaranteed compute resources for your applications and supplement them with Spot Instances when the opportunity arises, as shown in the image below:
Another strategy is to launch Spot instances with a required duration (known as Spot Blocks), which aren’t interrupted due to changes in price. For more information on this, click here.
Lastly, I’ll briefly cover “Dedicated Hosts”:
An Amazon EC2 “Dedicated Host” is a physical server with EC2 instance capacity fully dedicated to your use. They allow you to use your existing per-socket, per-core, or per-VM software licenses, including Microsoft Windows Server, Microsoft SQL Server, SUSE, Linux Enterprise Server, and so on. For more information on Amazon EC2 Dedicated Hosts, click here.
So next time you start to launch an Amazon EC2 Instance, make sure you look at your options, especially Reserved Instances, before clicking that blue “Launch Instance” button! On-Demand might be the right decision, but it’s best to be informed of your options.