EC2 Instance Types & Selection
Key concepts
Instance families (M, C, R, T, etc.)
Graviton processors
Instance store vs EBS
Network performance
Instance metadata
Overview
Amazon EC2 provides a wide selection of instance types optimized for different use cases. Instance types comprise varying combinations of CPU, memory, storage, and networking capacity, giving you the flexibility to choose the appropriate mix of resources for your applications. Understanding instance type categories and their specific use cases is essential for optimizing both performance and cost on the SAA-C03 exam.
Core Concept
EC2 instance types are organized into five main categories: General Purpose (balanced), Compute Optimized (CPU-intensive), Memory Optimized (in-memory workloads), Storage Optimized (high I/O), and Accelerated Computing (GPU/ML). Instance naming follows the pattern: Family + Generation + Additional Capabilities + Size (e.g., m7i.xlarge = M family, 7th gen, Intel, xlarge size).
Exam questions often present workload scenarios and ask you to select the appropriate instance type. Key signals: 'batch processing/HPC' → Compute Optimized (C), 'in-memory database/cache' → Memory Optimized (R), 'NoSQL database/data warehouse' → Storage Optimized (I), 'ML training/inference' → Accelerated (P/Inf). T-series is for burstable, variable workloads.
Key Concepts
Instance Type Naming Convention

Instance Type Naming Format
Format: Family + Generation + Attributes + Size
Example: m7i.2xlarge
- m = Instance family (General Purpose)
- 7 = Generation (7th generation)
- i = Additional capabilities (Intel processor)
- 2xlarge = Size (8 vCPUs, 32 GB RAM)
Common Attribute Letters: | Letter | Meaning | |--------|---------| | a | AMD processors | | g | AWS Graviton processors (ARM-based) | | i | Intel processors | | d | Instance store volumes (NVMe SSD) | | n | Network optimized | | e | Extra capacity (storage or RAM) | | flex | Flexible instance | | z | High frequency |
Size Progression: nano → micro → small → medium → large → xlarge → 2xlarge → 4xlarge → 8xlarge → 12xlarge → 16xlarge → 24xlarge → 32xlarge → 48xlarge → metal
Metal Instances: Bare metal instances provide applications direct access to physical resources (no virtualization overhead).
General Purpose Instances

