Home/Blog/Cloud Computing/Understanding Amazon EC2 instance types
Home/Blog/Cloud Computing/Understanding Amazon EC2 instance types

Understanding Amazon EC2 instance types

17 min read
Jan 22, 2025
content
What is EC2?
Amazon EC2 instance naming
Amazon EC2 instance types
General purpose EC2 instances
M series
T series
Mac series
Compute-optimized EC2 instances
Memory-optimized EC2 instances
Accelerated computing EC2 instances
GPU-based instances
FPGA-based instances
Storage-optimized instances
I series
D series
HPC-optimized
Amazon EC2 instance type pricing
Conclusion
Getting started with Amazon EC2

Navigating the plethora of Amazon EC2’s 800+ instance types can feel overwhelming. Whether you’re optimizing for cost, performance, or both, understanding the basics of EC2 is crucial. Amazon EC2 (Elastic Compute Cloud) provides virtual servers in AWS cloud infrastructure to run applications without managing the physical hardware of the servers. With many instances, EC2 allows you to choose the instance that best matches your workload requirements. However, with such a vast variety, finding the right instance can become overwhelming, making it crucial to understand how to navigate these choices effectively. This blog will demystify EC2 instances, breaking down their families, naming conventions, and use cases so that you can choose the right one confidently.

What is EC2?#

Amazon Elastic Compute Cloud (Amazon EC2) is a web service provided by AWS that offers scalable computing capacity in the cloud. With EC2, you can launch virtual servers (instances) that run applications on-demand with flexible CPU, memory, storage, and networking configurations. EC2 is often used for web hosting, batch processing, big data analytics, and application testing, among other use cases. It enables users to scale up or down based on workload needs, paying only for the computing resources.

Amazon EC2 instance naming#

Amazon EC2 supports Intel, AMD, and ARM processors. It also provides on-demand EC2 Mac instances and up to 400 Gbps Ethernet networking. With a huge number of instances, each with its processor type, it is imperative that EC2 instances have a naming convention that can give away a certain amount of information about the instance.

Naming convention of EC2 instances
Naming convention of EC2 instances

Before exploring different types of EC2 instances, let’s first understand the distinct naming conventions of EC2 instances, i.e., m8g.medium, c8g.xlarge, and r8g.12xlarge. These names represent the two key aspects: the instance family and instance size:

  • Instance family: The instance family denotes the category of the instance based on its intended use case. Each family suits a specific workload characteristic, such as computing, memory, or storage. The instance family also represents the architectural features of the EC2 instance.

    • Instance series: The series in the instance family denotes the instance category based on suitability for a specific workload characteristic, such as compute, memory, or storage. Additionally, the option field represents the architectural features of the EC2 instance, such as AMD processor, ARM-based chips, and Intel processor.

    • Instance generation: As the name suggests, the generation represents the instance series’ version.

    • Instance options: Instance options show the processor type used and often also show if the instance has enhanced networking or a local SSD physically connected to it.

Instance options

Description

a

AMD processor

g

Graviton processor (AWS ARM-based chips)

i

Intel processor

n

Enhanced networking (higher network bandwidth)

d

Local NVMe-based SSDs are physically connected to the host server

  • Instance size: The instance size refers to the vCPUs and the amount of memory allocated to the instance. The cost of an instance generally scales with its size, as larger instance sizes provide more computing power, memory, and sometimes additional features. AWS organizes instance sizes within instance families, ranging from smaller sizes like micro to a much larger size like 24xlarge and metal.

Instance Size

Medium

Large

xlarge

2xlarge

...

24xlarge

32xlarge

vCPUs

1

2

4

8

...

96

128

Note: Not all EC2 instance generations offer the same instance options.

Amazon EC2 instance types#

Amazon EC2 offers various instances, each optimized for a different type of workload, such as compute-optimized, memory-optimized, and storage-optimized. Let’s learn about each type of instance offered by Amazon EC2.

General purpose EC2 instances#

If you are working on applications that use computing, memory, and networking resources in equal proportions, like web servers, code repositories, and databases, this is the type of instance you would want to use. General-purpose instances provide a balanced ratio of these resources. Amazon EC2 provides three series of general-purpose instances, i.e., M, T, and Mac.

M series#

