Development Long read Aws
Choose the right EC2 type

Choose the right EC2 type

Instance families and sizing strategy.

27 March 2026 19 min read
Share
X in

Introduction

Amazon EC2 provides virtual server capacity; hundreds of instance types offer different CPU, memory, network, and storage balance. Wrong type choice leads to cost increase or performance bottleneck.

Instance naming: m7g.xlarge = family (m) + generation (7) + feature (g=Graviton) + size (xlarge).

This guide covers main families, sizing methodology, and cost optimization.

General Purpose (M, T)

M series balanced CPU/memory; ideal for web servers, app tier. m7i Intel, m7g Graviton3 ARM usually better price/performance.

T series (t3, t4g) burstable; accumulates CPU credits. Good for low average CPU, short spikes (dev, small API).

  • m7g: Graviton3, genel amaçlı
  • t4g: burstable, düşük maliyet
  • m7i: Intel, uyumluluk gerektiğinde
  • Boyut: nano'dan 24xlarge'a
aws ec2 describe-instance-types \
  --filters Name=instance-type,Values=m7g.* \
  --query 'InstanceTypes[*].[InstanceType,VCpuInfo.DefaultVCpus,MemoryInfo.SizeInMiB]'

Compute Optimized (C)

C series high CPU ratio; batch processing, video encoding, game servers, scientific computing.

c7g Graviton3 compute optimized; c7i Intel alternative.

# CPU-bound workload test
stress-ng --cpu 4 --timeout 60s
# CloudWatch CPUUtilization > 70% sürekli → C serisine geçiş

Memory Optimized (R, X)

R series large memory; databases, in-memory cache, Spark. r7g 8 GiB RAM per vCPU.

X series (x2iedn) extreme memory; SAP HANA, large databases.

Storage Optimized (I, D)

I series high IOPS NVMe; NoSQL, data warehouse. D series dense storage.

On EBS-only instances storage is separate; instance store is ephemeral and fast.

  1. Web/API: M veya T
  2. DB/cache: R
  3. Batch/ML training: C veya P/G
  4. NoSQL yüksek IOPS: I

Sizing and Benchmark

Start from current server CPU/RAM profile. Monitor CloudWatch metrics for 2 weeks. Compute Optimizer provides recommendations.

Validate with load test; right-size in production. Reserved Instance or Savings Plan reduces long-term cost.

Graviton (ARM) instance'ları önce değerlendirin; çoğu Linux workload %20-40 daha ucuz çalışır.

Cost Optimization

Spot Instance up to 90% off for interruption-tolerant work. Savings Plan 1-3 year commitment. Right-sizing shrinks underutilized instances.

AWS Cost Explorer and Trusted Advisor show underutilized resources.

aws ce get-rightsizing-recommendation
aws ec2 describe-spot-price-history --instance-types m7g.large

Conclusion

EC2 type selection must be based on workload profile. M/T for general start, C for CPU, R for memory, I for storage. Graviton and right-sizing reduce cost.

Monitor metrics, use Compute Optimizer, plan Reserved/Spot strategy.