General Purpose Instance Families
Balanced compute, memory, and networking resources
T-Series (Burstable Performance):
- T4g (Graviton3), T3/T3a (Intel/AMD)
- Baseline CPU performance with ability to burst
- CPU credits accumulate during idle periods
- Unlimited mode: Can burst beyond credits (at extra cost)
- Use cases: Web servers, dev/test, small databases, microservices
- Ideal for: Variable, low-to-moderate CPU workloads
M-Series (Balanced):
- M8g (Graviton4) - Latest, best price-performance
- M8i-flex (Intel Xeon 6) - 15% better than M7i-flex
- M7i (Intel 4th Gen) - 15% better than M6i
- M7a (AMD 4th Gen) - 50% better than M6a
- M7g (Graviton3) - ARM-based efficiency
- M6i/M6a/M6g - Previous generation
M-Series Characteristics:
- Consistent performance (no busting)
- Balance of compute, memory, networking
- Use cases: Application servers, gaming servers, medium databases, caching fleets
- Typical configuration: 1:4 vCPU to memory ratio
# Enable Unlimited mode on T3 instance
aws ec2 modify-instance-credit-specification \
--instance-id i-1234567890abcdef0 \
--instance-credit-specifications '[{"InstanceId": "i-1234567890abcdef0", "CpuCredits": "unlimited"}]'
# Check CPU credit balance
aws cloudwatch get-metric-statistics \
--namespace AWS/EC2 \
--metric-name CPUCreditBalance \
--dimensions Name=InstanceId,Value=i-1234567890abcdef0 \
--start-time 2024-01-01T00:00:00Z \
--end-time 2024-01-01T23:59:59Z \
--period 3600 \
--statistics Average
# Monitor CPU credit usage
aws cloudwatch get-metric-statistics \
--namespace AWS/EC2 \
--metric-name CPUCreditUsage \
--dimensions Name=InstanceId,Value=i-1234567890abcdef0 \
--start-time 2024-01-01T00:00:00Z \
--end-time 2024-01-01T23:59:59Z \
--period 3600 \
--statistics SumCompute Optimized Instances
Compute Optimized Instance Families
High-performance processors for compute-intensive workloads
C-Series (Compute Intensive):
- C8g (Graviton4) - Latest ARM-based compute
- C8i (Intel Xeon 6) - 15% better than C7i
- C7a (AMD 4th Gen) - 50% better than C6a
- C7g/C7gn (Graviton3) - Best price-performance
- C7i (Intel 4th Gen) - x86 compatibility
- C6i/C6a/C6g - Previous generation
Characteristics:
- Highest compute performance per dollar
- Latest generation processors
- Up to 200 Gbps network bandwidth (C7gn)
- Typical configuration: 1:2 vCPU to memory ratio
Ideal Use Cases:
- Batch processing workloads
- Media transcoding
- High-performance web servers
- Scientific modeling and simulations
- Dedicated gaming servers
- Ad serving engines
- Video encoding
- High-performance computing (HPC)
- CPU-based machine learning inference
- Distributed analytics
When to Choose C over M:
- CPU utilization consistently >70%
- Memory requirements are low relative to compute
- Cost per compute hour is priority
- Workload is parallelizable
C7gn - Network Optimized
Specialized for network-intensive compute workloads
C7gn Capabilities:
- Up to 200 Gbps network bandwidth
- 3x network bandwidth vs C7g
- Powered by AWS Graviton3E processors
- Dedicated Elastic Fabric Adapter (EFA)
Use Cases:
- Network appliances (firewalls, routers)
- Data analytics processing
- CPU-based AI/ML inference
- High-performance databases
- Network function virtualization (NFV)
Network Performance Tiers: | Instance Size | Network Bandwidth | |--------------|-------------------| | c7gn.medium | Up to 25 Gbps | | c7gn.xlarge | Up to 40 Gbps | | c7gn.4xlarge | 50 Gbps | | c7gn.8xlarge | 100 Gbps | | c7gn.16xlarge | 200 Gbps |
Memory Optimized Instances
Memory Optimized Instance Families
Optimized for memory-intensive workloads
R-Series (Memory Intensive):
- R8g (Graviton4) - Latest generation
- R8i-flex (Intel Xeon 6) - 20% better price-performance
- R7a (AMD 4th Gen) - 50% better than R6a
- R7g (Graviton3) - Best price-performance
- R7i (Intel 4th Gen) - x86 compatibility
- R6i/R6a/R6g - Previous generation
Characteristics:
- High memory-to-vCPU ratio (typically 8:1 or higher)
- Optimized for large datasets in memory
- Support for persistent memory (R6id, R7iz)
- Typical configuration: 1:8 vCPU to memory ratio
Ideal Use Cases:
- In-memory databases (Redis, Memcached)
- In-memory analytics (Apache Spark, Presto)
- Real-time big data analytics
- High-performance databases (SAP HANA)
- Distributed web scale in-memory caches
- Genome analysis
- Financial risk modeling
X-Series (Extreme Memory):
- X2idn/X2iedn/X2iezn - Up to 4TB RAM per instance
- X2gd (Graviton2) - Up to 1TB RAM
- X1/X1e - Previous generation, up to 4TB RAM
- Use cases: SAP HANA, Apache Spark, high-performance databases
High Memory Instances:
- u-3tb1.56xlarge through u-24tb1.112xlarge
- Up to 24TB of RAM
- Purpose-built for large in-memory databases
- SAP HANA certified
# Describe R7g instance types and their specifications
aws ec2 describe-instance-types \
--filters "Name=instance-type,Values=r7g.*" \
--query 'InstanceTypes[*].[InstanceType,VCpuInfo.DefaultVCpus,MemoryInfo.SizeInMiB]' \
--output table
# Find instances with minimum memory requirement (128 GB)
aws ec2 describe-instance-types \
--filters "Name=instance-type,Values=r*" \
--query 'InstanceTypes[?MemoryInfo.SizeInMiB>=`131072`].[InstanceType,MemoryInfo.SizeInMiB,VCpuInfo.DefaultVCpus]' \
--output table
# Compare memory-to-vCPU ratios
aws ec2 describe-instance-types \
--filters "Name=current-generation,Values=true" \
--query 'InstanceTypes[*].[InstanceType,MemoryInfo.SizeInMiB,VCpuInfo.DefaultVCpus]' \
--output json | jq '.[] | {type: .[0], memory_gb: (.[1]/1024), vcpus: .[2], ratio: (.[1]/1024/.[2])}'Storage Optimized Instances
Storage Optimized Instance Families
High sequential read/write access to large datasets
I-Series (I/O Intensive):
- I4i - Latest generation, up to 30 TB NVMe SSD
- I4g (Graviton2) - ARM-based, best price-performance
- I3/I3en - Previous generation
I4i Characteristics:
- Up to 2 million IOPS
- Up to 65 GB/s throughput
- NVMe SSD instance store
- Up to 100 Gbps network
- Intel Xeon Scalable processors (Sapphire Rapids)
Ideal Use Cases:
- NoSQL databases (Cassandra, MongoDB, Redis)
- Relational databases (MySQL, PostgreSQL)
- Data warehousing
- Distributed file systems (HDFS, MapR)
- Real-time analytics
- Transactional databases
Im4gn/Is4gen (Graviton2):
- Im4gn: Storage optimized with networking
- Is4gen: Storage optimized with high storage density
- AWS Graviton2 processors
- Up to 100 Gbps networking
D-Series (Dense Storage):
- D3/D3en - HDD-based dense storage
- Up to 336 TB HDD storage
- Use cases: MapReduce workloads, distributed file systems, log processing
- Lower cost per GB than I-series
H1 Instances:
- HDD-based storage optimization
- Up to 16 TB HDD storage per instance
- MapReduce-based workloads
- Distributed file systems (HDFS, MapR)
Storage Instance Types Comparison
| Family | Storage Type | Max IOPS | Max Throughput | Best For |
|---|---|---|---|---|
| I4i | NVMe SSD | 2M IOPS | 65 GB/s | Low-latency, high IOPS databases |
| I4g | NVMe SSD | 1.1M IOPS | 44 GB/s | Cost-optimized NoSQL databases |
| Im4gn | NVMe SSD | 1.1M IOPS | 44 GB/s | Network-intensive + storage workloads |
| D3/D3en | HDD | Moderate | Moderate | Sequential access, MapReduce |
| H1 | HDD | Moderate | Moderate | Big data processing, cost-sensitive |
Accelerated Computing Instances

