EC2 Instance Types, Families, and Sizes: A Comprehensive Study Guide
Instance types, families, and sizes (for example, memory optimized, compute optimized, virtualization)
EC2 Instance Types, Families, and Sizes
This guide explores the diverse range of Amazon EC2 instance types, categorized by their hardware profiles and optimized use cases. Understanding how to match a workload to the correct instance family is a core competency for the AWS Certified Solutions Architect exam.
Learning Objectives
By the end of this guide, you should be able to:
- Identify the five primary EC2 instance families and their target workloads.
- Explain the "burstable" performance model of the T-series instances.
- Interpret EC2 naming conventions (e.g.,
m5ad.large) to identify processor types and capabilities. - Select appropriate instance sizes based on vCPU, memory, and networking requirements.
- Describe the process for vertically scaling (resizing) an EC2 instance.
Key Terms & Glossary
- vCPU: A virtual Central Processing Unit. It represents a portion of the physical CPU assigned to the instance.
- GiB (Gibibyte): A standard for measuring data space ( bytes).
- Burstable Performance: A baseline level of CPU performance that can "burst" to higher levels by consuming accumulated CPU credits.
- Graviton2: An AWS-designed processor based on the Arm architecture, often offering better price-performance than x86 counterparts.
- Ephemeral Storage: Local SSD storage (Instance Store) that is physically attached to the host server but is lost if the instance is terminated.
The "Big Idea"
The fundamental goal of EC2 instance selection is Optimization. AWS provides over 60 instance types to ensure you don't pay for "compute waste" (excess resources) while avoiding "compute bottlenecks" (resource starvation). Choosing the right instance is a balancing act between Compute, Memory, and Storage requirements against your budget.
Formula / Concept Box
Instance Naming Convention
| Component | Example | Meaning |
|---|---|---|
| Family | m | General Purpose (Balance of resources) |
| Generation | 5 | 5th generation of that hardware type |
| Attributes | g / a / d | g: Graviton (Arm); a: AMD; d: Instance Store (Disk) |
| Size | large | Defines the scale of vCPU, RAM, and Bandwidth |
[!TIP] Think of instance families using the mnemonic FIGHT DR MC PXZ (Fast, I/O, Graphics, High throughput...). Or more simply: C for Compute, R for RAM (Memory), M for Medium (General), I for I/O (Storage).
Visual Anchors
Workload Selection Flowchart
Instance Anatomy
Hierarchical Outline
- General Purpose (M, T, A families)
- Best for: Web servers, small databases, and development environments.
- T-Series (T2, T3, T4g): Burstable performance. Accumulate CPU credits during low usage.
- M-Series (M5, M6i, M6g): Consistent performance for production workloads.
- Compute Optimized (C family)
- Best for: Batch processing, media transcoding, high-performance web servers, and scientific modeling.
- Features: High vCPU-to-memory ratio.
- Memory Optimized (R, X, Z families)
- Best for: High-performance databases (RDS), real-time big data analytics, and large in-memory caches (Redis).
- Notable Types: X1e offers up to 3.9 TB of RAM.
- Storage Optimized (I, D, H families)
- Best for: NoSQL databases (Cassandra, MongoDB), data warehousing, and distributed file systems.
- Features: High-sequential read/write and low-latency local storage.
- Accelerated Computing (P, G, F families)
- Best for: Machine Learning (training/inference), 3D rendering, and financial modeling.
- Hardware: Uses NVIDIA GPUs or FPGAs.
Definition-Example Pairs
- Burstable Instance: An instance that provides a baseline level of CPU and can scale up temporarily.
- Example: A low-traffic blog that occasionally gets a spike in visitors from a social media post.
- Graviton Processor: An ARM-based CPU designed by AWS for cloud-native workloads.
- Example: Moving a Python microservice from
m5.large(Intel) tom6g.large(Graviton) to reduce costs by 20%.
- Example: Moving a Python microservice from
- Instance Resizing: Changing the hardware profile of an existing EC2 instance.
- Example: Stopping a
t3.microinstance, changing the type tot3.medium, and starting it back up to handle increased memory demand.
- Example: Stopping a
Comparison Tables
| Family | Key Strength | Typical Service/Workload |
|---|---|---|
| Compute (C6i) | CPU Cycle Density | Video Encoding / Gaming Servers |
| Memory (R6i) | High RAM (GiB) | SAP HANA / In-memory Databases |
| Storage (I3) | NVMe SSD I/O | Data Warehousing / NoSQL |
| General (M5) | Balanced | Typical Application Servers |
Worked Examples
Problem 1: Selecting for a High-Traffic SQL Database
Scenario: A company is migrating a high-traffic PostgreSQL database to EC2. The database requires high memory for caching and fast networking but doesn't need high GPU performance. Solution:
- Analyze Requirements: High RAM + Fast Network.
- Identify Family: Memory Optimized (R family).
- Select Type: R6i.xlarge or similar. This provides the memory bandwidth needed for indexing and query caching.
Problem 2: Scaling a Web Server
Scenario: Your web server is running on a t2.micro but is constantly running out of CPU credits and becoming unresponsive.
Steps:
- Stop the instance (Elastic IP or Load Balancer handles the traffic swap if in HA).
- Modify instance type to a larger size (e.g.,
t2.small) or a non-burstable type (e.g.,m5.large). - Start the instance. The underlying host is updated, and the instance now has more resources.
Checkpoint Questions
- What is the main difference between a
t4g.nanoand at2.nano? (Answer: The t4g uses the AWS Graviton2 Arm processor, while t2 uses traditional x86 architecture.) - Which instance family would you choose for a cluster of nodes performing distributed file system tasks like HDFS? (Answer: Storage Optimized - D or I families.)
- Can you change an EC2 instance type while the instance is running? (Answer: No, the instance must be stopped before the instance type can be changed.)
- What measurement unit does AWS use for RAM, and how does it differ from a Gigabyte? (Answer: GiB (Gibibyte); it uses a base-2 power ().)