← AWS labs EC2 machines · Days 54 to 57

AWS labs · Lesson 5 · EC2

Every EC2 machine, on one page

AWS sells over 1,300 kinds of virtual machine in over 160 families. That sounds like a lot to memorise, but you don't need to. Every name follows one pattern, every family is a fixed mix of CPU and memory, and every size doubles the one before it. Learn those three things, plus a few prices, and you can size a machine as soon as you hear someone describe their problem.

The whole of EC2 in four sentences
  1. An instance is a slice of a real server. The name says which kind of server and how big a slice: m8g.xlarge = family m, generation 8, chip g (Graviton), size xlarge.
  2. The family letter is a memory-to-CPU ratio. C gives 2 GiB per vCPU, M gives 4, R gives 8, X gives 16 or more. Everything else (GPUs, fast disks, huge memory) is a special family.
  3. Each size step doubles everything, including the price. Within a family, you pay the same per vCPU at every size.
  4. Monthly price ≈ hourly price × 730. Graviton (g) is the cheapest chip, Spot is 50 to 90% off but can be taken away, and a 1 or 3 year commitment saves roughly 25 to 50%.
Linux, on-demand, USD. Data from AWS's price file, .

01 An instance is a slice of a real server

Somewhere in a data centre there is a physical box with two processors, a few hundred gigabytes of memory, some fast disks and a network card. AWS cuts that box into slices and rents you one. The name of your instance tells you how big the slice is.

Try it. Drag to turn the server (open it on its own to zoom). Move the size and watch how much of the host lights up. Switch C, M and R: the processors stay the same, only the memory changes. That is the real difference between those families (c7i, m7i and r7i all run on the same Intel chips), and it's why R costs more than C for the same vCPUs. The stick counts are a teaching model: AWS doesn't publish how its hosts are filled, but the totals (384, 768 and 1,536 GiB for the whole host) are the real .metal sizes.

What you actually get

vCPU
One hardware thread. On Intel and older AMD chips a physical core runs two threads, so 2 vCPU = 1 core. On Graviton and on AMD from generation 7 onwards, 1 vCPU is a whole core.
Memory (GiB)
RAM reserved for you alone. It is never shared or overcommitted, except on the burstable T family, where the CPU (not the memory) is shared.
Storage
Usually none inside the slice. You attach EBS volumes, which are network disks that outlive the instance. Families with a d also come with local NVMe disks, which are fast but wiped when the instance stops.
Network
A share of the host's network card: "up to 12.5 Gigabit" for small sizes (a burst rate), and a fixed 25, 50, 100 or more for big ones.

Why sizes double

A host is cut in halves, then halves of halves. A 48xlarge is the whole host, a 24xlarge is half, a 12xlarge a quarter, and so on down to large, which is 1/96 of it. Because the slices are fair shares, the price per vCPU is the same at every size. Two large cost exactly what one xlarge costs.

What .metal means

The whole server with no hypervisor. It costs the same as the biggest virtual size. People use it to run their own hypervisor, for software licensed per physical core, or to read low-level hardware counters.

NitroAWS moved networking, storage and security onto its own add-in cards (the Nitro system). So nearly all of the host's CPU and memory is available to sell, and that's why every modern instance gets EBS and network "for free" without using your vCPUs.

02 Read any instance name

Every name has the same four parts. Type one in, or click an example.

The letters after the number

LetterMeansExample
gAWS Graviton (ARM) processor, the cheapestm8g
aAMD processorm8a
iIntel processorm8i
dLocal NVMe disks includedm8gd
nExtra network bandwidthc8gn
bExtra EBS (block storage) bandwidthr8gb
eExtra of something: memory, disk or networkx2iedn, i8ge
zHigh clock speedr7iz
-flexCheaper, full speed most of the time but not guaranteedm7i-flex
-24tb, -b200Memory size or GPU model, spelled outu7in-24tb, p6-b200

The size ladder, in words

SizevCPU (most families)
nano · micro · small2 (T family only, less memory)
medium1 (Graviton, AMD) or 2 (T)
large2
xlarge4
2xlarge8
4xlarge16
Nxlarge4 × N
metalthe whole server

Rule: vCPU = 4 × the number before "xlarge". A 12xlarge has 48 vCPU, a 48xlarge has 192.

GenerationThe number is the hardware generation. Higher is newer and almost always better value. Old families like m4 and c4 are still on sale but cost more than new ones for less speed. When in doubt, pick the newest generation that your software supports.

