EC2 Instances Billing Options

Page content

How to Manage Costs and Save Money with EC2 Instances

In a previous post, we have discussed EC2 Instance families. We are going to explain the various pricing options for EC2 instances in this post.

If you have been believing that EC2 instances can be very costly, then you must not be aware of the multiple billing options offered by AWS. You can realize big savings by using a savings plan. For example, if you are well aware of your usage for the coming 1 -3 years and can commit, you can realize more than 70% savings.

Well, this is quite amazing, Isn’t it? AWS provides instances in various sizes and you can use the on demand pricing option if you want instances for a limited time period or are just testing. Instances can cost you very low or very high depending on your usage and instance types.

However, the billing options at AWS are quite flexible and you may end up paying much less if you can commit to buying for a longer period of time such as one to three years. AWS does not offer you small discounts like 10 or 20% less if you are buying for one year or three years.

You will realize the highest savings, when you have committed for a longer period like three years. Imagine paying only one third or one fourth of what you would have paid for a three year period by following the on demand pricing. Yes, you have several options that you can select to save money.

Here are the billing options for the AWS EC2 customers:

On demand Instances:

This is the most common billing option that most customers are familiar with. This billing option is most suited when you know you need the instances for a small period like when you are testing or when you believe you might need to change instances or move the application in near future.

If you do not want to make a large upfront payment, and do not need significant resources, you could again find the on demand pricing more suited to your need. Suppose, you only need an instance to spin up a server for a period of a month. You can check out the rates for on demand pricing and then select the instance type and size and spin up a server without making any upfront payment or commitment.

If you are working on a small project that will need only a small sized instance for 6 months, you might like to go with the on demand pricing option. Another case is that you want to get an estimate for your baseline usage, that is, how much resources your application will consume over a given period of time. In that case too, you can go with the on demand billing option.

Now, let’s say you have a large website and you need a stable option for a longer period such as at least one year. In that case, you know that your usage would be higher than the average and on demand pricing will lead to higher expenses.

In such a case, rather than the on demand option, you would like to use another option that can help you realize some cost savings.

On demand instances are not recommended for workloads that will last a year or longer. If you are working on a project, you expect to last longer than a year, then you can save money by using the next option which is Reserved Instances.

Reserved Instances:

You can achieve significant cost savings by using AWS EC2 Reserved Instances compared to on demand instances.

The Reserved Instances provide a discounted hourly rate compared to the on demand instances.

There are basically two types of reserved instances including:

- Standard Reserved Instances

- Convertible Reserved Instances

You can buy either of the two for a one year or three year term where the three year term will help you realize higher cost savings. AWS billing will automatically apply a discount when the attributes of instance usage match that of an active reserved instance.

You also have three payment options with the Reserved Instances. You can make the complete payment upfront or a partial upfront payment or you do not make an upfront payment. In case of no or partial upfront payment, you get monthly bills or the remaining amount will have to be paid in monthly increments.

Suppose, you bought reserved instances for a one year term, then at the end of the term, AWS will start charging you at the on demand rate unless you terminate the Reserved Instances or buy RIs with matching attributes.

Standard Reserved Instances:

The Standard reserved Instance types are a good choice when you are aware of the instance type and size you are going to need and the AWS region where you plan to deploy the instances. You must state three things to buy a standard reserved Instance:

  • Instance type and size: For example t2.large

  • Operating system: For example Windows or Linux

  • Tenancy: Default or dedicated

With standard reserved instances you can at an average get a 40% discount on a one year term compared to the on demand instances and 60% average over three years.

If you specify the availability zone, you can also get capacity reservation which will ensure that there are a desired amount of instances available whenever you need them.

Convertible Reserved Instances:

The convertible reserved instances are more suited for your AWS if you need instances of different types or in different availability zones.

The average discounts that you enjoy with convertible reserved instances over a period of one year compared to one demand instances is 31% and 54% for three years.

However, you can change the instance family, operating system, tenancy and payment options when you use convertible reserved instances (not with Standard RIs).

You also get to benefit from price reductions with the convertible reserved instances.

