# EC2 Instance Types: A Simple Guide

Key Takeaways

  • EC2 instance types are grouped into families by workload fit: General Purpose (M, T), Compute Optimized (C), Memory Optimized (R, X), Storage Optimized (I, D), and Accelerated Computing (P, G).
  • The naming convention (e.g., m6g.large) encodes family, generation, processor type, and size — once you can read it, choosing isn't guesswork.
  • Right-sizing instance type is the single biggest lever on your EC2 bill, more impactful than Reserved Instances or Savings Plans alone.
  • Graviton (ARM-based, the g suffix) instances typically offer 20-40% better price-performance for compatible workloads.

Decoding the EC2 Instance Name

Every EC2 type follows a pattern: [family][generation][additional capabilities].[size]. Take m6g.large:

  • m = family (General Purpose)
  • 6 = generation (6th generation)
  • g = Graviton (ARM-based processor)
  • large = size within that type
<svg viewBox="0 0 520 170" xmlns="http://www.w3.org/2000/svg" style="width:100%;max-width:520px;font-family:monospace;font-size:14px">
  <style>
    .lbl{fill:currentColor;text-anchor:middle}
    .sub{fill:currentColor;text-anchor:middle;font-size:11px;font-family:sans-serif;opacity:0.8}
    .line{stroke:currentColor;stroke-width:1.2}
  </style>
  <text class="lbl" x="110" y="25" font-size="22">m6g.large</text>
  <line class="line" x1="40" y1="35" x2="40" y2="55"/>
  <line class="line" x1="40" y1="55" x2="40" y2="55"/>
  <line class="line" x1="40" y1="55" x2="40" y2="60"/>
  <line class="line" x1="40" y1="60" x2="40" y2="60"/>
  <line class="line" x1="40" y1="60" x2="40" y2="65"/>
  <line class="line" x1="40" y1="35" x2="40" y2="140"/>
  <text class="sub" x="150" y="140">Instance family letter (m)</text>
  <line class="line" x1="70" y1="35" x2="70" y2="105"/>
  <text class="sub" x="150" y="105">Generation number (6)</text>
  <line class="line" x1="95" y1="35" x2="95" y2="70"/>
  <text class="sub" x="150" y="70">Processor variant: g = Graviton/ARM</text>
  <line class="line" x1="135" y1="35" x2="300" y2="35" />
  <text class="sub" x="380" y="35">Size tier (large)</text>
</svg>

The Main EC2 Instance Families

FamilyLettersBest for
General PurposeM, T, AWeb servers, small-to-medium databases, dev/test
Compute OptimizedCBatch processing, video encoding, scientific modeling
Memory OptimizedR, X, ZIn-memory caches, large databases, real-time analytics
Storage OptimizedI, D, HNoSQL databases, data warehousing, distributed file systems
Accelerated ComputingP, G, InfML training/inference, graphics rendering, HPC

General Purpose (M, T)

t family instances are burstable — they accumulate CPU credits during idle periods and spend them during spikes, which makes them ideal for variable, low-average-load workloads like a small web app.

aws ec2 run-instances \
  --image-id ami-0abcdef1234567890 \
  --instance-type t4g.medium \
  --key-name my-key-pair \
  --security-group-ids sg-0123456789abcdef0 \
  --subnet-id subnet-0123456789abcdef0

m family instances provide steady, non-burstable performance — the default safe choice for production application servers without a specialized bottleneck.

Compute Optimized (C)

C-family instances carry a higher vCPU-to-memory ratio, suited to CPU-bound workloads like video transcoding or batch data processing.

aws ec2 run-instances \
  --image-id ami-0abcdef1234567890 \
  --instance-type c7g.xlarge \
  --count 3 \
  --key-name my-key-pair

Memory Optimized (R, X)

R-family instances skew heavily toward RAM relative to vCPU, the natural fit for in-memory databases like Redis/Memcached or large analytical workloads held entirely in memory.

import boto3

ec2 = boto3.resource("ec2")
instance = ec2.create_instances(
    ImageId="ami-0abcdef1234567890",
    InstanceType="r6g.2xlarge",
    MinCount=1,
    MaxCount=1,
    TagSpecifications=[{
        "ResourceType": "instance",
        "Tags": [{"Key": "Name", "Value": "redis-cache-node"}]
    }]
)

Storage Optimized (I, D)

I-family instances ship with high-throughput, low-latency NVMe SSD storage directly attached — ideal for NoSQL databases (Cassandra, MongoDB) needing fast local disk I/O rather than network-attached EBS.

Accelerated Computing (P, G)

P and G family instances attach GPUs for ML training (P-family, higher-end GPUs) or inference/graphics workloads (G-family). g5.xlarge, for example, is a common choice for cost-efficient ML inference.

Choosing the Right Type: A Practical Approach

  1. Start with CloudWatch metrics on an existing workload — CPU utilization, memory pressure (via CloudWatch agent), and network throughput tell you which resource is actually the bottleneck.
  2. Match the bottleneck to a family. CPU-bound → Compute Optimized. Memory-bound → Memory Optimized. Neither clearly dominant → General Purpose.
  3. Default to Graviton (ARM, g suffix) when your software supports it — most modern runtimes (Node, Python, Java, Go) run natively on Graviton with meaningfully lower cost.
# Use Compute Optimizer to get AWS's own right-sizing recommendation
aws compute-optimizer get-ec2-instance-recommendations \
  --instance-arns arn:aws:ec2:us-east-1:123456789012:instance/i-0123456789abcdef0

Checking Current Instance Pricing and Specs

aws ec2 describe-instance-types \
  --instance-types m6g.large c7g.xlarge r6g.2xlarge \
  --query "InstanceTypes[].{Type:InstanceType,vCPUs:VCpuInfo.DefaultVCpus,MemoryMiB:MemoryInfo.SizeInMiB}" \
  --output table

FAQ

Q: What's the difference between M and T family instances? A: T-family is burstable (CPU credits, cheaper baseline, good for variable load); M-family delivers consistent baseline performance, better for steady production traffic.

Q: Should I always choose Graviton instances? A: Choose Graviton when your application and dependencies support ARM64 — for most modern stacks they do, and the price-performance gain is real. Legacy x86-only binaries are the main blocker.

Q: How do I know if I'm using the wrong instance type? A: Sustained CPU above 80% signals under-provisioning (move up a size or compute-optimized family); consistently low CPU/memory utilization signals over-provisioning (downsize or switch to burstable).

Q: Are Spot Instances tied to a specific instance type? A: No — Spot pricing applies across most instance types, but availability varies by type, size, and Availability Zone; diversifying across several types improves Spot availability.

Right-Size Your AWS Infrastructure with F9infotech

Picking the correct EC2 instance type at scale across dozens of workloads is where real savings and performance gains hide. F9infotech's AWS cost optimization team can audit your fleet and right-size it properly. Contact us for a free instance review.