Amazon EC2 Instances: M5 vs M5d vs M5a vs M5ad

Amazon Elastic Compute Cloud (EC2) is a service that offers compute capacity in the Amazon Web Services (AWS) cloud. Amazon EC2 M5 Instances are the fifth-generation EC2 instances that are ideal for general-purpose computing as they offer a balance of computing, memory, and networking resources. M5 can be used as servers, caching fleets, app development environments, and instance fleets to run Big Data Workloads.
As of this writing, Amazon offers 26 different instance options within the M5 family with different processors, storage options, and instance sizes. This blog post explains the different options and provides a pointer to choose the right one.
Sub-families: M5, M5d, M5a, M5ad
The M5 Instance family has 4 sub-families (M5, M5d, M5a, and M5ad) based on the combination of the processor and instance storage they use.
Sub-family | Processor | Instance Storage |
M5 | Intel Xeon Platinum 8000 (Skylake-SP) | EBS-Only |
M5d | Intel Xeon Platinum 8000 (Skylake-SP) | NVMe SSD |
M5a | AMD EPYC 7000 | EBS-Only |
M5ad | AMD EPYC 7000 | NVMe SSD |
Processors
The M5 instance family comes with 2 different processor types – Intel Xeon Platinum 8000 series and AMD EPYC 7000 series. M5 instances have Intel while M5a instances have the AMD processor. As you may have guessed by now, ‘a’ in the instance name (e.g.: M5a.xlarge) refers to AMD. M5a instances offer the same performance but are about 10% cheaper than their M5 counterparts.
Instance Storage
Instance storage refers to the disk that is attached to the EC2 instance. The M5 instance family offers two different instance storage options – Instance Store and EBS. Instance Store storage means that the disk is physically attached to the virtualization host. The data stored in Instance store volumes are not persistent through instance stops, terminations, or hardware failures. On the other hand, EBS storage means that the disk is a remote network SAN or NAS. EBS volumes can persist data through instance stops, and terminations and can be removed from one instance and reattached to another instance.
M5 and M5a instances have EBS storage while the M5d and M5ad have Instance Store storage. ‘d’ in the instance name (e.g.: M5d.xlarge, M5ad.xlarge) refers to Instance Store storage. Since the storage disk is physically attached to the host, M5d and M5ad offer low latency. M5 and M5a have high latency and they have to compete for I/O with thousands of other instances in the network. M5 and M5a are cheaper than their Instance Store (‘d’) counterparts.
Metal
Amazon offers two types of Bare Metal Instances with the Intel variants (M5.metal and M5d.metal). With the Bare Metal Instances, the operating system runs on the underlying hardware and has direct access to the processor, memory, and other hardware.
Instance Sizes
The M5 family comes in 6 different sizes based on varying combinations of virtual CPUs and Memory. Multiple the six instance sizes with 4 sub-families (m5, m5d, m5a, and m5ad), we get 24 instance types.
Instance Size | vCPU | Memory (GiB) |
large | 2 | 8 |
xlarge | 4 | 16 |
2xlarge | 8 | 32 |
4xlarge | 16 | 64 |
12xlarge | 48 | 192 |
24xlarge | 96 | 384 |
Pricing
The Intel variants (M5 and M5d) are more expensive than their AMD counterparts (M5a and M5ad). Similarly, The Instance Store variants (M5d and M5ad) are more expensive than their EBS counterparts (M5 and M5a). M5d is the most expensive among the four as it comes with an Intel processor and Instance Store storage. M5a is the least expensive among the four.
M5a < M5ad < M5 < M5d
Like with any other instance families, the price increases as the size increases. large is the smallest and least expensive option while 24xlarge is the largest and most expensive option.
large < xlarge < 2xlarge < 4xlarge < 12xlarge < 24xlarge
Comparison – Smallest Instance Types
The smallest of the M5 instances (m5*.large) provides 2 vCPU 8 GiB of memory and up to 10 Gbps of network bandwidth. The below table has a comparison of the 4 smallest instance types in the m5 family.
Model | m5.large | m5d.large | m5a.large | m5ad.large |
Processor | Xeon Platinum 8000 (Skylake-SP) | Xeon Platinum 8000 (Skylake-SP) | AMD EPYC 7000 | AMD EPYC 7000 |
vCPU | 2 | 2 | 2 | 2 |
Memory (GiB) | 8 | 8 | 8 | 8 |
Instance Storage (GiB) | EBS-Only | 1 x 75 NVMe SSD | EBS-Only | 1 x 75 NVMe SSD |
Network Bandwidth (Gbps) | Up to 10 | Up to 10 | Up to 10 | Up to 10 |
EBS Bandwidth (Mbps) | Up to 3,500 | Up to 3,500 | Up to 2,120 | Up to 2,120 |
On-Demand Price Region: N. Virginia | $0.192 per Hour | $0.113 per Hour | $0.086 per Hour | $0.103 per Hour |
Initial On-Demand Limit Region: N. Virginia | 20 | 20 | 20 | 20 |
Spot – Frequency of Interruption Region: N. Virginia | <5% | 5-10% | 5-10% | 10-15% |
Spot – Savings over On-Demand Region: N. Virginia | 79% | 82% | 77% | 81% |
Comparison – Largest Instance Types
The largest of the M5 instances (m5*.24xlarge) provides 96 vCPU 384 GiB of memory and 25 Gbps of network bandwidth. The below table has a comparison of the 4 largest instance types in the m5 family.
Model | m5.24xlarge | m5d.24xlarge | m5a.24xlarge | m5ad.24xlarge |
Processor | Xeon Platinum 8000 (Skylake-SP) | Xeon Platinum 8000 (Skylake-SP) | AMD EPYC 7000 | AMD EPYC 7000 |
vCPU | 96 | 96 | 96 | 96 |
Memory (GiB) | 384 | 384 | 384 | 384 |
Instance Storage (GiB) | EBS-Only | 4 x 900 NVMe SSD | EBS-Only | 4 x 900 NVMe SSD |
Network Bandwidth (Gbps) | 25 | 25 | 20 | 20 |
EBS Bandwidth (Mbps) | 14,000 | 14,000 | 10,000 | 10,000 |
On-Demand Price Region: N. Virginia | $4.608 per Hour | $5.424 per Hour | $4.128 per Hour | $4.944 per Hour |
Initial On-Demand Limit Region: N. Virginia | 20 | 20 | 20 | 20 |
Spot – Frequency of Interruption Region: N. Virginia | >20% | >20% | <5% | <5% |
Spot – Savings over On-Demand Region: N. Virginia | 79% | 82% | 0% | 28% |
Choosing the right one
As with choosing any instance type in general, you need to run benchmarks with your workload to analyze the performance and shortlist the type. Below are guidelines to choose between the several choices among M5 instances.
Why M5?
You can try out M5 if you need a balance of computing, memory, and networking resources, and if your workload involves general-purpose computing such as running servers and instance fleets.
Intel (M5/M5d) or AMD (M5a/M5ad)
Both these variants offer similar performance for general computing workloads. Choose the AMD variants if your main concern is cost. If your workload is designed to utilize the maximum processing speed, Intel may be a better option as the Intel Xeon Platinum 8000 series offers a sustained all-core Turbo CPU clock speed of up to 3.1 GHz compared to a core turbo clock speed of 2.5 GHz from AMD EPYC 7000 series processors.
Instance Store (M5d/M5ad) or EBS (M5/M5a)
Choose Instance Store if your workload needs temporary storage with low latency. Use EBS volumes if you need to retain the data longer and preserve the data through instance stops and terminations. The EBS-backed instance types (M5/M5a) are also cheaper than Instance Store variance (M5d/M5ad).
Instance size (large, xlarge, 2xlarge, …, 24xlarge)
You need to choose the instance size based on your workload. Take into consideration that the vCPU, memory, and network resources of the instance size should satisfy the requirements of your applications. You can run performance benchmarks with different sizes to choose the best option.
TL;DR
Amazon EC2 M5 Instances offer a balance of computing, memory, and networking resources and are ideal for general-purpose computing. M5 and M5d instances have Intel Xeon Platinum 8000 series processors while M5a and M5ad instances have AMD EPYC 7000 series. M5 and M5a instances have EBS-only volumes while M5d and M5ad instances have Instance store. The M5 family consists of instances with different sizes based on the combination of vCPU, memory, and network resources.
16 Comments
You have an error in this sentence:
“M5 and M5a instances have Instance Store while the M5d and M5ad have EBS instances.”
That’s right, it’s supposed to be the other way. I have updated the post. Thank you!
You have an error in this sentence:
“M5 and M5a instances have Instance Store while the M5d and M5ad have EBS instances.”
That’s right, it’s supposed to be the other way. I have updated the post. Thank you!
Hourly pricing for m5.large is shown as $0.192 per hour above. It should actually be $0.096
Hourly pricing for m5.large is shown as $0.192 per hour above. It should actually be $0.096
Good article. I think the following line need to be changed from
large > xlarge > 2xlarge > 4xlarge > 12xlarge > 24xlarge
to
large < xlarge < 2xlarge < 4xlarge < 12xlarge < 24xlarge
That’s right, I have fixed it now. Thank you.
Good article. I think the following line need to be changed from
large > xlarge > 2xlarge > 4xlarge > 12xlarge > 24xlarge
to
large < xlarge < 2xlarge < 4xlarge < 12xlarge < 24xlarge
That’s right, I have fixed it now. Thank you.
Good Article!
I was a bit irritated about `M5d < M5ad < M5 < M5a`. Shouldn't it be `M5a < M5 < M5ad < M5d` (from cheap to expensive; same sorting as by size)?
Hi Kwrl. That’s right, it’s supposed to be M5a < M5ad < M5 < M5d. I have fixed the typo. Thank you!
Good Article!
I was a bit irritated about `M5d < M5ad < M5 < M5a`. Shouldn't it be `M5a < M5 < M5ad < M5d` (from cheap to expensive; same sorting as by size)?
Hi Kwrl. That’s right, it’s supposed to be M5a < M5ad < M5 < M5d. I have fixed the typo. Thank you!
Great post!
One more typo I found – you put the price for m5.xlarge instead of m5.large.
Great post!
One more typo I found – you put the price for m5.xlarge instead of m5.large.