EC2 Instance Savings Plans

AWS offers savings plans for a few compute services including EC2, AWS Lambda and Fargate. You can achieve solid cost savings with savings plans when you commit to a one year or three year term for a consistent amount of usage (calculated in $/hour). If you want the lowest prices, you must go for the EC2 Instance savings plan.

Compared to the on demand rates, you can realize cost savings of up to 72% through EC2 Instance Savings Plans.

Now, suppose you committed to a $10/hour plan for three years. You are going to be charged discounted rates until your usage crosses the $10/hour limit. Beyond that limit you will be charged the on demand rates.

The savings plans are a very good option if you need flexibility in EC2 usage over your commitment period. You can use any instance from an instance family in a particular region over the commitment period. The instance family and the region remain the same. For example, t2 in N. Virginia. However, you can switch from t2.small Windows to t2.2xlarge Linux if you need. It automatically reduces the costs on the instance family in that region regardless of the Availability Zone (AZ), OS, size or tenancy.

The savings that you realize with the savings plans are similar to that from the standard reserved instances.

However, you need to specify upfront the instance type and size as well as OS and tenancy in the case of reserved instances but not in case of the savings plans to avail of the discounted prices. You will also not need to commit to a specific number of EC2 instances over a given period in the case of savings plans. The capacity reservation option however, is not available with the savings plans but only with reserved instances.

If you are an existing EC2 user and need a customized recommendation for savings plans, you can try the AWS cost explorer.

Spot Instances:

EC2Spot Instances

Spot instances can offer more cost savings compared to all other instances. However, they are not ideal for all types of workloads since Spot Instances use unused EC2 capacity. They are only suited for flexible workloads with flexible start and end time. In simpler words, if your workload can bear interruptions, it can save a lot by using Spot instances.

Spot Instances are also highly popular because they can help realize solid cost savings. Using Spot instances you can save up to 90% compared to the on demand instances and these instances suit a large variety of workloads. Some of the well known customers of Spot instances include Salesforce, Lyft, DeliveryHero and Moderna.

Suppose you have a background processing job that you want to start and stop without affecting your overall operations. You make a spot request, in which case, you get Spot instances only if EC2 capacity is available. You launch a Spot Instance and subsequently EC2 instance capacity becomes unavailable. It will interrupt the background processing job, which will not be affected since it can start again if capacity becomes available.

However, in the case of other tasks where interruptions will affect your overall business and business performance, you must use other types of instances like on demand instances. Spot Instances can be combined with other types of instances like on demand instances and Savings Plans for maximum savings.

Note: You can use Spot Instances for various stateless, fault-tolerant, or flexible applications such as big data, containerized workloads, CI/CD, web servers, high-performance computing (HPC), and test & development workloads.

Dedicated Hosts:

Dedicated hosts are the most costly of all these options. They are physical servers with Amazon EC2 instance capacity dedicated to your use. You can use your existing per-socket, per-core, or per-VM software licenses to help maintain license compliance. You can purchase ‘On-Demand Dedicated Hosts’ and ‘Dedicated Hosts Reservations’.

Dedicated hosts provide visibility into the number of sockets and physical cores. You can consistently deploy your instances to the same physical server over time. To learn more about how dedicated hosts work, you can follow this link.

Managed Wordpress Hosting: Why and Why not to use

Conclusion

Amazon EC2 instances offer a wide range of benefits including ease of use, simple set up, security, scalability and cost effectiveness. The on demand instances are among the most well known and used instances. However, you can save a lot more by opting for Savings plans or Reserved Instances.

You can save up to 72% costs by opting for these types. If you have larger needs and want to save money, you can do so by selecting one of the other options than the on demand instances. Many businesses combine on demand or Savings plans with Spot Instances to save more. It depends on your needs and workload type.

Both savings plans and reserved instances are good options for larger websites and projects where you can save a lot of money if you can commit for one year or three years. So, if you are certain about your EC2 usage over the next year or three years, you can easily save a lot by opting for a different billing option than on demand.

Suggested Reading