03 The family map

AWS groups families into five categories. Inside each card: the letter, a way to remember it, its memory per vCPU, what people use it for, and the price of a typical size in the newest generation.

04 The shape chart: every instance as one dot

Each dot is one instance type, placed by its vCPUs (across) and memory (up). Both axes double at each gridline. The dashed lines are the ratios: every dot on the "8 GiB per vCPU" line is an R-shaped machine, whatever its name.

Pick a category to colour it. Hover a dot for its name and price. Notice how general, compute and memory families sit on three parallel lines, while storage and accelerated instances scatter: their value is the disk or the GPU, which this chart doesn't show.

05 The size ladder

Pick a family and look at the last column. The price per vCPU stays flat while everything else doubles. That's why "start small and resize" is safe: resizing costs exactly in proportion.

InstancevCPUMemory$/hour$/monthPrice$/vCPU·month

06 Intel, AMD or Graviton?

Most families come in three processor flavours. Here is the same shape (2 vCPU, 8 GiB, family M) on each chip, newest generations first.

InstanceProcessorPhysical cores$/monthvs cheapest
Default: GravitonARM chips designed by AWS. Usually the lowest price and best performance per dollar. Linux, containers, Java, Python, Node, Go and most databases run on ARM without changes. Check that your Docker images are built for arm64.
When x86 insteadSoftware that only ships for x86 (some commercial and Windows software), or a closed-source binary. Pick Intel (i) for specific instruction sets like AVX-512 and AMX, or AMD (a) when you want a full core per vCPU on x86.

07 Burstable T: cheap, until it isn't

The T family is the only one where the CPU is shared. You get a small guaranteed baseline, and you bank CPU credits whenever you use less than that. Above the baseline you spend them. When they run out, the machine is either slowed down to the baseline or (in "unlimited" mode, the default) it keeps going and you pay extra.

Try it. The slider sets how busy the CPU is; move the pointer across the tank to scrub through a day, one dot per hour. The spout always pours in 12 credits an hour, and the tap pours out whatever the CPU spends. Below 10% use the tank fills; above it, it drains, and once empty the CPU is held to the baseline. The figure starts half full and shows standard mode (see unlimited mode below).

The numbers for t3.micro

  • 2 vCPU, 1 GiB, .
  • Earns 12 credits an hour. One credit = one vCPU at 100% for one minute.
  • Baseline: 10% of each vCPU. It can bank up to 288 credits (24 hours of earning).
  • Unlimited mode: surplus use costs $0.05 per vCPU-hour on Linux.

Use T when

The average load is low and the peaks are short: a personal site, a dev box, a bastion host, a small internal tool. Don't use T for anything busy all day, like a build server or a steady API. There an M or C costs about the same and never slows down. If a T instance is always out of credits, move it to m or c.

08 GPUs and AI chips

For AI work the question is rarely "how many vCPUs". It's "how much accelerator memory": the model has to fit in it. Rule of thumb for running a model at 16-bit precision: about 2 GB per billion parameters, plus room for the conversation (the KV cache). Squeezing it to 4-bit needs about a quarter of that.

InstanceAcceleratorCountAccel. memoryFits at 16-bit$/hour$/monthTypical use

Two families of GPU

G = graphics and inference. One to eight mid-range GPUs (T4, A10G, L4, L40S, RTX PRO). Use them to serve models, render video and graphics, or run remote workstations.

P = premium training. Eight top data-centre GPUs (A100, H100, H200, B200, B300) joined by very fast links. Use them to train or fine-tune large models. This is the most expensive hardware AWS rents.

AWS's own chips

Inf (Inferentia) serves models and Trn (Trainium) trains them, usually for a lower price than comparable NVIDIA GPUs. The catch: you use the AWS Neuron SDK instead of CUDA, so not every model works on day one. F has FPGAs and VT has video-transcoding chips. Both are niche.

09 Prices to remember

You don't need every price. You need a few anchors, so that "$50 a month" or "$40,000 a month" lands somewhere in your head. The scale is logarithmic: each gridline is ten times the one before.

10 Ways to pay, and the rest of the bill

The same machine has four prices, depending on how much you promise and how much risk you accept.

