AWS – On Demand Vs Reserved Instance

EC2 - On Demand Vs Reserved

Many of you might already be aware of  On Demand Vs Reserved instances. This post is for those who are new to AWS and for those who are still struggling to find the difference. To be honest, the explanation given by AWS is not so clear in a way that it gets into your mind when you read about it.

 

On Demand Vs Reserved Instance

Before starting, You can find more details on what an EC2 is and its types here.  On-Demand instances let you pay for compute capacity by the hour with no long-term commitments or upfront payments. This means that you’ll be charged on hourly basis, and you can terminate the instance if you are not using it and you will not be charged anymore. 

By default you can have 20 running On Demand Ec2 instances and 20 instances in stopped state. So in general, you can create upto 40 instances. If you want to create/run more instance, then you need to contact AWS and they will increase the limit for your account.

Reserved instance is no different than on demand instance. “Functionally, Reserved Instances and On-Demand instances perform identically”.  

 

What exactly is the difference between Reserved and On demand then ?

To understand this, we need to know the benefits of Reserved Instance first. The main benefits of Reserved instances are,

  • Cost – Reserved Instances provide you with a significant discount (up to 75%) compared to On-Demand instance pricing.
  • Guaranteed Instance – You are assured that your Reserved Instance will always be available in the Availability Zone in which you purchased it.

Lets, see this with an example to make it clear. Firstly lets see on what AWS mean by guaranteed instance and how it might be useful.

 

Guaranteed Instance

Consider you are running an on demand instance in us-east-1a. If suppose us-east-1b is down due to some disaster, then there will be a huge demand for EC2 instance since one of the Availability Zone in a specific region is down. Now for some reason if you want to terminate your instance and create a new one or you want to spin a new instance then you might not be able to do it for a short period of time. You can ask why?

Below is an excerpt from AWS documentation on On Demand Instance.

Amazon EC2 always strives to have enough On-Demand capacity available to meet your needs, but during periods of very high demand, it is possible that you might not be able to launch specific On-Demand instance types in specific Availability Zones for short periods of time.

Our scenario is a clear case for very high demand and it is very much possible that you might not be able to create a new instance if your instance is not reserved.

On the other hand if your instance is reserved, then you are assured that your Reserved Instance will always be available in the Availability Zone since you have already reserved it. In this case, you will be able to terminate and re-spin your existing instance even during the period of high demand like disaster situation.

The above scenario is practically least possible (where you’ll terminate and re-create an instance during very high demand), but it is needed for me to explain what AWS mean by assured or guaranteed instance.

 

Cost

You’ll get very high discount when you opt for Reserved Instance. In the case of Reserved Instance, you will not be charged in hourly basis. You will need to commit for a term of  1 or 3 years in order to purchase a Reserved Instance. Once you purchase a reserved instance, you’ll be charged irrespective of whether you instance is running or not. You’ll get three offerings for purchasing a Reserved Instance.

  • No upfront
  • Partial upfront
  • All upfront

 

No upfront – Pay for the reservation in monthly instalments throughout the term’s duration. This payment offers the lowest savings rate.

Partial upfront – Pay for part of the reservation term in an upfront payment, and pay the remainder in monthly instalments. This option costs more than All Upfront, but less than No Upfront.

All upfront – Pay for the entire reservation term in one upfront payment. This payment option offers the highest savings rate.

 

Refer the below table to get an idea on how much you can save.

Reserved Instance Savings

As you can see, you can save upto 75% if you go with 3 year term with full upfront. But the caveat here is that if you are not using the instance anymore, then you can only sell it in the AWS marketplace which will go for a lower price than what you bought it for. Also you need to have an US bank account in order to sell any reserved instance.

 

Tip: If you have created a new account and if you are going for No upfront option and trying to purchase more than two instance, then you  might get an error like,

“Error : Your current quota does not allow you to purchase the required number of reserved instances (Service: AmazonEC2; Status Code: 400; Error Code: ReservedInstancesLimitExceeded; Request ID: 89facfa3-c926-4a1a-913b-fe5ac6ce4edb)”

All you need to do is to contact AWS contact support and tell them that you want to create more than 1 instance with No upfront option. They’ll take your request and increase your No upfront limit in a couple of days. From there you can create upto 20 instance after which you need to again raise a request to increase the limit.

For Partial Upfront and Full Upfront offering, you’ll not get any error as above.

 

And thats it for this article. Feel free to make use of the comment section if you have any questions or suggestions