Amazon Elastic Compute Cloud (EC2)

Basics of EC2

Instance Types

Amazon Elastic Compute Cloud (EC2) offers a wide selection of instance types optimized for specific workloads. Selecting the right EC2 instance type ensures you balance compute, memory, storage, and networking to meet performance and cost objectives.

EC2 Instance Families

Every EC2 instance family begins with a distinctive letter that highlights its primary use case. Below is a summary of the major instance families:

Instance FamilyUse CaseExamples
General PurposeBalanced CPU, memory, and networkingT2, T3, M5
Compute OptimizedHigh-performance processorsC5, C6
Memory OptimizedIn-memory databases and analyticsR5, X1
Accelerated ComputingGPUs, FPGAs for ML, graphics, and computeP4, G4, F1
Storage OptimizedHigh-throughput local storage (I/O)I3, D3
HPC OptimizedLow-latency, high-throughput networkingHPC6

Note

Evaluate your application’s resource requirements—CPU, RAM, disk I/O, and network bandwidth—to identify the optimal instance family.

Key Benefits of Right-Sized Instances

Choosing the right EC2 instance type delivers:

  1. Performance Optimization
    Match vCPU, memory, storage, and networking to workload demands for minimal latency and maximum throughput.
  2. Cost Efficiency
    Right-size your instances to avoid overprovisioning and reduce AWS charges.
  3. Specialized Workloads
    Utilize GPUs, FPGAs, or large RAM pools for AI/ML training, real-time analytics, or high-performance databases.
  4. Scalability & Flexibility
    Resize or switch instance types seamlessly as demand fluctuates.
  5. Architectural Alignment
    Leverage enhanced networking (ENA), EBS-optimized instances, and Nitro system features where needed.

The image lists five benefits: performance optimization, cost optimization, specialized workloads, scalability and flexibility, and architecture optimization. Each benefit is accompanied by an icon and a number.

Instance Sizes and Scaling

Within each family, instance sizes typically double CPU and memory resources at each tier. For example, a “medium” instance might offer 1 vCPU and 4 GiB of RAM, scaling up as shown:

SizevCPUsMemory
medium14 GiB
large28 GiB
xlarge416 GiB
2xlarge832 GiB
4xlarge1664 GiB
8xlarge32128 GiB
12xlarge48192 GiB
16xlarge64256 GiB

Actual vCPU, memory, network bandwidth, and EBS throughput vary by family and generation.

Warning

Always consult the AWS EC2 Instance Types documentation before provisioning, as configurations and pricing change frequently.

Further Reading

Watch Video

Watch video content

Previous
AMIs and need of it