In the distant past, before cloud computing, organizations used on-premise computing. Whenever a larger server was required, it involved physically purchasing the equipment, setting it up in a designated space, and connecting it to the network. In more sophisticated organizations, a procurement department attempts to plan for these upgrades. There are many ways to approach this problem, but all approximate solutions must consider the upfront equipment cost, space rent, and energy bill. All of this, in addition to predicting future infrastructure demands. When done correctly, migrating to the cloud solves at least one of these problems.
With the launch of Amazon Web Services (AWS) in the mid-2000s, the definition of what is possible with web infrastructure has forever shifted. For example, the Amazon Elastic Compute Cloud (EC2) virtual machine service allows anyone to start a computer, run an operation, then (if wanted) shut it down. EC2 stands out as the primary cost driver of total AWS spend. Subsequently, EC2 underpins many of AWS’ most popular services, such as EKS, ECS, Fargate, AutoScaling Groups, and more, all contributing to EC2 spend. Understanding EC2 pricing will help you to decipher the dominant service in AWS today.
This blog walks the reader through EC2 instance types and pricing scenarios. In the end, the blog describes how nOps, with its two approaches, Pay less (nKS and Risk-Free Commitment) and use less (nSwitch), can help you to optimize your EC2 spend.
Understanding EC2 Instances
EC2 was released as an official product in Oct 2008. The primary selling points are the user only pays for what they use, and it can autoscale to meet peak-hour demands. Users can also quickly provision virtual machines and perform new operations as needed.
With AWS EC2 specifically, users can choose from various combinations of instance types (such as i3.2xlarge), availability zones (e.g., US East (Ohio)), and payment methods (on-demand, reserved, spot) to meet their requirements.
As of today, there are five major families of EC2 instance types offered: general purpose, compute-optimized, memory-optimized, accelerated computing, and storage optimized. Additionally, users can further customize their instances by selecting operating systems (typically Windows or Linux) and opting for pre-installed enterprise software like SQL Server or SAP.
This pay-as-you-go model ensures that users only pay for the resources they consume, making it cost-effective for various use cases. The downside is that “what you need” is often unknown beforehand. Thus, we have defined the biggest problem and then attempted to forecast EC2 cost.
Understanding EC2 Pricing
Calculating exact prices for AWS EC2 is not easy. There are several factors that determine the price: instance type, availability zone (e.g., Singapore v.s Ohio), licensing (e.g., a Windows license), and AWS pricing models (seen below) are all variables to consider.
There are five main models for AWS pricing:
- Free Tier Pricing
- Spot Pricing
- Reserved Pricing
- On-Demand Pricing
- Dedicated Hosts Pricing
- Savings Plan Pricing
Let’s discuss each pricing model in detail.
The Free Tier serves as a way to get started with AWS and learn about its offerings before committing to paid usage. Cloud users can access AWS Free Tier and test the features before making a long-term commitment. The Free Tier typically includes a limited usage level for select services, such as Amazon EC2, Amazon S3, and Amazon RDS. You can access more information at Amazon Free Tier.
Besides free, Spot Pricing is the next cheapest option. Spot Instances are spare computing resources available on the AWS cloud. With Spot Pricing, users can bid on unused EC2 instances, and if their bid exceeds the current spot price, they gain access to the instances. Spot Instances are ideal for applications with flexible start and end times or can handle interruptions. They allow users to take advantage of cost savings, sometimes up to 90% off the On-Demand price.
Spot Instances are also subject to interruptions when Amazon EC2 needs the capacity back. The user will receive a two-minute notification before termination. This means the application will need to be fault-tolerant while running Spot Instances.
Reserved Instances (RIs) allow users to reserve EC2 capacity in advance, providing a significant cost saving compared to On-Demand instances. Reserved Pricing is a billing model where customers commit to a one-year or three-year term, paying an upfront fee and a reduced hourly rate for the reserved instances. It’s usually more expensive than Spot Pricing because the customer accumulates costs over several years. AWS applies discounts of up to 70 percent on this plan.
RIs are well-suited for predictable workloads that require long-term usage, providing cost stability and lower hourly rates compared to On-Demand instances. AWS provides both Standard and Convertible Reserved Instances for EC2. It’s best to purchase Convertible Reserved Instances as they provide more flexibility.
To explain further, let’s say the user is in the Eastern United States (Ohio). They choose a one-year commitment plan.
- If they pay the whole amount at the beginning of the contract for a1.medium resource, they’ll pay $131.
- If they pay a partial upfront fee of $77 for a1.medium RI, they can pay $.72 for consecutive months.
- If they pay no upfront fee, they can pay $13.51 in each of the 12 months.
You can explore the AWS pricing table for updated prices.
AWS understands it is difficult to pay lump sum bills at once. That’s why On-Demand prices let users pay as they go, offering flexibility and no upfront costs. With On-Demand Pricing, users pay for the compute capacity they consume on a per-hour or per-second basis, depending on the instance type. On-Demand prices can be 27 percent to 35 percent higher than Reserved Pricing. This model is best suited for applications with unpredictable workloads, where instances are needed immediately and without long-term commitments.
Other use cases include:
- Irregular workloads that need additional flexibility
- Operations that cannot have any interruptions, such as a migration process
You can use an On-Demand pricing calculator to know how much it costs.
AWS Dedicated Hosts provide a physical EC2 for a specific account, allowing greater control over the underlying hardware and instance placement. Dedicated Hosts Pricing offers a per-hour fee for the host, regardless of the number of instances running on it. Dedicated Hosts are typically used by organizations that have specific compliance, regulatory, or licensing requirements that necessitate dedicated hardware resources. Users can choose On-Demand or Reserved Pricing for Dedicated Hosts. AWS has a table explaining the prices of various Dedicated Hosts.
AWS Savings Plans is a flexible pricing model that allows users to commit to specific usage at discounted prices. With AWS Savings Plans, users pay a fixed hourly rate for a period of either one or three years. There are two types of Savings Plans:
- EC2 Savings Plans The EC2 Savings Plans apply to instances with a specific region and provide discounts of up to 72 percent. They are ideal for fixed applications that are unlikely to change over time.
- Compute Savings Plans Compute Savings Plans allows you to purchase an amount of compute time for EC2 instances, Lambda, and Fargate. They offer more flexibility and are ideal for large organizations whose demand for resources keeps changing.
An Analysis of AWS Price Offerings Over Time
As of June 2023, there are 4,450,355 distinct EC2 offerings, up from 3,544,567 in Oct 2022. Nearly a million new options in only 8 months make picking the right EC2 instance type a daunting task. The good news is that most of this is due to new locations being brought online. For example, there were 71 distinct locations in Oct 2022 and 90 in June 2023.
Some interesting findings:
- The u-6tb1.metal instance type (explicitly built for SAP OLAP workloads) was originally available in 15 locations, including much of the Asia Pacific. Yet, today, it only available in Europe (Zurich). Why? Perhaps the only client for this specific use case was located in Zurich but this would be difficult to prove.
- The location with the most offerings is EU (Ireland) 24419. In Oct 2022 it was US East (N. Virginia) at 27512 (N. Virginia has 24384 currently).
- An interesting location is AWS GovCloud (US) which offers many security features, including being “operated by employees who are U.S. citizens on U.S. soil.”. It would be interesting to know if the US government has a FinOps department.
How Can nOps Help You Optimize Your EC2 Spend?
The question remains: how much does AWS EC2 cost? Everything we explored above was estimates based on different scenarios. It may still be challenging to know beforehand what the final AWS bill will look like. This is why we at nOps made the nOps Pricing Calculator, which helps users estimate cost savings regardless of the pricing model.
Fully optimal cloud spending isn’t always possible. Customers may experience decision paralysis, especially in the case of large-scale, complicated deployments that call for careful planning. This is where we at nOps can help. We process billions of dollars in cloud spend through our platform, and over time we have helped our customers detect anomalies and optimize accordingly.
With nOps, we help customers in two ways: First, you pay less for what you use without the financial risk using nKS and Risk-Free Commitment. Second, nOps enables you to use less by automatically pausing idle resources using nSwitch.
Let engineers focus on engineering; let nOps focus on FinOps.