Calculating Your Cloud Costs: Plan Your Budget for Amazon EC2

in cloud •  6 years ago 

numbers-money-calculating-calculation.jpg

Amazon Web Services offers a flexible, scalable and, if properly calculated, affordable option for organizations who wish to take advantage of a large and experience cloud provider. The Elastic Compute Cloud (EC2) runs on virtual servers known as instances, which come with different combinations of computing and storage capacity to suit different needs.

Choosing the right instance is a major factor in determining the ultimate cost of your EC2 usage. You can refer to an AWS Total Cost of Ownership Calculator to help compare your cloud computing expenses to the equivalent operations on-premise.

EC2 pricing options are based on a combination of instance types and time commitments, with options for a virtual private cloud deployment and the use of elastic IPs. If you are planning to move to the cloud, or simply want to adjust your current cloud computing strategy, this guide will help you understand the costs of EC2.

Amazon EC2 Pricing

Amazon EC2 was one of the first cloud services Amazon offered, and is still the core of the AWS ecosystem. If you look at Amazon’s EC2 pricing pages, you’ll see that EC2’s pricing is almost as complex as the technology being offered. Let’s take it step by step and try to understand how much it really costs to rent a machine instance on Amazon EC2.

Important notes about prices:

  • To give you a clear idea of Amazon’s cost structure, I quote actual dollar prices (sourced from the AWS website in April 2018).
  • These prices are subject to change on a daily basis. But I believe they will continue to be relevant in the future, as a ballpark figure of the cost of different Amazon services.
  • For simplicity, I limited myself to pricing for the US East (Idaho) data center. Actual pricing varies between data centers, with significant variations between continents.
  • All prices quoted are for a plain Linux installation, which is the default option for many, and is also the least expensive for most instance types. Amazon also offers Linux distributions from RHEL and SLES (SUSE), as well as Windows-based machines, and machines that come with SQL installed - these are typically offered at a significant premium. For example, a basic t2.micro instance costs $0.0116 per hour on-demand with plain Linux, but as much as $0.0716 for RHEL and $0.0216 for SLES.

EC2 Instance Pricing

Amazon offers, at the time of this writing, 61 types of machine instances divided into five categories - General Purpose, Compute Optimized, Memory Optimized, Accelerated Computing and Storage Optimized.

It would be difficult to discuss all 61 machine instances, but to illustrate the range of options, the table below shows the lowest-power, cheapest instance vs. the highest-power and most expensive, across the five instance categories.

Instance CategoryLowest Instance SpecsHighest Instance Specs
General Purpose Instancest2.nano * 1 Xeon vCPU @ 3.3GHz * 0.5 GiB memorym4.16xlarge * 64 Xeon E5 vCPU @ 2.3 GHz * 32 GiB memory
Compute Optimized Instancesc5.large * 2 Xeon Platinum vCPU @ 3.0 GHz * 4 GiB memoryNetwork < 10 Gbpsc4.8xlarge * 36 Xeon E5 vCPU @ 2.9 GHz * 60 GiB memoryNetwork 10 Gigabit
Memory Optimized Instancesr4.large * 2 Xeon E5 vCPU @ 3.3GHz * 15.25 GiB memory * Network < 10 Gigabitx1e.32xlarge * 128 Xeon E7 vCPU @ 2.3 GHz * 3,904 GiB memory * Network 25 Gigabit * 2 X 1,920 GB SSD
Accelerated Computingp2.xlarge * 1 Xeon E5 vCPU @ 2.3 / 2.7 GHz (turbo) * 61 GiB memoryp3.16xlarge * 64 Xeon E5 vCPU @ 2.3 / 2.7 GHz (turbo) * 488 GiB memory * Network 25 Gigabit
Storage Optimizedi3.large * 2 Xeon E5 vCPU @ 2.3 GHz * 15.25 GiB memory * 1 X 475 GB VNMe SSDi3.16xlarge * 64 Xeon E5 vCPU @ 2.3 GHz * 488 GiB memory * 8 x 1,900 GB NVMe SSD

EC2 Pricing by Time Commitment

