Choosing the Right EC2 Instance Type for Your Application
Amazon EC2 (Elastic Compute Cloud) instances provide virtual computing capacity in the AWS cloud. The elasticity refers to the ability of users to scale their compute power up or down, on demand, to handle changes in requirements.
AWS has a vast number of EC2 instance types designed for a multitude of workloads. As of the date of this article, there are close to 300 EC2 instance types, spanning 70 Availability Zones in 22 regions, giving users endless combinations to choose from.
How can you decide which EC2 instance is best for you?
Choose the EC2 instance mix based on the type of applications you are developing and running on AWS, with the optimum CPU, memory, storage, and networking capacity required for your specific workload.
To help you get started with launching your instances, AWS provides a preconfigured template, called Amazon Machine Image (AMI). AMI defines your operating environment and the required software to package the components you need for your server. You can terminate and change the type of instances later as your business and application needs change.
For further information on how to set up an EC2 instance you can refer to this tutorial.
To help you choose the appropriate EC2 instance we will review each instance type that address different workloads and use cases.
Amazon EC2 Instance Types
Instances are categorized by the diverse capabilities that they provide for your workloads:
- General Purpose
- Compute Optimized
- Memory Optimized
- Storage Optimized
- Accelerated Computing
The table below summarizes the different types of EC2 instances and the applications for which they are designed.
1. AWS General Purpose Instances
General purpose instances provide a blend of compute, memory and networking resources. These instances are ideal for business critical applications, small and mid-sized databases, web servers and code repositories.
The latest generation of these instance types within this family are the following:
A1 instances are used for scale-out and Arm-based applications.
T instances (T2, T3, T3a) are burstable, meaning that they are designed to sustain temporary spikes in CPU performance for applications with moderate CPU usage. If the instance needs to run at higher CPU utilization for a prolonged period, it can do so at a flat additional charge per vCPU-hour.
T2 instances are used for websites and web applications, development environments, build servers, code repositories, micro services, test and staging environments, and line of business applications.
T3, T3a instances are best for micro-services, low-latency interactive applications, small and medium databases, virtual desktops, development environments, code repositories, and business-critical applications
M4, M5, M5a and M6g instances are designed for applications built on open-source software such as web and application servers, microservices, gaming servers, small and mid-size databases, cluster computing and caching fleets.
2. AWS Compute Optimized Instances
Compute Optimized instances are designed for compute-intensive applications that require high performance processors, such as batch processing workloads, media transcoding, high performance web servers, high performance computing (HPC), scientific modeling, dedicated gaming servers and ad server engines and machine learning inference.
The latest generation types in this family are the following:
C5 instances are ideal for high performance computing and applications, such as ad serving, highly scalable multiplayer gaming, video encoding, scientific modelling, distributed analytics. C5n variant is designed for network intensive applications.
C4 instances are best for high performance front-end fleets, web-servers, batch processing, distributed analytics, high performance science and engineering applications, ad serving, MMO (Massively Multiplayer Online) gaming, and video-encoding.
3. AWS Memory Optimized Instances
Memory optimized instances are designed to deliver fast performance for workloads that process large data sets in memory.
The latest generation of memory optimized instances in this category are as follows:
R5 and R5a instances are well suited for memory intensive applications such as high performance databases, distributed web scale in-memory caches, mid-size in-memory databases, real time big data analytics, and other enterprise applications.
R4 instances are optimized for memory-intensive applications, such as high performance databases, data mining & analysis, in-memory databases, distributed web scale in-memory caches, applications performing real-time processing of unstructured big data, Hadoop/Spark clusters, and other enterprise applications.
X1 and X1e instances are optimized for high-performance databases, in-memory databases and other memory intensive enterprise applications.
High memory instances are purpose built to run large enterprise databases, including production deployments of SAP HANA, in the cloud. z1d instances are best for electronic design automation (EDA), gaming, Optical Proximity Correction (computational lithography), HPC, financial, actuarial, data analytics, and certain relational database workloads with high per-core licensing costs. z1d is also ideal for applications that require high single-threaded performance and high memory usage.
4. AWS Storage Optimized Instances
Storage optimized instances are designed for workloads that require high, sequential read and write access to very large data sets on local storage. They are optimized to deliver tens of thousands of low-latency, random I/O operations per second (IOPS) to applications.
I3 and I3en instances are the next generation of storage optimized instances for high transaction, low latency workloads, non-relational NoSQL databases for mobile web and gaming, in-memory databases, data warehousing, Elasticsearch, and analytics workloads.
H1 instances are a new generation of Amazon EC2 Storage Optimized instances designed for applications that require low cost, high disk throughput and high sequential disk I/O access to very large data sets. They are also used for MapReduce-based workloads, distributed file systems such as HDFS and MapR-FS, network file systems, log or data processing applications such as Apache Kafka, and big data workload clusters.
The new D2 instances are designed for Massively Parallel Processing (MPP) data warehousing, MapReduce and Hadoop distributed computing, distributed file systems, network file systems, log or data-processing applications.
5. AWS Accelerated Computing Instances
Accelerated computing instances use 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.
P3 instances are the latest generation of general purpose GPU instances used for machine/Deep learning, high performance computing, computational fluid dynamics, computational finance, seismic analysis, speech recognition, autonomous vehicles, drug discovery, molecular modeling, genomics, and rendering workloads.
P2 instances are designed for general-purpose GPU compute applications, such as machine learning, high performance databases, computational fluid dynamics, computational finance, seismic analysis, molecular modeling, genomics, rendering, and other server-side GPU compute workloads.
Inf1 instances support machine learning inference applications, such as recommendation engines, forecasting, image and video analysis, advanced text analytics, document analysis, voice, conversational agents, translation, transcription, and fraud detection.
G4 instances are designed to help accelerate machine learning inference for applications like adding metadata to an image, object detection, recommender systems, automated speech recognition, and language translation. G4 instances are also used for building and running graphics-intensive applications, such as remote graphics workstations, video transcoding, photo-realistic design, and game streaming in the cloud.
G3 instances are optimized for graphics-intensive applications, such as 3D visualizations, graphics-intensive remote workstation, 3D rendering, application streaming, video encoding, and other server-side graphics workloads.
F1 instances offer customizable hardware acceleration for use cases such as genomics research, financial analytics, real-time video processing, big data search and analysis, and security.
In addition to CPU bursting, many of the EC2 instance types provide additional features to help you deploy, manage, and scale your applications.
Select EC2 instances can be launched as EBS-optimized instances to fully use the IOPS provisioned on an EBS (Elastic Block Storage) volume. This is recommended for applications with high storage I/O.
Select EC2 instances support cluster networking when launched into a common cluster placement group which provides low-latency networking between all instances in the cluster. Cluster networking is ideal for high performance analytics systems and scientific and engineering applications, many using the MPI library standard for parallel programming.
How can you be sure you’re getting the most out of your EC2 Instances?
Measuring the performance of applications running across different combinations of CPU, memory, storage, and networking capacity help you identify the right instance type and size for optimum performance. You should select the instance types that are designed for the specific type of applications that you will deploy and manage on AWS with maximum performance and scalability. You will need to assess potential scenarios, such as sudden spikes in performance, to add the appropriate instance types to the mix. Sizing your workload will help you identify the appropriate instance size.
AWS introduces new generation instance types on a regular basis, frequently at lower prices. Selecting the latest generation instance types will yield higher performance at lower cost than older generations.
Can you save money on EC2 Instances?
Choosing the right EC2 instance types is just the start. Calculating the right pricing mix to maximize your savings is the next critical step. Reserving instances in advance can save up to 60% compared to on-demand rates.
The availability of multiple instance types, combined with a selection of pricing models, some with volume-based commitments allow your deployment to be optimized for increased performance at lower costs. On-demand pricing charges for your EC2 resources you actually consumed at the end of each month. EC2 instances can also be reserved in advance or purchased as part of Savings Plans for significant savings.
Parquantix monitors EC2 usage in real time to calculate the optimal pricing mix to significantly reduce your cloud costs. Contact us for a 30-minute consultation to find out how we can help you.
EC2 Instance Pricing
When you sign up for AWS, you can take advantage of the AWS Free Tier, which provides 750 hours of free instance usage for Amazon EC2.
The following pricing options are available for AWS EC2 instances:
- On-Demand Pricing: You pay for the running instances that you use, as needed, by the second, with no long-term commitments or upfront payments.
- Reserved Instances: You can reserve a specific instance configuration 1 or 3 years in advance to reduce your Amazon EC2 costs by up to 60% off on-demand rates.
- Savings Plans: You can reduce your Amazon EC2 costs by making a commitment to use a specific volume, in USD per hour, for a term of 1 or 3 years, for up to 70% off of on demand rates.
For a detailed review of all pricing options, see our detailed article on AWS Pricing.
An Automated Tool For the Optimal Instance and Pricing Mix
The seemingly endless number of EC2 instance types can be overwhelming. Overlaying the multitude of pricing options with their own unique discount structures make it even more challenging to optimize your cloud infrastructure. Finding the right instance and pricing mix to optimize performance over time, as requirements change, can drain a lot of time, effort and money.
Parquantix helps you navigate the complex AWS pricing models to optimize your cloud costs, without having to invest the manual time and effort. Learn more.
Our automated tool manages your EC2 instance usage to secure the lowest cost at the highest performance. Its automated AI solution adjusts its algorithm dynamically as your requirements change to reduce the cost of your cloud usage.