Instance types
The EC2 instance families, how to read a name like m7g.2xlarge, burstable instances, processor choices, and how to pick a type.
What it is
An instance type decides the hardware an instance gets: how many virtual CPUs (vCPUs), how much memory, what network speed, and whether it has local disks or GPUs. AWS offers hundreds of types, grouped into families that are tuned for different kinds of work.
Picking the right type matters for both cost and speed. A database short on memory is slow whatever the price; a web server on a huge memory-optimized type wastes money every hour.
The families
- General purpose (M, T, Mac): a balance of compute, memory and networking. Web servers, code repositories, small databases, development machines. The course's
t2.microis one. - Compute optimized (C): fast processors for CPU-heavy work. Batch processing, media transcoding, high-performance web servers, scientific modelling, machine-learning inference, dedicated game servers.
- Memory optimized (R, X, U, z): lots of RAM for data processed in memory. High-performance relational and NoSQL databases, in-memory caches, real-time analytics of big unstructured data, business-intelligence databases.
- Storage optimized (I, D, Im, Is): fast local disks with very high read and write rates. High-frequency OLTP systems, NoSQL databases such as Cassandra, caches for in-memory databases like Redis, data warehousing, distributed file systems.
- Accelerated computing (P, G, Inf, Trn, F, VT): GPUs or other chips for machine-learning training, graphics and video.
- HPC optimized (Hpc): many cores and a fast network for large simulations, such as weather forecasting.
How to read a type name
- Series: the first letter or letters give the family:
mgeneral purpose,ccompute,rmemory,istorage,tburstable,p/gGPU. - Generation: the number. Higher is newer, and newer generations usually give better performance for the same or a lower price.
- Options: letters after the number. Common ones are
g(AWS Graviton processor),a(AMD),i(Intel),d(local NVMe instance store disks),n(extra network bandwidth),e(extra memory or storage),flex(lower-cost flexible performance). - Size: after the dot:
nano,micro,small,medium,large,xlarge, then2xlargeand up. Each size up roughly doubles the vCPUs, memory and price.metalmeans the whole physical server with no virtualisation.
So c7gn.4xlarge is compute optimized, 7th generation, Graviton, extra networking, size 4xlarge.
An example spread of types
The course compares five types. They show how much the families differ:
| Instance | vCPU / memory | Network |
|---|---|---|
| t2.micro | 1 / 1 GiB | low to moderate |
| t2.xlarge | 4 / 16 GiB | moderate |
| c5d.4xlarge | 16 / 32 GiB | up to 10 Gbps |
| r5.16xlarge | 64 / 512 GiB | 20 Gbps |
| m5.8xlarge | 32 / 128 GiB | 10 Gbps |
Notice the d in c5d: it's the only one with a local disk, a 400 GB NVMe SSD. The others use only EBS volumes. And r5 has four times the memory per vCPU of c5d.
Burstable instances (the T family)
Many servers sit mostly idle and need full CPU only now and then. Burstable instances (T4g, T3, T3a, and newer T8i and T9g) are built for that:
- Each instance has a baseline CPU level, for example 10% of a vCPU.
- When it runs below the baseline, it earns CPU credits. When it needs more, it spends credits to burst above the baseline.
- In standard mode it slows back to the baseline when credits run out. In unlimited mode (the default for T3 and newer) it keeps bursting for a small extra charge.
They're the cheapest way to run small, spiky workloads such as test servers and low-traffic websites. A server that is busy all the time is cheaper on an M or C type.
Processor choices
The same family often comes in three processor versions:
- Intel (
i, or no letter on older types): the default; runs everything built for x86. - AMD (
a): x86 too, usually about 10% cheaper. - AWS Graviton (
g): AWS's own Arm-based chips, with the best price-performance and lower energy use. The software must be built for Arm (64-bit), which most Linux software, containers and managed runtimes already are.
Updated since the slides
The slides list families up to the 6th generation. AWS now sells 7th and 8th generation types (and some 9th generation Graviton types), plus flex types. The way names work hasn't changed, and the exam doesn't test specific generations.
Choosing a type
- Start from the workload: is it limited by CPU, memory, disk or network?
- Pick the family, then the smallest size that fits, on the newest generation.
- Test it under real load. Billing is per second, so trying three types costs little.
- Keep checking. AWS Compute Optimizer reads the instances' metrics and recommends a smaller or bigger type.
An instance's type can be changed later: stop it, change the type, start it.
Exam tips
- "In-memory database", "real-time big data in memory", "large cache" → memory optimized (R, X).
- "Batch processing", "HPC", "media transcoding", "gaming servers" → compute optimized (C).
- "High sequential read/write on local storage", "OLTP", "data warehousing" → storage optimized (I, D).
- "Machine learning training", "GPU" → accelerated computing (P, G, Trn).
- "Spiky, low average CPU", "cheapest for a small website" → burstable T instances.
- "Best price-performance" → Graviton (
g) types, if the software runs on Arm.
Common traps
- "Change the instance type of a running instance." It must be stopped first (for EBS-backed instances).
- "Burstable instances give full CPU all the time." Only up to the baseline, plus credits.
- "Graviton runs any software." Only software built for Arm; a Windows x86 app won't run on it.
Hands-on lab: explore instance types from the CLI
Goal: look up instance specifications and where they're available, without launching anything.
Free
The EC2 describe API calls and AWS CloudShell are free.
Open CloudShell
In the console, switch to us-east-1 and open CloudShell (the terminal icon in the top bar).
Compare two types
aws ec2 describe-instance-types --instance-types t3.micro m7g.2xlarge \
--query "InstanceTypes[].[InstanceType,VCpuInfo.DefaultVCpus,MemoryInfo.SizeInMiB,ProcessorInfo.SupportedArchitectures[0],NetworkInfo.NetworkPerformance]" \
--output tableYou'll see t3.micro with 2 vCPUs, 1,024 MiB and x86_64, and m7g.2xlarge with 8 vCPUs, 32,768 MiB and arm64.
List a family
aws ec2 describe-instance-types \
--filters "Name=instance-type,Values=r7g.*" \
--query "sort_by(InstanceTypes,&MemoryInfo.SizeInMiB)[].[InstanceType,MemoryInfo.SizeInMiB]" \
--output tableThe memory doubles with each size step.
Check where a type is offered
aws ec2 describe-instance-type-offerings --location-type availability-zone \
--filters "Name=instance-type,Values=m7g.large" --output tableNot every type exists in every Availability Zone. This tells you which AZs have it.
Expected result: you can read any type's vCPUs, memory, processor and network speed, and check where it's offered, before you pay for it.
Clean up: nothing to delete.