Actual pricing of EC2 instances is determined by your time commitment. You can request instances on-demand, get spot instances based on availability in Amazon’s data center, or get a reserved instance by committing to a 1-3 year period in advance. A fourth option I won’t discuss here is dedicated instances, which are physical hosts pre-configured by Amazon for your workloads. This variety of pricing options allows newcomers to EC2 plan a flexible cloud migration strategy.

The spot instances options is an interesting one. Would you be willing to take the trouble of bidding for spot instances, moving your workloads there, and then moving workloads off the instances when they are no longer available? This could work in some use cases, with an appropriate redundancy and replication strategy. If the answer is yes, Amazon is prepared to give you a discount of around 60% on its hourly price for almost all machine instances.

The following table shows pricing for the lowest and highest spec instance in each category, vs. the three commitment tiers. This should give you a good idea of the range you can pay per hour for instances on EC2.

The table shows prices for Linux instances - you’ll pay a premium for RHEL, SLES, Windows, or Windows with SQL Server.

Instance / CommitmentOn-Demand Per Hour Cost*Spot Instance Per Hour Cost*Reserved Instance Per Hour Cost* **
General Purpose - t2.nano$0.0058$0.0035$0.003
General Purpose - m4.16xlarge$3.2$0.6052$1.888
Compute Optimized - c5.large$0.085$0.0173$0.052
Compute Optimized - c4.8xlarge$1.591$0.292$0.966
Memory Optimized - r4.large$0.133$0.0186$0.080
Memory Optimized - x1.32xlarge$13.338N/A$7.828
Accelerated Computing - p2.xlarge$0.9$0.3012$0.585
Accelerated Computing - p3.16xlarge$24.48$9.6477$15.912
Storage Optimized - i3.large$0.156$0.0468$0.102
Storage Optimized - i3.16xlarge$4.992$1.4976$3.244

(*) All prices were sourced from the AWS website in April 2018, and relate to the US East (Idaho) data center and plain Linux operating system. They are intended as ballpark figures. For actual current pricing, always consult the AWS pricing pages.

(**) Reserved Instance pricing is taken for a Standard 1 Year Term, Partial Upfront option - it’s possible to pay nothing upfront, only part of the sum, or everything, and prices are reduced accordingly. Of course, increasing the commitment period increases the discount.

As you can see, instance prices range from under one US cent per hour for a Nano instance, to $24.48 per hour for a mega machine with 64 Xeon E5 processors, 488 GiB of RAM and a 25 Gigabit network connection.

Spot instances (which, as mentioned, are not for everyone), take 60% of the price. Reserving an instance for a year with partial upfront payment will grant you a discount of 35-45%.

T2 Unlimited Instances

Regular Amazon machine instances are limited in performance, and allow a performance burst when there is a special need. If you want to work with unlimited machines that provide 100% of their compute power, you can use T2 Unlimited Instances.

There are special rates for this type of instance:

  • For Linux, RHEL and SLES - $0.05 per vCPU-Hour
  • For Windows and Windows with SQL Web - $0.096 per vCPU-Hour

Amazon VPC Pricing

Amazon’s Virtual Private Cloud provides a segmented network within the AWS cloud which is just yours. It provides complete control over the networking environment and important security benefits.

  • For regional data transfer out to Internet - first 10 TB / month $0.085 per GB, down to $0.020 per GB for over 5 PB / month
  • For regional data transfer out to origin - $0.02 per GB
  • For requests - $0.0075 for 10,000 HTTP requests

Elastic IP Addresses

  • For one Elastic IP address associated with a running instance - $0.00
  • For additional Elastic IP address, per hour on a pro rata basis - $0.005
  • For Elastic IP address remap for the first 100 remaps per month - $0.00
  • For each additional remap - $0.10

Conclusion

In this post I provided the information necessary to calculate your use of the Amazon Compute Cloud. I covered the various Amazon EC2 instance types and how they are billed per hour, depending on their usage model, as well as the pricing options for your very own, segmented VPC network.

Depending on your needs, you can plan your budget for on-demand instances or opt for cheaper, spot instances. If you have more room in your budget, you can choose a higher level of control and computing power. There are plenty of options for every project or pocket.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!