Cloud Updates Financial Management

A Guide to AWS EC2 Pricing

AWS EC2 pricing is subject to multiple variables. The price you pay can depend on the region, operating system, instance family, tenancy, off-peak use, and whether you commit to a reserved level of utilization. Then there are the “hidden costs” of AWS EC2 pricing, which are also explained in our article.

If you start deploying EC2 instances without an understanding of AWS EC2 pricing, you could be in for a very expensive lesson. Currently, EC2 instances can be deployed in more than 20 different regions with more than ten different operating systems, with a choice of instance family (or category), and whether to deploy your EC2 instances on a shared tenancy server or on a dedicated host. With all these choices, there are more than 350 EC2 instance types available, which are optimized to fit different use cases.

Once you’ve figured out the most appropriate option, there’s the issue of how the instances will be used. If you’re using them to run applications with flexible start and stop times, you can take advantage of Spot Instance pricing. If the instances will be used for developing and testing, or for running apps with unpredictable workloads, on-demand AWS EC2 pricing might be a better option. If however, the instances running are more predictable and run for longer periods of time, Reserved Instances and/or Savings Plans could significantly reduce costs.

Finally, there are the “hidden costs” of AWS EC2 pricing—the extra components you’ll need for your instances to work effectively. Depending on the workloads assigned to the instances, you may incur costs for EBS storage, data transfers, elastic load balancers, autoscaling, and Elastic IP addresses. If you want to monitor the utilization and performance of your instances in order to optimize costs, you’ll also incur charges for subscribing to the AWS CloudWatch service. It all adds up!

Regional and operating system costs

Selecting the most appropriate region and operating system should be straightforward—but that’s not always the case. In most cases you’ll select by default the region geographically closest to you (in order to minimize latency), and the operating system you’ll use to operate your AWS account. However, if you can cope with a little latency, or have a choice of operating systems, comparing AWS EC2 pricing options can help reduce your cloud computing costs.

The differences in AWS EC2 pricing by region may only be cents or fractions of a cent, but over the course of a year, the fractions can add up. If you launch thousands of EC2 instances, you’re multiplying the fractions thousands of times over. For example, if you launch 100 t3.xlarge EC2 instances in California rather than Virginia, it’s costing you more than $28,000 per year extra if the instances are utilized around the clock. It may also be the case that certain instance sizes are not supported in certain regions or by certain operating systems.

Instance families and tenancy options

There are five instance families to choose from depending on the nature of the workload. You don’t have to stick to one family, as you can pick and choose different instances from different families. You can also change families—or instance configurations within families—as the needs of your applications change. The five instance families are:

  • General Purpose: Provide a balance of compute, memory and networking resources, and can be used for a variety of diverse workloads. These instances are ideal for applications that use resources in equal proportions such as web servers and code repositories.
  • Compute Optimized: Ideal for compute-bound applications that benefit from high performance processors. Instances belonging to this family are well suited for batch processing workloads, high-performance web servers, scientific modeling, dedicated gaming servers, machine learning inference, and other compute intensive applications.
  • Memory Optimized: Designed to deliver fast performance for workloads that process large data sets in memory.
  • Storage Optimized: Ideal for workloads that require high, sequential read and write access to very large data sets on local storage. They’re optimized to deliver tens of thousands of low-latency, random I/O operations per second (IOPS) to applications.
  • Accelerated Computing: Use hardware accelerators, or co-processors, to perform functions, such as floating point number calculations, graphics processing, or data pattern matching, more efficiently than is possible in software running on CPUs.

There are two tenancy options when you deploy EC2 instances on AWS—shared and dedicated.

  • Shared tenancy: This is the default model and most commonly used with AWS. With shared tenancy, multiple EC2 instances from different customers may reside on the same piece of physical hardware.
  • Dedicated tenancy: Dedicated EC2 instances run in a virtual private cloud (VPC) on hardware dedicated to an individual customer.

The advantages of dedicated instances are compliance and avoiding “noisy neighbors” that consume more than their fair allocation of shared resources. The drawback of dedicated instances is that you pay more for them, you pay by the hour rather than by the second, and you pay an additional fee of (currently) $2.00 per hour per region when any dedicated instance is running. Furthermore, just like “regular” EC2 instances, you may find that not all dedicated instance configurations are available in all regions.

Spot, On-Demand, Reserved Instances, and Savings Plans

Once you’ve settled on the most appropriate region, operating system, instance family, and tenancy, you then have several types of AWS EC2 pricing options, including Spot, On-Demand, Reserved Instances, and Savings Plans. As mentioned above, Spot instances are suitable for non-critical workloads and applications with flexible start and stop times because you can take advantage of reduced prices during periods of lower demand. Spot instances can be up to 90% cheaper than on-demand instances.

Running instances on-demand means you can scale up and scale down to suit your business needs and only pay for what you provision. You pay for compute capacity by the hour or the second, depending on which instances you run. What’s important to note with AWS EC2 pricing for on-demand instances is that if you provision an EC2 instance and leave it running, AWS will continue to charge for it.

For workloads with steady state or predictable usage, Reserved Instances can be a great way to save up to 72% compared to on-demand pricing. With Reserved Instances, you make a commitment to a specific level of capacity for one or three years, and then pay all upfront, partially upfront, or no upfront for the term of the reservation. Generally, the more you pay upfront, the more significant a discount you’ll receive.

In addition to Reserved Instances, you can consider AWS Savings Plans, where instead of committing to a certain amount of usage over one or three years, you commit to a certain amount of spend per hour over the next one or three years. To understand the differences between Reserved Instances and Savings Plans and how you can leverage either discount program for maximum cost savings, see our in-depth eBook: The Ultimate Guide to AWS Savings Plans

Managing AWS EC2 pricing

Managing AWS EC2 pricing doesn’t have to be a case of trial and error. Cloud management platforms such as CloudHealth can analyze your assets and make recommendations about changes to your infrastructure that will optimize costs. Once the changes have been implemented, CloudHealth will continue to monitor your infrastructure and alert you to events such as underutilized Reserved Instances or Savings Plans. 

To learn more about driving success with AWS, see our eBook: How to Accelerate Your AWS Cloud Journey to Reach Cloud Maturity