On-Demand
Pay by the second, stop any time. The price everyone quotes, and the one used on this page.
Savings Plans
Promise to spend a fixed amount per hour for 1 or 3 years. The "Compute" plan applies to any family, size or region, so it's the safe default. "No upfront" is shown here; paying upfront saves a little more.
Reserved Instances
The older form of the same deal, tied to one instance type. Similar discount, less flexible.
Spot
AWS's spare capacity at a big discount, but AWS can take it back with two minutes' warning. Great for batch jobs, CI, rendering and stateless workers that can restart. Never for a single database.

The instance is not the whole bill

New AWS users are often surprised by these. Fill in a setup and see the monthly total.

Rates for us-east-1: gp3 $0.08 per GB-month, public IPv4 $0.005 per hour while it's assigned (about $3.65 a month), data out $0.09 per GB after the first 100 GB a month, which are free across your account. A stopped instance costs nothing for compute, but its EBS disk keeps billing, and so does an Elastic IP left attached to it.

11 Hear a problem, pick a machine

This is the skill the whole page builds towards. When someone describes their workload, listen for the clue words: they tell you the family. The numbers they give tell you the size.

The clue words

When you hear…ThinkBecause
"small site", "dev box", "mostly idle", "a few users"t4g / t3Low average CPU; credits cover the peaks
"web app", "API", "Kubernetes nodes", "a bit of everything"mBalanced; the safe default
"CPU-bound", "encoding", "batch", "CI builds", "high traffic web"cMost CPU per dollar, little memory
"database", "cache", "Redis", "analytics", "JVM with a big heap"rMemory is the bottleneck
"in-memory database", "SAP", "terabytes of RAM"x / u16 GiB+ per vCPU, up to 32 TB in one box
"lots of IOPS", "Cassandra", "Kafka", "Elasticsearch", "low-latency disk"iLocal NVMe, millions of IOPS
"hundreds of terabytes", "Hadoop", "cheap bulk disk"dLocal hard drives, cheapest per TB on a machine
"serve a model", "inference", "video rendering", "remote desktop"g / infMid-range GPUs or Inferentia
"train", "fine-tune", "multi-GPU", "H100"p / trnTop GPUs with fast interconnect
"per-core licence", "single-thread speed", "EDA", "game server"z1d, r7iz, m8aznHighest clock speeds
"network appliance", "firewall", "100 Gbps"c8gn and other …nExtra network bandwidth
"MPI", "weather or CFD simulation", "tightly coupled"hpc7gLow-latency EFA networking, priced for HPC
"build iOS apps", "Xcode"macReal Macs on dedicated hosts, 24-hour minimum
"can be interrupted", "restartable", "queue of jobs"SpotSame machine, 50 to 90% off

The sizer

Type the needs you heard. It searches every instance in the chosen region and lists the cheapest that fit.

InstanceCategoryvCPUMemoryExtra$/monthSpot $/month

12 Every instance

The full list for the chosen region. Click a column to sort. Search accepts a family (r8g), a chip (graviton4) or a GPU (h100).

InstanceCategoryvCPUGiB GiB/vCPUAccel.Local disk Network$/hour$/monthSpot $/hProcessor

The table shows 150 rows until you ask for all of them.

13 Self-check

Ten situations. Pick the best answer; the reason appears after you choose.

Glossary

Instance type
The full name, like m8g.xlarge: the shape and size of the machine.
AMI
Amazon Machine Image: the disk image the instance boots from (Amazon Linux, Ubuntu…). It must match the processor: an arm64 AMI for Graviton, x86_64 for Intel and AMD.
EBS
Elastic Block Store: network disks you attach to an instance. They survive stop and start. gp3 is the everyday type.
Instance store
Local NVMe disks inside the host (families with d, and i). Very fast, but the data is lost when the instance stops or the host fails.
Nitro
AWS's hardware and lightweight hypervisor that run every modern instance.
ENA / EFA
Elastic Network Adapter (normal fast networking) and Elastic Fabric Adapter (extra-low-latency networking for HPC and multi-GPU training).
Placement group
A hint to AWS to put instances close together (for speed) or spread apart (for resilience).
Burstable / CPU credits
The T family's model: a guaranteed baseline plus a bank of credits for short bursts.
Spot interruption
AWS reclaiming a Spot instance with two minutes' notice when it needs the capacity back.
Savings Plan
A 1 or 3 year promise to spend a fixed dollar amount per hour, in exchange for a discount.

Use this in the roadmap

EC2 machines · AWS labs Prices as of · rebuild with tools/build_data.py