Amazon EC2 provides three types of M-series general-purpose instances:

  • Graviton (g): Amazon EC2 provides these instances’ 6th, 7th, and 8th generations. The latest instance, M8g, is based on AWS Graviton4 processors with DDR5-5600 memory. It provides larger instances like m8g.metal-24xl and m8g.metal-48xl with up to 3x more memory and vCPUs than the previous generation instance (M7g). For example, generation M7g provides a maximum of 64 vCPUs and 256GiB memory (m7gd.metal), whereas the largest instance in generation M8g provides 192 vCPUs and 768 GiB of memory (m8g.metal-48xl).

  • Intel (i): Amazon EC2 provides the 4th, 5th, 6th, and 7th generation i instances. They are all based on Intel processors with improvements in every new generation. The latest instances, M7i or M7i-flex, are based on 3.2 GHz 4th Generation Intel Xeon Scalable processors. Both of these come with new advanced matrix extensions (AMX) to accelerate matrix multiplication operations and DDR5 memory, which were unavailable in the previous generations of these instances. M7i provides 15%, and M7i-flex provides 19% better price performance than M6i instances.

  • AMD (a): Amazon EC2 provides 3 generations of these instances. The latest M7a instance is based on a 3.7 GHz 4th generation AMD EPYC processor. It provides up to a 50% increase in performance over the M6a instances.

M Series

Instance

Graviton (g)

M8g, M7g, M6g

Intel (i)

M7i, M7i-flex, M6i, M6in, M5, M5n, M5zn, M4

AMD (a)

M7a, M6a, M5a

T series#

These are burstable performance Amazon EC2 instances that offer basic computing resources but can increase their capacity when needed. EC2 offers both burstable Graviton and AMD processors. The latest instance, T4g, comprises the AWS Graviton2 Processor and provides up to 40% better price performance than the T3 instances.

Mac series#

Amazon EC2 provides various generations of Mac instances. The latest Mac2 is based on Apple M1 and Apple M2 processors. The following table depicts the resources provided by different Mac instances.

Instance Generations

Processors

mac1

Intel’s 8th generation 3.2 GHz Core i7 processors

mac2

Apple M1 chip

mac2-m1ultra

Apple M2 Ultra chip

mac2-m2

Apple M2 chip

mac2-m2pro

Apple M2 Pro chip

These instances are ideal for developers who need access to MacOS to develop, build, and test applications related to iPhone, iPad, Mac, and other Apple products using the Xcode IDE.

M Series, T Series, and Mac Series

Series

Description

Use cases

M Series

Ideal to handle a mix of computing and memory requirements

  • Web and application servers
  • Small to mid-sized databases
  • Backend servers for enterprise applications


T Series

Provides the ability to burst when additional capacity is needed

Mac Series

Allows to run macOS on dedicated Mac hardware in the AWS cloud

  • iOS and macOS development
  • Testing Apple applications on macOS

Compute-optimized EC2 instances#

If you are working on a compute-intensive workload, you would want to use compute-optimized EC2 instances. These instances are designed for compute-bound applications that need high-performance processing. They are well-suited for workloads that require high CPU usage, such as media transcoding, gaming servers, and machine learning applications. Amazon EC2 provides the C series for compute-optimized EC2 instances.

Similar to an M series, The C series also provides instances of Graviton4 (g), Intel (i), and AMD (a) types. The instances of the C series have similar features, like processors, enhanced networking, and the type of memory, when compared to similar instances of the M series, but their resource allocation differs, as shown in the table below:

Instance options

vCPUs

C series memory (GiB)

M series memory (GiB)

8g.medium

1

2

4

7a.medium

1

2

4

7i.large

2

4

8

The C series focuses on CPU performance, i.e., it provides more CPUs for a similar size of memory, which is better for compute-intensive applications, while the M series takes a more balanced approach.

One might wonder why we are getting less memory instead of increased computing power, i.e., m8g.medium has 1 vCPU and 4 GiB of memory, whereas c8g.medium also has 1 vCPU but 2 GiB of memory.

This is done to save costs while getting the same computing power as the M series offers. For example, the on-demand price per instance-hour consumed for m8g.medium is $0.04488, and for c8g.medium, it is $0.03974. So, we get the same computing power for a cheaper price tag. More reason for you to understand the different EC2 instance types and choose the one according to your needs!

Compute-optimized instances are well-suited for workloads that require high CPU usages, such as media transcoding, gaming servers, scientific modeling, and machine-learning applications.

Memory-optimized EC2 instances#

