Where EC2 runs
An EC2 instance is a virtual machine on a physical host in one Availability Zone. Its instance type determines vCPU, memory, storage, and network performance. Choose from workload measurements instead of oversizing “just in case” — you can change the type later.
flowchart LR W["Workload metrics<br/>CPU, RAM, network"] --> F["Family<br/>m, c, r, t"] F --> G["Generation<br/>7 = newer"] G --> P["Processor<br/>g = Graviton"] P --> S["Size<br/>large, xlarge"] S --> I["m7g.large<br/>2 vCPU, 8 GiB"] %% step W: Start from measurements of the real workload, not guesses. %% step F: The family letter says what the type is optimised for. %% step G: A higher generation number usually gives better price-performance. %% step P: Extra letters describe the processor or features, such as g for AWS Graviton (Arm). %% step S: The size scales vCPU and memory, each step roughly doubling the previous one. %% step I: Together they name one exact configuration.
Reading an instance type
In m7g.large, m is the general-purpose family, 7 is the generation, g identifies an AWS Graviton processor, and large is the size. Other attribute letters you will meet: i Intel, a AMD, d local NVMe instance store, n enhanced networking, e extra memory or storage.
| Family | Optimised for | Typical use |
|---|---|---|
| T (t3, t4g) | Burstable general purpose | Dev boxes, small web apps |
| M (m7i, m7g) | Balanced general purpose | App servers, mid-size databases |
| C (c7g) | Compute | Batch, encoding, high-traffic web |
| R, X (r7g, x2) | Memory | In-memory caches, large databases |
| I, D (i4i) | Storage, local NVMe | NoSQL, data warehouses |
| P, G, Inf, Trn | Accelerated (GPU, ML chips) | ML training and inference, graphics |
Burstable T instances
The T family is burstable. An instance earns CPU credits while CPU use is below its baseline and spends them while bursting above it. When credits run out, a t-instance in standard mode drops back to the baseline; in unlimited mode (the default for t3/t4g) it keeps bursting and you pay for surplus credits. For sustained high CPU, monitor CPUCreditBalance and CPUSurplusCreditBalance or choose a non-burstable family such as M or C.
Graviton and architecture
Graviton (Arm64) types usually offer better price-performance than comparable x86 types. The AMI must match the architecture: an arm64 AMI does not boot on an x86 type and vice versa, and your application and container images must have Arm builds.
Choose with data
Monitor CPU, memory (through the CloudWatch Agent — memory is not a default EC2 metric), disk and network. Rightsizing means changing type when measurements show too much or too little capacity; AWS Compute Optimizer analyses CloudWatch history and recommends types. Changing type on an EBS-backed instance requires a stop and start.
| Command | Purpose |
|---|---|
aws ec2 describe-instance-types --instance-types t3.micro |
View vCPU and memory |
aws ec2 describe-instance-types --filters Name=processor-info.supported-architecture,Values=arm64 |
Filter types by architecture |
aws ec2 modify-instance-attribute --instance-id i-0a1b2c3d --instance-type Value=t3.small |
Change type (instance stopped) |
Traps: reading g as "GPU" in m7g; launching an x86 AMI on a Graviton type; ignoring the CPU credit balance of a busy t3 instance.