How to choose your EC2 instances on AWS? A deep dive into the EC2 Jungle
.png)
EC2 instances are the backbone of AWS infrastructure. But AWS offers dozens of types and hundreds of variations, so which one should you choose to optimize the performance of your workloads without burning through your cloud budget?
How to pick your EC2 instance? Key takeaways
AWS EC2 instances follow a specific naming convention:
[Series][Generation][Options].[Size]
For example, M6i.large → [M][6][i].[large]
Selecting the right series involves identifying your workload’s primary bottleneck - whether it’s CPU, memory, storage, or GPU - and choosing the series optimized for that resource.
General-purpose instances are the go-to for regular applications with balanced needs, while specialized instances offer more specific capabilities: Compute Optimized, Memory Optimized, Storage Optimized or Accelerating Computing.
Picking the right “Option” or manufacturer also matters deeply. “Graviton” instances identified by the option letter “g” are designed by AWS. If your software is compatible with the ARM CPU architecture, they should be preferred as they provide up to 40% better price-performance compared to Intel (i) and AMD (a) equivalent chips.
Finally once your workloads are stable, consider purchasing Compute or EC2 Savings Plans to substantially cut costs, by ~30% to 60%, compared to on-demand pricing.
What are the different EC2 instance types?
EC2 instances follow this naming convention:
[Series][Generation][Options].[Size]
Series
The series letter indicates which resource type the instance is optimized for.
General Purpose Instances -> Balanced across compute and memory
- M are the most versatile instances, they are perfect for web servers, application hosting, and moderate size databases.
- T are so-called "burstable" instances. They accumulate CPU credits during idle periods. They are ideal for intermittent workloads with CPU spikes, such as small web apps or testing environments. Quite cheap and usually a good starting point to test things out.
Compute Optimized Instances -> High CPU to memory ratio
- C are tailored for CPU-intensive tasks. Choose this series for intensive workloads, scientific computations, batch processing, media encoding, or CPU-focused machine learning inference.
Memory Optimized Instances -> High memory to CPU ratio
- R are generic memory optimized instances. It’s good for large in‐memory data sets, high‐performance caching, or real‐time analytics.
- X are for very large memory needs, such as large in‐memory databases, big data processing. Instances can go up into multi‐TB of RAM.
- Z are memory‐optimized and offer high CPU frequency. Good when you need both memory size and high computation speed. For example, latency-sensitive workloads. Some Z series instances also have local NVMe storage.
Storage Optimized Instances -> High read / write throughput to local storage
- I instances offer NVMe SSDs, very high IOPS and low latency. They ar mostly for transactional workloads, NoSQL databases, search applications or log processing.
- D have high storage capacity, they are particularly useful for dense data, large‐scale data lakes etc.
- H are designed for throughput & high density local storage. They are suited for large scale file systems, analytics, and disk throughput-bound workloads.
Accelerated Computing Instances -> Graphic computation, machine learning training, and inferrence
- P are GPU instances (mostly NVIDIA chips) and are often used for machine learning training.
- G are also GPU instances but are tuned to inference or graphics workloads.
- Inf have custom chips built by AWS called Inferentia, they offer high performance per dollar for inference tasks.
- Trn also have custom AWS chips called Trainium. They are perfect for training machine learning models efficiently.
- F are FPGA instances, or “Field-programmable gate array”, they can be reconfigured at the hardware level after manufacturing to meet very specific use cases. Usually used in Research & Development.
Generation
The generation number (e.g. the 6 in M6i) indicates the version of the hardware platform. Higher generation usually means better CPU architecture, more efficient memory, improved network / storage, and possibly lower cost per performance. Whenever possible, upgrade to current or recent generations.
Options
The option letter often indicates the brand of the chip (g
for Graviton processors based on the ARM architecture, i
for Intel and a
for AMD). Graviton instances have been specifically designed by AWS for their data centers. As a result, they offer a much better performance per dollar, up to 40% better. However, they require the software to be compiled for the ARM architecture.
Size
Size goes from nano to N xlarge where N can go up arbitrarily high. Number of CPUs and quantity of RAM will typically increase with the size of the instance.

Pricing considerations
Real-world example
Below is a comparison between Intel, AMD, and Graviton versions of a typical general-purpose EC2 instance with 2 vCPU and 8 GiB RAM, purchased in the us-east-1 region.

Provided you can compile your code for the ARM infrastructure, Graviton offers significant cost savings.
Savings Plans
Once your workloads are relatively stable, you should consider buying Compute or EC2 Savings Plans. In exchange for a 1 or 3 year commitment, they offer significant discounts without impacting your compute plane.
While EC2 SP apply to a single EC2 family in a single region, Compute Savings Plans apply to all compute, meaning any EC2 type but also serverless compute such as Elastic Container Service (Fargate) and Lambda.

Top questions
Q: What's the best instance series for training machine learning models?
A: GPU-powered families like the P-series (P3, P4d) or Trn-series (AWS Trainium).
Q: Which EC2 instances are ideal for cost-effective inference?
A: Inf-series (AWS Inferentia) or G-series (NVIDIA GPUs) offer high-performance inference capabilities.
Q: Should I switch to Graviton?
A: If your software supports ARM, switching can significantly lower costs and boost efficiency.
Q: What's special about burstable (T-series) instances?
A: They accumulate CPU credits during low use and can burst performance when needed, ideal for intermittent or variable workloads.
Q: How can I minimize costs for long-term EC2 usage?
A: Use Compute or EC2 Savings Plans, providing stable discounts (30%-60%) for consistent workloads.