Memory-optimized EC2 instances are designed for workloads that require large amounts of memory relative to CPU power. They are ideal for working on memory-intensive applications like real-time big data processing and in-memory analytics. Amazon EC2 provides R and X series for memory-optimized instances.

  • R series: The R series is similar to comparable instances of the C and M series, but they differ in resource allocation. These are designed for general-purpose memory-intensive workloads.

  • X series: Compared to the R series, the X series offers double the memory for the same number of CPUs. The instance in the X series provides an extremely high memory-to-vCPU ratio suitable for applications requiring in-memory databases with exceptionally large memory requirements. It is suitable for enterprise-scale, memory-heavy workloads.

Instance Sizes

vCPUs

C Series Memory (GiB)

M Series Memory (GiB)

R Series Memory (GiB)

X Series Memory (GiB)

8g.medium

1

2

4

8

16

8g.large

2

4

8

16

32

As we know, the C series is more tilted toward computational optimization; the M series follows a moderate approach to memory, the R series is more memory-optimized, and the X series provides further memory improvement.

  • R series instances are well-suitable for large relational databases, in-memory caching (e.g., Redis, Memcached), data analytics, and data warehousing.

  • X series instances are suitable for in-memory databases (e.g., SAP HANA, Apache Spark) and real-time big data processing.

Accelerated computing EC2 instances#

Accelerated computing EC2 instances are designed to enhance performance for compute-intensive tasks using hardware accelerators or coprocessors like GPUs or FPGAs. These instances will best fit if you work on machine learning, deep learning, floating-point number calculations, and graphics rendering. Amazon EC2 provides the following GPU-based and FPGA-based computing EC2 instances.

GPU-based instances#

GPUs are designed for parallel processing tasks requiring massive graphical or mathematical computations. Amazon EC2 provides P and G series as GPU-based accelerated computing EC2 instances:

  • P series: The P series instance is available in 2nd, 3rd, 4th, and 5th generations, with the first three versions having Intel Xeon Scalable Processors. P5 has 3rd-generation AMD EPYC processors. It provides massive processing power and multi-instance GPU support for parallel workloads with up to 8 NVIDIA Tensor Core GPUs and provides 3200 Gbps network bandwidth.

  • G series: The G series is also available in multiple generations, with AWS Graviton, Intel Xenon, or AMD EPYC processors. The latest G6e instances have third-generation AMD EPYC processors. It provides cost-efficient GPU instances (8 NVIDIA Tensor Core GPUs) for working with generative AI models, 400 Gbps network bandwidth, and 7.6 TB of local NVMe storage.

GPU-based instances are useful for deep learning training, scientific simulations, AI inference, and video rendering and transcoding tasks.

FPGA-based instances#

FPGAs (field-programmable gate arrays) are designed for hardware-accelerated applications that can perform specific tasks repeatedly with extreme efficiency. Amazon EC2 and provide F1 instances for FPGA-based accelerated computing EC2 instances. They comprise high-frequency Intel Xeon Scalable Processors with NVMe SSD storage and up to 8 Xilinx Virtex UltraScale+ VU9P FBGAs. These instances are good for workloads that require custom hardware acceleration, such as genomics research, high-frequency trading, and video processing.

Amazon EC2 offers specialized instances based on AWS Tranium (Trn1), AWS Inferentia (Inf2), and Intel Xeon Scalable (powered by 8 Gaudi/Qualcomm AI 100 accelerators) processors for performing low-cost deep learning and generative AI tasks. Moreover, Amazon EC2 offers VT1 instances comprising Intel Xeon Scalable Processors for cost-effective video processing and up to 8 Xilinx U30 media accelerator cards.

FPGA-based instances are useful for real-time processing (just-in-time transcoding) and computer vision.

Storage-optimized instances#

Storage-optimized EC2 instances are designed for workloads that require high I/O operations per second (IOPS) to access large datasets. They are ideal for workloads that require high disk throughput and low-latency local storage, such as distributed file systems, data warehousing, and big data analytics. Amazon EC2 provides I and D series for storage-optimized instances.

I series#

The I series instances are designed for workloads with a high IOPS requirement and low latency. They are equipped with SSD storage, perfect for applications where fast data access is critical. EC2 instances of the I series include g and i-type instances.

  • The latest among the g type is the i8g instance. It comprises AWS Graviton4 processors with up to 22.5 TB of NVMe SSD storage and the latest DDR 5600 memory.

  • The latest i-type instance, i4i, has very similar features to the i8g instance. It is based on 3.5 GHz 3rd-generation Intel Xeon scalable processors, up to 30TB NVMe SSD storage, and 8 GB memory per vCPU.

