"A bigger instance is always faster." Not if it's the wrong shape. An application that is short of memory gains little from more CPU cores, and a tiny website gains nothing from a GPU. Pick the wrong family and you pay for power your app never uses. The good news: the instance type name tells you almost everything, once you know how to read it.
An instance type is a recipe
Every EC2 instance type is a fixed combination of CPU, memory, storage and network capacity. AWS offers hundreds of them, grouped into families built for different kinds of work. You choose the type at launch, and you can change it later (for most EBS-backed instances, by stopping the instance, changing the type and starting it again).
How to read the name
Take m7g.large:
- m is the series: what the instance is shaped for.
- 7 is the generation: a higher number is newer hardware.
- g is an option: an extra detail about the hardware.
- large is the size, after the dot.
Another example from the AWS docs is c7gn.xlarge: series C, generation 7, options g and n, size xlarge.
The series: pick the shape
The most common series letters:
- M: general purpose. A balanced mix; a sensible default for web and application servers.
- T: burstable. Cheap instances for small or spiky workloads that are idle most of the time.
- C: compute optimized. More CPU per dollar, for batch processing, encoding or busy APIs.
- R: memory optimized. Lots of RAM, for in-memory caches and databases. X goes further still.
- I and D: storage optimized and dense storage, for workloads that hammer local disks.
- P and G: GPU instances (more on these below).
Options and size
Option letters add detail. The ones you will meet most:
- g: AWS Graviton processors (Arm-based).
- a: AMD processors. i: Intel processors.
- d: local instance store disks attached to the host. Fast, but the data is lost when the instance stops.
- n: network and EBS optimized.
Sizes run from nano and micro up through large, xlarge, 2xlarge and beyond, with metal for bare metal. Within a family, each step up roughly doubles the vCPUs and memory, and roughly doubles the price.
Two practical tips. First, a newer generation usually gives you more performance for the money, so check whether a newer one exists before you launch an old favourite. Second, Graviton instances are often cheaper for the same work, but your software must run on Arm; test before you switch.
A common mistake is "fixing" a slow application by going one size up, again and again. Look at the metrics first. If memory is the bottleneck, moving from M to R can cost less than doubling the size.
Where AI fits
Machine learning runs on accelerated computing instances. In AWS's naming, P is the GPU-accelerated series, the one typically used to train models, and G is the graphics-intensive series, widely used for graphics work and for running inference. AWS also offers series built on its own chips: Trn (AWS Trainium) and Inf (AWS Inferentia).
These are among the most expensive instances on AWS, and popular GPU types can be hard to get. Check your service quotas for them before you plan a project: an account's quota for GPU families can start very low, even at zero.
Quick recap
- The series letter is the shape: M general, C compute, R memory, T burstable.
- The number is the generation, the option letters describe the hardware, and the size is the scale.
- P and G are the GPU families for AI training, graphics and inference.