AWS EC2 Instance Types Guide: Instance Families, Sizing, Classes and Comparison

What Are EC2 Instance Types
An EC2 instance type is a specific bundle of virtual CPU, memory, storage, and network capacity that AWS packages under a name, such as m6i.large or c7g.2xlarge. Each type belongs to a broader instance family that is optimized around a particular resource, whether that is balanced compute, raw CPU power, memory capacity, storage throughput, or GPU acceleration.
The reason this matters is cost. Two instances can offer the same amount of vCPU but wildly different memory, and paying for memory your application never touches adds up fast across a fleet of servers running continuously.
How to Read an EC2 Instance Type Name
AWS instance type names follow a consistent pattern once you know what each part represents. Take c7g.2xlarge as an example.
c is the instance family, in this case compute optimized.
7 is the generation number. Higher numbers generally mean newer hardware and better price to performance.
g is an optional attribute indicating the processor, here AWS Graviton, its own ARM based chip.
2xlarge is the size within that family, indicating the amount of vCPU and memory relative to the smallest size.
Common processor suffixes you will run into include g for Graviton, a for AMD, i for Intel, d for local NVMe storage attached, and n for enhanced networking bandwidth. These can combine, so an instance type like c7gn is compute optimized, running on Graviton, with extra network bandwidth built in.
EC2 Instance Families Explained
AWS groups its EC2 instance types into five broad categories. Each one is built around a different resource ratio, and understanding that ratio is the fastest way to narrow down your options.
General Purpose Instances (T and M Families)
General purpose instances offer a balanced ratio of roughly 4 GiB of memory per vCPU, which makes them the right default when you are not sure where your workload's bottleneck will be.
The M family, including M6i, M6a, M6g, and M7i, is built for steady, predictable workloads like application servers, small to medium databases, and microservices. The T family, including T3, T3a, and T4g, uses a burstable credit system instead of consistent full power CPU. You accumulate CPU credits during idle periods and spend them during traffic spikes, which makes T instances a good fit for dev environments, low traffic web servers, and anything with unpredictable but generally light usage.
Compute Optimized Instances (C Family)
Compute optimized instances shift the ratio toward CPU, typically around 2 GiB of memory per vCPU. The C family, including C6i, C6g, and C7g, is built for workloads where processing power matters more than memory capacity.
Typical use cases include batch processing, video encoding and transcoding, high performance web servers, scientific modeling, and game servers that need fast, consistent tick rates. If your application is CPU bound with a relatively modest memory footprint, this family usually beats general purpose on price for the same performance.
Memory Optimized Instances (R, X, and Z Families)
Memory optimized instances flip the ratio again, offering around 8 GiB of memory per vCPU in the R family, with X and Z instances pushing even further for extreme cases.
The R family, including R6i, R6a, and R7g, fits in-memory databases, real time analytics, and caching layers like Redis or Memcached. The X family is built for even larger memory footprints, commonly used for SAP HANA and other enterprise databases that need very large working sets in memory. Z1d instances combine high memory with a high sustained CPU clock speed, which suits licensing models that charge per core and reward fewer, faster cores.
Storage Optimized Instances (I, D, and H Families)
Storage optimized instances are built around fast, high throughput local storage rather than CPU or memory ratios. The I family uses local NVMe SSDs for extremely low latency, high IOPS workloads like distributed databases and search indexes. The D family focuses on dense, high throughput sequential storage, common in big data processing and data warehousing where you are reading and writing large blocks of data continuously.
Accelerated Computing Instances (P, G, Trn, and Inf Families)
Accelerated computing instances include a hardware accelerator, most commonly a GPU, alongside standard CPU and memory. P instances target machine learning training and high performance computing. G instances are tuned more toward graphics workloads, video rendering, and machine learning inference. Trn and Inf families use AWS's own custom silicon, Trainium and Inferentia, purpose built for training and running machine learning models at a lower cost than general purpose GPU instances.
EC2 Instance Sizing Explained
Within every family, AWS offers a range of sizes, and understanding EC2 sizing is just as important as choosing the right family. Sizes typically scale in a predictable progression: nano, micro, small, medium, large, xlarge, 2xlarge, 4xlarge, and so on up to some families offering sizes like 24xlarge or even metal, which gives you direct access to the underlying physical server with no virtualization layer.
Each step up roughly doubles the vCPU and memory of the previous size while keeping the same CPU to memory ratio for that family. This means moving from m6i.large to m6i.xlarge doubles both your vCPU count and memory, but the underlying balance between the two stays consistent.
A Practical Approach to EC2 Sizing
Start with your workload's actual resource profile. Look at real CPU and memory utilization data if you have an existing server to migrate, rather than guessing.
Match the family to your bottleneck. If memory is your constraint, look at R family sizes first. If CPU is the constraint, start with C family.
Pick a size in the middle of the range rather than the extremes. Starting too small means constant resizing, starting too large wastes budget before you have real usage data.
Use AWS Compute Optimizer. This free tool analyzes your actual CloudWatch metrics and recommends a better sized instance type based on real usage, not guesswork.
Reassess after 30 to 60 days of production traffic. Initial sizing is always an estimate. Real usage patterns should drive your next resize.
EC2 Instance Types Comparison
Family | Optimized For | vCPU to Memory Ratio | Common Types | Best Fit |
|---|---|---|---|---|
General Purpose (T, M) | Balanced workloads | ~4 GiB per vCPU | t4g, m6i, m7g | Web servers, dev/test, small databases |
Compute Optimized (C) | CPU heavy tasks | ~2 GiB per vCPU | c6i, c7g, c6a | Batch processing, encoding, game servers |
Memory Optimized (R, X, Z) | RAM heavy tasks | ~8 GiB per vCPU or more | r6i, r7g, x2idn | In memory databases, caching, analytics |
Storage Optimized (I, D, H) | High IOPS or throughput | Varies, storage focused | i4i, d3, h1 | Distributed databases, big data, data warehousing |
Accelerated Computing (P, G, Trn, Inf) | GPU or ML acceleration | Varies, accelerator focused | p4d, g4dn, trn1, inf2 | ML training and inference, video rendering |
Should You Choose Graviton or x86 Instances
One decision that cuts across every family is whether to run on AWS Graviton, its custom ARM based processor, or a traditional x86 chip from Intel or AMD. Graviton instances, identifiable by the g in their name like m7g or c7g, generally offer meaningfully better price to performance than comparable x86 instances for workloads that support ARM architecture.
The catch is compatibility. Most modern software and popular language runtimes support ARM natively now, but if you are running older applications, specific commercial software, or binaries compiled only for x86, you will need to verify ARM support or stick with an a or i suffixed instance instead. For new projects built on current frameworks, testing on Graviton first is usually worth the effort given the cost savings.
Conclusion
Choosing the right EC2 instance type comes down to identifying your workload's actual bottleneck, whether that is CPU, memory, storage throughput, or the need for a hardware accelerator, and then matching that to the family built around it. From there, sizing is about starting reasonably close to your real usage and refining with actual data rather than guessing upfront. Use AWS Compute Optimizer once you have production traffic flowing, and revisit your instance choices periodically since AWS regularly ships newer generations with better price to performance than the ones you started with.
Frequently Asked Questions

AllExamQuestions Editorial Team
AllExamQuestions Editorial Team creates high-quality exam preparation content, practice resources, and certification guides to help learners achieve their goals.
Our content is carefully researched, regularly updated, and reviewed for accuracy and relevance.