An understanding of the storage optimization of i-series instances can be developed by comparing them to similar compute-optimized, memory-optimized, and general-purpose instances without local storage units and relying only on Amazon Elastic Block Storage service (EBS) for storage.

Instance Sizes

vCPUs

I series Storage (GiB)

C/M/R/X Series Storage (GiB)

8g.large

2

468

EBS-only

8g.xlarge

4

937

EBS-only

The maximum network bandwidth and Amazon EBS bandwidth of I series instances can be compared as follows:

Instances

Network Bandwidth (Gbps)

EBS bandwidth (Gbps)

i8g.metal-24xl

56.25

30

i4i.metal

75

40

These instances maximize transactions per second (TPS) for high IOPS workloads that require low latency access to small to moderate-sized data sets on local storage, such as transactional databases.

The I series of the storage-optimized EC2 instances are equipped with SSD storage type, suitable for applications requiring high levels of IOPS with low latency. An example use case is a transactional database for financial services requiring real-time data transactions.

D series#

These specialized instances facilitate applications’ performing tens of thousands of low-latency I/O operations per second. The latest D3 instance comprises 3.1 GHz 2nd-generation Intel Xeon scalable processors and up to 48 TB HDD storage. These instances are best suited for parallel processing workloads.

The D series of the storage-optimized EC2 instances provide HDD storage and is a cost-effective option for applications with substantial storage needs but are less sensitive to latency and IOPS. An example use case is a content management system (CMS) that delivers large media files but doesn’t require high IOPS.

HPC-optimized#

High-performance computing (HPC) optimized EC2 instances are designed to offer the cost-effective high computational power and low-latency networking required for large-scale computational workloads on AWS. Instead of using specialized accelerators like those used by accelerated-computing EC2 instances, raw computing power is used with more cores for parallel processing.

The HPC-optimized instances are ideal for applications with high computational power and low latency networking, such as scientific simulations, financial modeling, and deep learning workloads.

Let’s look at the details of the instances that provide maximum resources for each instance option:

Instances

Cores

Memory (GiB)

Instance Storage

EFA Network Bandwidth

hpc7g.16xlarge

64

128

EBS

200

hpc7a.96xlarge

192

768

EBS

300

hpc6id.32xlarge

64

1024

NVMe SSD

200

All instances have compute-intensive resources and high network bandwidth through an Elastic Fabric Adapter (EFA), which increases performance for network-intensive applications. Hpc7g and Hpc7a offer compute-intensive high-performance computing, and Hpc6id offers memory-intensive high-performance computing along with an SSD, which increases the performance of applications that require low latency and high throughput.

Amazon EC2 instance type pricing#

Pricing can be a huge factor in determining which instance to use. The factors that decide the pricing of an Amazon EC2 instance include the pricing model, geographic region, and EC2 instance type.

  • Pricing models: Amazon offers various pricing models:

    • On-Demand: Pay per second or hour without long-term commitments. This is the most flexible but often the most expensive option.

    • Reserved Instances: Commit to a 1- or 3-year term for up to a 75% discount compared to On-Demand prices. Reserved Instances provide savings for steady-state workloads.

    • Spot Instances: Purchase unused capacity at up to 90% off On-Demand prices. Pricing fluctuates based on supply and demand, and instances may be terminated when AWS needs the capacity.

    • Savings plans: A flexible alternative to Reserved Instances, allowing you to commit to consistent hourly usage across instance families for 1 or 3 years, with savings similar to RIs.

  • Location: EC2 prices vary by AWS region due to local infrastructure and operational costs.

Amazon EC2 also provides an AWS Free Tier. For 12 months, new users get 750 hours per month of t2.micro or t3.micro (depending on region).

The type of an EC2 instance indicates its price range. Pricing varies across instance series, hardware options, and sizes.

  • Generally, compute-optimized instances are the most affordable, while general-purpose and memory-optimized instances cost more due to higher resource allocations. Specialized instances like GPU-based or storage-optimized are more expensive because they have SSDs. However, the instances used for accelerated computing are generally the most expensive because they come with larger sizes and advanced hardware for high computational performance. Here is a brief comparison of family instances with the same processors and sizes.

Instance Type

Instance Name

vCPUs

Memory (GiB)

Price/hr (On-demand)

Compute-optimized

c8g.large

2

4

$0.07948

General purpose

m8g.large

2

8

$0.08976

Memory-optimized

r8g.large

2

16

$0.11782

Storage optimized

i4g.large

2

16

