EC2 Instance Types: What They Are and How to Choose
Definition
An Amazon EC2 instance type is a specific combination of CPU, memory, storage, and networking capacity that AWS packages as a named SKU (e.g., m7g.large, c6i.xlarge, r7i.2xlarge). AWS groups instance types into families optimized for different workloads, and each family comes in multiple sizes. Picking the right instance type is the foundation of both performance and cost optimization on EC2.
How the Naming Works
Every instance type follows a naming pattern like m7g.large:
- m — family letter (General Purpose).
- 7 — generation (newer = usually cheaper and faster).
- g — additional modifier (g = Graviton/Arm, i = Intel, a = AMD, d = NVMe instance store, n = enhanced networking, z = high frequency).
- large — size (nano, micro, small, medium, large, xlarge, 2xlarge, … up to 96xlarge or metal).
Instance Family Cheat Sheet
General Purpose
- T (T3, T4g) — burstable CPU with credits; cheapest. Best for dev/test, light web servers, low-traffic microservices.
- M (M6i, M7g, M7i, M8g) — balanced CPU/memory/network. The default for web apps, small-to-medium databases, and microservices.
- A (A1) — legacy Arm-based; largely replaced by M7g/C7g/R7g (Graviton).
- Mac (mac1, mac2) — macOS on Apple hardware for iOS/macOS builds.
Compute Optimized
- C (C6i, C7g, C7i, C8g) — highest vCPU:memory ratio. Best for CPU-bound workloads: video encoding, scientific computing, gaming servers, ML inference on CPU, CI/CD runners.
Memory Optimized
- R (R6i, R7g, R8g) — high memory per vCPU. Best for in-memory caches, medium-size in-memory databases, real-time analytics.
- X (X2iedn, X8g) — very high memory (up to 4 TB). SAP HANA, large in-memory databases.
- High Memory (u-series) — up to 24 TB of RAM. SAP HANA at scale, certain EDA workloads.
- z (z1d) — high sustained clock speed + high memory. EDA, some financial workloads.
Storage Optimized
- I (I4i, I7ie, I8g) — high random IOPS on NVMe instance storage. NoSQL databases (Cassandra, MongoDB, Elasticsearch), transactional DBs with short-lived data, cache tiers.
- D (D3, D3en) — massive HDD-backed local storage. Hadoop HDFS, distributed file systems, data warehousing.
- H (H1) — balance of HDD storage and compute. Legacy big-data workloads.
Accelerated Computing
- P (P4d, P5, P5e) — NVIDIA H100 / A100 GPUs. Frontier ML training.
- G (G5, G6, G6e) — NVIDIA L40S / L4. ML inference, graphics, small/mid-size model training.
- Inf (Inf2) — AWS Inferentia chips. Cost-efficient ML inference.
- Trn (Trn1, Trn2) — AWS Trainium chips. Cost-efficient LLM training.
- F (F2) — FPGAs for custom hardware acceleration.
- VT (VT1) — live video transcoding.
Graviton: AWS-Designed Arm Processors
Any family letter ending in g (M7g, C7g, R7g, X8g, I8g) uses AWS Graviton processors — AWS-designed Arm cores that typically offer 20–40% better price-performance than comparable x86 (Intel i or AMD a) instances, plus better energy efficiency. If your workload runs on Arm (and most Linux workloads do), Graviton is almost always the default choice now.
Sizes and Scaling
Sizes scale vCPU and memory proportionally up to a family's maximum:
large= baseline (usually 2 vCPU).xlarge= 4 vCPU, doubles from there:2xlarge,4xlarge,8xlarge,16xlarge, up to48xlargeor96xlarge.metal= the full physical host with no virtualization — useful for license compliance or running your own hypervisor.nano/micro/small/mediumexist on burstable T-family.
How to Pick the Right Instance
- Start with workload profile: CPU-bound → C-family. Memory-bound → R or X. IO-bound → I or D. GPU → P or G.
- Prefer the newest generation (higher number = better price-performance).
- Prefer Graviton (
g) unless software requires x86. - Right-size with CloudWatch — look at sustained CPU, memory, network, and IOPS before committing.
- Use AWS Compute Optimizer — it analyses CloudWatch metrics across your fleet and recommends specific downgrades/upgrades.
- Layer Savings Plans / Spot on top of the right instance type for cost.
Common Use Cases by Family
- Web tier:
t4g.small–m7g.xlargebehind an ALB. - Medium PostgreSQL:
r7g.2xlargewith io2 EBS. - Batch video transcoding:
c7g.4xlargeon Spot. - SAP HANA:
u-6tb1.112xlarge(high-memory). - LLM inference:
g6.4xlarge(NVIDIA L4) orinf2.xlarge(Inferentia). - Kafka / Cassandra:
i4i.2xlargewith local NVMe.
Pricing Considerations
Instance type drives base price. Multipliers:
- Generation — newer generations are almost always cheaper per unit of performance.
- Graviton vs x86 — Graviton is typically 10–40% cheaper at similar performance.
- Spot vs On-Demand — Spot can be 70–90% off for interruptible workloads.
- Savings Plans / Reserved Instances — 30–72% off for 1- or 3-year commitments.
- Region — prices vary ~10–30% between Regions.
Exam Relevance
- Cloud Practitioner (CLF-C02) — the names of the five main families (General Purpose, Compute, Memory, Storage, Accelerated).
- Solutions Architect Associate (SAA-C03) — very common scenario question: given a workload description, pick the right family and size.
- Developer / SysOps — Compute Optimizer, right-sizing, migration between generations.
- SAP-C02 / DOP-C02 — advanced: Graviton migration, mixed-instance ASGs, Spot placement.
Exam trap: for "database with lots of RAM" the answer is R (memory optimized), not M. For "analytics/CPU intensive" the answer is C (compute optimized).
Frequently Asked Questions
Q: What's the difference between T, M, and C instance families?
A: T (burstable) has cheap baseline CPU with burst credits for short spikes — use for dev/test or light traffic. M (general purpose) gives balanced CPU/memory at fixed price — use for steady web workloads. C (compute optimized) has the highest vCPU:memory ratio — use when CPU is the bottleneck (video encoding, CI runners, HPC). A web API with steady traffic usually belongs on M; a CPU-bound ETL job belongs on C.
Q: Should I always pick Graviton (Arm) instances?
A: Almost always, yes — Graviton (M7g, C7g, R7g, etc.) offers 20–40% better price-performance than x86 equivalents for workloads that run on Arm. Exceptions: software that only ships x86 binaries (a small and shrinking list), and edge cases with very specific AVX-512 usage. Most Linux, Java, Python, Node.js, and .NET workloads run unchanged on Graviton.
Q: What does large vs xlarge mean?
A: Sizes scale linearly. large is usually 2 vCPU; xlarge is 4; 2xlarge is 8; and so on up to 48xlarge or 96xlarge depending on family. Memory scales proportionally (general-purpose M-family: ~4 GB per vCPU; memory-optimized R-family: ~8 GB per vCPU). A metal size represents the full bare-metal host with no hypervisor.
This article reflects AWS features and pricing as of 2026. AWS services evolve rapidly — always verify against the official Amazon EC2 instance types documentation before making production decisions.