Elastic Compute Cloud (EC2) instances are virtual servers used for running applications in Amazon Web Services (AWS). EC2 instances may be billed on a per-hour or per-second basis:
AWS provides several ways to reduce EC2 costs, including a free tier, reserved instances, spot instances, and saving plans.
In this article, you will learn:
EC2 instances are configurable, including controls for customizing storage, CPU, networking resources, and memory. Additionally, AWS offers 28 types of instances for a wide range of purposes and budgets. EC2 instances are typically classified into five categories:
Each instance type has its own pricing. Below we briefly list and explain the range of EC2 instance pricing.
AWS provides a wide range of models for EC2 instances pricing. Each model provides different ways to reduce costs and optimize billing according to certain needs and requirements.
The AWS Free Tier provides 750 hours of instances, monthly, for the duration of one year. Instances included are Windows t2.micro and Linux, or t3.micro if t2 is not available for the region. To ensure you remain within the free tier program, use EC2 micro instances only.
On-demand instances charge you for compute capacity usage per hour or per second, depending on the type of instance you choose. There is no need for any long-term commitment or upfront payments.
This program offers high scalability. You can decrease or increase compute capacity according to application demands and pay only for a specified hourly rate for instance in use. Here are typical use cases for on-demand instances:
Amazon EC2 spot instances enable you to request spare Amazon EC2 computing capacity, and get it for up to 90% off the on-demand price.
Here are typical use cases for spot instances:
Reserved instances provide up to 72% savings — significantly lower than on-demand instances pricing. Reserved instances that are assigned to specific Availability Zones (AZ), can provide a capacity reservation.
Here are typical use cases for RIs:
Savings plans provide flexible pricing models. Each model offers various cost savings, including low prices for EC2 and Fargate usage. This is in exchange for a commitment to a consistent amount of usage, which is measured in $/hour, for a duration of one to three years.
EC2 Instance Savings Plans often provide very low prices, compared to other plans. This saving plan can reduce up to 72% of costs, but requires a commitment to use individual instance families within a region. For example, M5 usage in N. Virginia.
This plan automatically reduces costs on selected instance families in specific regions, regardless of size, AZ, tenancy, or OS. EC2 instance savings plans enable you to swap instances from a family located in the same region.
T2 and T3 instance family types support CPU bursting. This means virtual machines (VMs) get assigned a virtual CPU (vCPU) that comes with a specific quota of CPU cycles per second. When machines do not utilize 100% of allocated CPU cycles, unused capacity of specific instances can be converted to CPU Burst Credits.
When an instance needs processing power that extends its quota of CPU cycles, the machine can leverage burst credits to gain extra CPU capacity. This enables machines to extend CPU cycles beyond the predefined quota, but only if there is sufficient burst credit available.
EC2 instances are usually created with an attached AWS Elastic Block Storage (EBS) volume. Before creating an instance, you should determine if the device and attached volume can support your application. Calculate the required number of input and output operations (IOPS) the app needs, to determine if you need a high number of disk reads and writes.
Some EC2 instance families are optimized for EBS, and can leverage optimized configuration stacks. The stacks support a higher level of IOPS between instances and attached EBS volumes.
Operations with massive data transfers, like media files, or high traffic volumes might run into network limitations. Specifically, there are limitations to the size of the network connecting between instances and clients that need to communicate with instances.
For network-intensive applications and for massive data transfers, select instance types that support enhanced networking. For example:
Training machine learning models is a complex operation that often consumes both time and money. There is a wide range of cloud-based instance types that can be leveraged to reduce data processing and training time.
Graphics Processing Units (GPUs), for example, offer distinct advantages over regular CPUs. Specifically, deep learning GPUs can typically process big data much faster than CPUs. However, continuous monitoring is required to ensure GPUs are not under or over provisioned and instance billing remains optimal. In these cases, use GPU instances built for supporting compute-intensive and fast performance on EC2.
AWS rightsizing recommendations can provide you with a report of idle EC2 instances or instances with low utilization. To reduce costs, either stop or downsize these instances. However, these instances are for instance families only.
The AWS Compute Optimizer provides extended instance type recommendations. This service provides downsizing recommendations across, as well as within instance families. Additional insights include recommendations for EC2 instances that are parts of an Auto Scaling group and upsizing recommendations to remove performance bottlenecks.
For workloads running periodically in the, on daily, weekly, monthly or part-time basis, you might be able to leverage scheduled RIs. This can help reduce overall EC2 billing.Use scheduled RIs to reserve capacity on a recurring basis according to the app’s schedule. After purchasing the RIs, they remain ready to launch during the pre-specified time.
You can leverage spot instances to reduce the costs of fault-tolerant workloads, by up to 90%. This usually works for containerized workloads, big data operations, CI/CD pipelines, high-performance computing (HPC), web servers, and most testing and development workflows.
To meet a target capacity, use EC2 Auto Scaling to launch spot and on-demand instances as needed. You can set up this automated process to request spot instances and maintain target capabilities even when spot instances get interrupted.
While the various EC2 instance pricing models offer cloud spend optimization, managing it all on your own is not so simple. Using reserved instances and savings plans creates financial lock-in which forces you into time-consuming, complex capacity planning to make sure you buy the right RIs. Even after that, projects might change unexpectedly leaving you with unused reservations and wasted money. When it comes to spot instances, they are seemingly unsuitable for production workloads, as they can be terminated with just a 2-minute warning.
To address these challenges, Spot by NetApp offers a full suite of cloud financial management tools. These tools can help with everything from spend reporting and cost allocation, to running production and mission-critical workloads on EC2 spot instances, to maximizing utilization and ROI on EC2 reserved instances and savings plans.
Check out how you can dramatically optimize your EC2 instance costs today!
Complete access
for up to 20 instances