Accelerated Computing Instance Families
Hardware accelerators for parallel processing
P-Series (GPU Compute - Training):
- P6 (B200/B300/e-GB200) - Latest NVIDIA Blackwell GPUs
- P5/P5e/P5en - NVIDIA H100 Tensor Core GPUs
- P4d/P4de - NVIDIA A100 GPUs, 400 Gbps networking
- P3 - NVIDIA V100 GPUs
P5 Characteristics:
- Up to 8 NVIDIA H100 GPUs per instance
- 640 GB GPU memory
- 3.2 TB/s GPU memory bandwidth
- 3,200 Gbps EFA networking
- Use cases: Large-scale AI/ML model training, LLM training
Inf-Series (ML Inference):
- Inf2 - AWS Inferentia2 chips
- Inf1 - First-gen AWS Inferentia
- Purpose-built for ML inference
- Up to 70% lower cost vs GPU instances
Trn-Series (ML Training):
- Trn2/Trn2u - 2nd gen AWS Trainium
- Trn1/Trn1n - AWS Trainium chips
- Purpose-built for deep learning training
- Cost-optimized alternative to P-series
G-Series (Graphics Intensive):
- G6/G6e - NVIDIA L4/L40S GPUs for graphics + AI
- G5/G5g - NVIDIA A10G GPUs
- G4dn - NVIDIA T4 GPUs
- Use cases: Graphics workstations, video encoding, gaming, ML inference
F-Series (FPGA):
- F1/F2 - Field Programmable Gate Arrays
- Custom hardware acceleration
- Use cases: Genomics, financial analytics, video processing
VT1 (Video Transcoding):
- Xilinx U30 media accelerators
- Real-time video transcoding
- Up to 8 accelerator cards
Accelerated Instance Use Cases
| Family | Accelerator | Primary Use Case | Key Advantage |
|---|---|---|---|
| P5/P6 | NVIDIA H100/Blackwell | LLM training, foundation models | Highest GPU performance |
| Trn2 | AWS Trainium2 | Deep learning training | 40% better price-performance vs P5 |
| Inf2 | AWS Inferentia2 | ML inference | 70% lower cost vs GPU inference |
| G6 | NVIDIA L4/L40S | Graphics + AI inference | Balanced graphics + ML |
| F2 | FPGA | Custom algorithms | Programmable hardware acceleration |
| VT1 | Xilinx U30 | Live video transcoding | Purpose-built for video |
AWS Graviton Processors
AWS Graviton Advantage
ARM-based processors designed by AWS
Graviton Generations:
- Graviton4 (2024+) - M8g, C8g, R8g
- Graviton3/3E (2022) - M7g, C7g, R7g
- Graviton2 (2020) - M6g, C6g, R6g, Im4gn
- Graviton (2018) - A1 instances (legacy)
Performance Improvements: | Generation | vs x86 Price-Performance | vs Previous Graviton | |------------|--------------------------|----------------------| | Graviton4 | Up to 40% better | 30% faster | | Graviton3 | Up to 40% better | 25% faster | | Graviton2 | Up to 40% better | N/A (first major gen) |
Advantages:
- Better price-performance ratio
- Lower power consumption (better for sustainability)
- Up to 60% lower energy consumption
- Built on 64-bit ARM architecture
Workload Compatibility:
- ✅ Most open-source software (Linux, containers)
- ✅ Amazon Linux 2, Ubuntu, RHEL, SUSE
- ✅ Containerized applications (Docker, ECS, EKS)
- ⚠️ x86-specific binaries require recompilation
- ❌ Windows workloads (Windows requires x86)
Best Practices:
- Test workloads before migrating
- Use multi-arch container images
- Leverage AWS Lambda ARM support
- Consider for new workloads (greenfield)
# Check if Docker images support ARM64
docker manifest inspect amazonlinux:2023 | jq '.manifests[].platform'
# Build multi-architecture Docker images
docker buildx build --platform linux/amd64,linux/arm64 -t myapp:latest .
# Test application on Graviton instance
# Launch Graviton instance
aws ec2 run-instances \
--image-id ami-0123456789abcdef0 \
--instance-type m7g.large \
--key-name my-key-pair \
--security-group-ids sg-0123456789abcdef0 \
--subnet-id subnet-0123456789abcdef0
# Compare performance and cost
aws ce get-cost-and-usage \
--time-period Start=2024-01-01,End=2024-01-31 \
--granularity MONTHLY \
--metrics BlendedCost \
--filter '{
"And": [
{"Dimensions": {"Key": "INSTANCE_TYPE", "Values": ["m7g.large", "m7i.large"]}},
{"Dimensions": {"Key": "SERVICE", "Values": ["Amazon Elastic Compute Cloud - Compute"]}}
]
}' \
--group-by Type=DIMENSION,Key=INSTANCE_TYPEBest Practices
- Start with Latest Generation: Always use current generation instances (7th/8th gen) for best price-performance
- Consider Graviton: Test ARM-based Graviton instances for up to 40% cost savings
- Match Instance to Workload: Don't over-provision - use T-series for burstable, M for balanced, C for compute, R for memory
- Use Monitoring: CloudWatch metrics help identify if instance type is appropriately sized
- Leverage Instance Families: Use multiple sizes within same family for scaling (m7g.large → m7g.xlarge)
- Test Before Production: Benchmark performance on different instance types
- Consider Network Requirements: Use network-optimized variants (C7gn) for network-intensive workloads
- Evaluate Total Cost: Factor in CPU credits, networking, storage when comparing costs
Common Exam Scenarios
Exam Scenario Decision Guide
| Scenario | Recommended Instance Type | Key Reasoning |
|---|---|---|
| Web application with variable traffic | T3/T3a (burstable) | CPU credits handle traffic spikes, save cost during low usage |
| Batch processing 1000s of files | C7g/C7i (compute optimized) | High CPU performance, parallel processing capability |
| In-memory Redis cache cluster | R7g (memory optimized) | High memory-to-vCPU ratio, low latency |
| MongoDB database with high IOPS | I4i (storage optimized) | 2M IOPS, NVMe SSD, low latency |
| Video transcoding pipeline | G5 or VT1 (accelerated) | GPU/hardware acceleration for video processing |
| SAP HANA database (2TB memory) | X2idn or High Memory instance | Extreme memory capacity for in-memory database |
| Cost-optimized web tier | M7g (Graviton) | 40% better price-performance, ARM compatibility |
| Financial risk modeling | C7gn + R7i (compute + memory) | High compute + memory, low-latency networking |
Common Pitfalls
Using Previous Generation Instances
Older generation instances (M5, C5, R5) cost more per compute/memory unit than current gen (M7, C7, R7). Always select latest generation unless specific constraints require older gen. AWS may not offer Reserved Instance discounts for previous generations.
T-Series Credit Exhaustion
T-series instances in Standard mode stop bursting when CPU credits run out, causing performance degradation. Monitor CPUCreditBalance metric. Enable Unlimited mode if sustained CPU usage is needed, but beware of unexpected charges for surplus credits.
Graviton Compatibility Assumptions
Not all workloads run on Graviton without modification. Legacy applications with x86-specific dependencies, Windows workloads, and some commercial software may not support ARM architecture. Always test compatibility before committing to Graviton instances.
Over-Provisioning Instance Size
Choosing oversized instances "just to be safe" wastes money. Start with smaller sizes and scale up based on actual metrics. A m7g.xlarge costs half of m7g.2xlarge - use CloudWatch to right-size based on CPU/memory utilization.
Related Services
Quick Reference
Instance Type Selection Matrix
| Workload Pattern | CPU Usage | Memory Usage | Recommended Family |
|---|---|---|---|
| Variable, unpredictable | Low-Medium | Low-Medium | T3/T3a |
| Balanced web/app server | Medium | Medium | M7g/M7i |
| Batch processing | Very High | Low-Medium | C7g/C7i |
| In-memory database | Medium | Very High | R7g/R7i |
| Transactional database | Medium | Medium-High | I4i |
| ML model training | N/A | Very High | P5/Trn2 |
| ML inference | N/A | Medium-High | Inf2/G6 |
Performance Progression (Example: M7g family)
| Instance Type | vCPUs | Memory (GB) | Network (Gbps) | Hourly Cost |
|---|---|---|---|---|
| m7g.medium | 1 | 4 | Up to 12.5 | $ |
| m7g.large | 2 | 8 | Up to 12.5 | $$ |
| m7g.xlarge | 4 | 16 | Up to 12.5 | $$$$ |
| m7g.2xlarge | 8 | 32 | Up to 15 | $$$$$$$$ |
| m7g.4xlarge | 16 | 64 | Up to 15 | $$$$$$$$$$$$$$$$ |
| m7g.8xlarge | 32 | 128 | 15 | $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ |
| m7g.16xlarge | 64 | 256 | 30 | $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ |
CLI Quick Reference
# List all instance types in a family
aws ec2 describe-instance-types --filters "Name=instance-type,Values=m7g.*"
# Find instances with specific vCPU count
aws ec2 describe-instance-types \
--query 'InstanceTypes[?VCpuInfo.DefaultVCpus==`4`].[InstanceType]' \
--output text
# Compare pricing (requires Price List API)
aws pricing get-products \
--service-code AmazonEC2 \
--filters Type=TERM_MATCH,Field=instanceType,Value=m7g.xlarge \
--region us-east-1
# Check instance type availability in region
aws ec2 describe-instance-type-offerings \
--location-type availability-zone \
--filters Name=instance-type,Values=m7g.xlarge \
--region us-east-1
Test Your Knowledge
A company runs a web application that experiences traffic spikes during business hours (9 AM - 5 PM) but is nearly idle overnight. CPU utilization averages 20% but spikes to 80% during peak hours. Which instance type is MOST cost-effective?
A financial services company needs to run Monte Carlo simulations for risk analysis. The workload is CPU-intensive, runs 24/7, and requires minimal memory. Which instance type provides the BEST price-performance?
An e-commerce company runs a Redis in-memory cache requiring 256 GB of RAM with low latency access. Which instance type is MOST appropriate?
A machine learning team needs to train a large language model (LLM) with billions of parameters. Training will take several weeks. Which instance type provides the BEST cost-effectiveness for this workload?
Further Reading
- Amazon EC2 Instance Types
- AWS EC2 Instance Types Guide 2026
- Instance Type Specifications
- AWS Graviton Processors
- AWS Compute Optimizer
- EC2 Instance Types Comparison
Sources: