Amazon EC2 Instances: M5 vs M5d vs M5a vs M5ad

Amazon Elastic Compute Cloud (EC2) is a service that offers compute capacity in 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 compute, memory and networking resources. M5 can be used as servers, caching fleets, app development environments, and instance fleet to run Big Data Workloads.

As of this writing (June, 2019), Amazon offers 26 different instance options within 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

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-familyProcessorInstance Storage
M5Intel Xeon Platinum 8000
(Skylake-SP)
EBS-Only
M5dIntel Xeon Platinum 8000
(Skylake-SP)
NVMe SSD
M5aAMD EPYC 7000EBS-Only
M5adAMD EPYC 7000NVMe 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 (eg: M5a.xlarge) refers to AMD. M5a instances offer 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 mean that the disk is a remote network SAN or NAS. EBS volumes can persist data through instance stops, and terminations and van 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 (eg: M5d.xlarge, M5ad.xlarge) refer 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 with 6 different sizes based with varying combination of virtual CPUs and Memory. Multiple the six instance sizes with 4 sub-family (m5, m5d, m5a and m5ad), we get 24 instance types.

Instance SizevCPUMemory (GiB)
large28
xlarge416
2xlarge832
4xlarge1664
12xlarge48192
24xlarge96384

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 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) provide 2 vCPU and 8 GiB of memory and up to 10 Gbps of network bandwidth. The below table has the comparison of the 4 smallest instance types in m5 family.

Modelm5.largem5d.largem5a.largem5ad.large
ProcessorXeon Platinum 8000
(Skylake-SP)
Xeon Platinum 8000
(Skylake-SP)
AMD EPYC 7000AMD EPYC 7000
vCPU2222
Memory (GiB)8888
Instance Storage (GiB)EBS-Only1 x 75 NVMe SSDEBS-Only1 x 75 NVMe SSD
Network Bandwidth (Gbps)Up to 10Up to 10Up to 10Up to 10
EBS Bandwidth (Mbps)Up to 3,500Up to 3,500Up to 2,120Up 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
20202020
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) provide 96 vCPU and 384 GiB of memory and 25 Gbps of network bandwidth. The below table has the comparison of the 4 largest instance types in m5 family.

Modelm5.24xlargem5d.24xlargem5a.24xlargem5ad.24xlarge
ProcessorXeon Platinum 8000
(Skylake-SP)
Xeon Platinum 8000
(Skylake-SP)
AMD EPYC 7000AMD EPYC 7000
vCPU96969696
Memory (GiB)384384384384
Instance Storage (GiB)EBS-Only4 x 900 NVMe SSDEBS-Only4 x 900 NVMe SSD
Network Bandwidth (Gbps)25252020
EBS Bandwidth (Mbps)14,00014,00010,00010,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
20202020
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 short list the type. The 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 compute, 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 and all 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 compute, 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 instance have EBS only volumes while M5d and M5ad instances have Instance store. M5 family consists of instances with different sizes based on the combination of vCPU, memory and network resources.

7 Comments

  • You have an error in this sentence:
    “M5 and M5a instances have Instance Store while the M5d and M5ad have EBS instances.”

    Reply
    • That’s right, it’s supposed to be the other way. I have updated the post. Thank you!

      Reply
  • Hourly pricing for m5.large is shown as $0.192 per hour above. It should actually be $0.096

    Reply
  • 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

    Reply
  • 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)?

    Reply
    • Hi Kwrl. That’s right, it’s supposed to be M5a < M5ad < M5 < M5d. I have fixed the typo. Thank you!

      Reply

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top