$0.15444

  • The options part in the instance name signifies the processor used in the instance but it also sometimes signifies whether the instance will have an SSD or optimized networking. The instance that offer SSDs or high network performance elements costs more than the regular instances.

Instance Type

Instance Name

Memory (GiB)

Storage

Network Performance

Price/hr (On-demand)

Memory-optimized

r6i.large

16 GiB

EBS Only

Up to 12500 Megabits

$0.126

r6id.large

16 GiB

1 x 118 NVMe SSD

Up to 12500 Megabits

$0.1512

General purpose

m6i.large

8 GiB

EBS Only

Up to 12500 Megabits

$0.096

m6idn.large

8 GiB

1 x 118 NVMe SSD

Up to 25000 Megabits

$0.15912

The instance with d option in its name (r6id.large) has an SSD in the storage, and the instance with dn in its name (m6idn.large) has both the SSD and up to 25000 MB of network bandwidth that is 12500 MB more than the m6i.large instance and hence both of these instances are more expensive than there counterparts.

  • Lastly, the size of the instance also shows how expensive an instance can be; the more the size of the instance, the more expensive it is. Let’s analyze an example of p series instances that show this trend:

Instance Name

vCPUs

Memory (GiB)

Price/hr (On-demand)

p2.xlarge

4

61 GiB

$0.90

p2.8xlarge

32

488 GiB

$7.20

p2.16xlarge

64

732 GiB

$14.40

In summary, EC2 pricing is highly flexible but varies significantly based on the combination of instance type, pricing model, and usage patterns, allowing users to optimize costs based on their specific workload needs.

Conclusion#

In conclusion, Amazon EC2 offers a variety of instance types tailored to meet diverse computing needs, organized into families based on their primary performance characteristics:

  • General purpose instances: Designed for a balanced computing, memory, and networking mix. Good for a wide range of applications, offering moderate performance at a reasonable price. Examples include the T, M instance series.

  • Memory-optimized instances: These are suited for memory-intensive applications like big data processing and in-memory databases. The R and X instance series offer high memory capacities per vCPU.

  • Compute-optimized instances: This category is ideal for applications requiring high computing power, such as high-performance computing or gaming. The C instance series falls into this category and offers a higher CPU-to-memory ratio.

  • Accelerated computing instances: These instances feature GPUs or custom hardware accelerators for graphics processing and machine learning workloads. They include P and G series instances focusing on GPU acceleration and F instances for machine learning inference.

  • High-performance computing) instances: These instances provide the performance and network speeds necessary for demanding scientific and engineering simulations. They are built with high throughput and low latency, enabling large-scale simulations and workloads like weather modeling, seismic processing, and genomics.

  • Storage-optimized instances: This category specializes in workloads needing fast, low-latency storage with local instance storage. The I and D series are part of this type, designed for tasks like data warehousing and large transactional databases.

Each instance family comes in various sizes, allowing customization based on specific application needs. Understanding each family’s strengths is essential for selecting the right instance type. The right EC2 instance can make or break your cloud strategy—balancing cost-efficiency with performance is key.

Test your knowledge of EC2 instance types

1

Which two instance series belong to the memory-optimized EC2 instances?

A)

M and I series

B)

R & X series

C)

C & T series

D)

I & P series

Question 1 of 30 attempted

Getting started with Amazon EC2#

That concludes our guide to Amazon EC2 instance types! We hope you found this information helpful.

To get your hands dirty with Amazon EC2 skills, Educative offers Cloud Labs, where you can work directly with AWS cloud services without the setup, cleanup, or the need for an AWS account.

We have various Cloud Labs where you can learn to use the EC2 instances:

You may also want to check out these courses covering Amazon EC2 and beyond:

Frequently Asked Questions

What are the pricing options for EC2 instances?

EC2 instances are available under various pricing models, including on-demand, reserved instances, spot instances, and savings plans. Each model offers different benefits in terms of cost and flexibility.

  • With no long-term commitments, on-demand instances allow you to pay for compute capacity by the hour or second.
  • Reserved instances significantly discount instance usage in exchange for a one- or three-year commitment.
  • Spot instances allow you to bid on unused EC2 capacity at reduced prices. They are cost-effective for flexible workloads but can be interrupted by AWS with little notice.

How can I monitor the performance of my EC2 instances?

Are there any new instance types or features being introduced?

Are there free tier EC2 instance types available?

Can I change the type of an EC2 instance once it is running?

What is the most commonly used EC2 instance type?


Written By:
Usama Ashraf
Join 2.5 million developers at
Explore the catalog

Free Resources