AWS EC2 M5 vs. M5a benchmarks

!!! Every benchmark we do leverages the Scalebench platform, which installs and runs well known benchmark suites and tools in an automated fashion, and processes the results into graphs and reports (as seen below) for analysis.

Get started with your own benchmarks here

AWS provides numerous types of cloud VMs, the M series is a general purpose flavour with several options.  Two of interest are the base M5 and the M5a, which pits Intel against AMD, with interesting results. more details can be found by viewing the report.

Specs are the following,

    • 16 cores / 3140.90 mhz / Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz
    • L1d: 32 L1i: 32 L2: 1024 L3: 33792
    • RAM: 61.47 GB / swap: 0.00 GB / hugepages: 0.00 GB / hp size: 2.00 MB
    • nvme0n1p1, 1023.00 GB, xfs
    • Amazon Linux 2
    • 16 cores / 2468.86 mhz / AMD EPYC 7571
    • L1d: 32 L1i: 64 L2: 512 L3: 8192
    • RAM: 61.80 GB / swap: 0.00 GB / hugepages: 0.00 GB / hp size: 2.00 MB
    • nvme0n1p1, 1023.00 GB, xfs
    • Amazon Linux 2

Testing Parameters

using the Scalebench platform to leverage Sysbench benchmarking tool,

    • Sysbench benchmark suite
    • 3 X 60 second runs
    • cpu – max prime (N=2000)
    • memory – seqrd, seqwr, rndrd, rndwr (default settings)
    • disk – seqrd, seqwr, rndrd, rndwr (default settings)



the sysbench cpu test calculates a set of prime numbers and counts the total iterations as events.

cpu max prime benchmark

from the results, we can see that the m5a performs about 15% faster for 1-8 simultaneous threads, and then reverses this trend and performs about 15% slower for 16-64 threads.


The memory tests consist of 4 separate tests which read/write in sequential/random fashion.

memory random reads benchmark memory random writes benchmarkmemory sequential reads benchmarksequential writes benchmark

Looking at the results we see m5a is very strong for sequential reads, especially for < 8 threads.  Yet both the random read/write benchmarks give the advantage to the m5. To explain these differences, both the thread management of the cpus and the cpu caches (the intel chip has a generous L2/L3 cache) would be possible avenues to explore.


We again do 4 separate tests read/write in sequential/random fashion, the big difference of course is the speed, location and durability of the data.


disk random reads benchmark disk random writes benchmarkdisk sequential reads benchmarkdisk sequential writes benchmark

Clearly the disk benchmarks are being throttled and hit a ceiling for 2+  threads for all operations aside from sequential reads, and there is basically no difference between the two VM types. This is not surprising as the default AWS storage is EBS, which is non-local to the VM and accessed via a network link. The limits for each VM type can be found here and here.

AWS has both I/O and throughput limits for EBS and Sequential reads likely bundle the I/O and so allows the tests to scale until hitting the throughput limit.


  1. for workloads that are predictable and are not expected to consistently implement load > cpu threads the m5a gives a performance advantage. These include more OLTP like workloads. For heavier and more OLAP like workloads (i.e. reporting), the M5 is the better option.
  2. Workloads that are mainly sequential read based, (many web based data applications tend to be architected as time-series based and majority reads), could benefit from the M5a. Other applications that are heavy on writing data, and/or either reading or writing data randomly at any spot in the database would be better off with the M5.
  3. If your application is heavy on disk usage, either datastore with a working dataset much larger than memory, or heavy writing generally, both VM types are throttled by the network storage that is block storage. This is setup for most of the larger cloud providers, sacrificing disk performance for separating storage from the processing to allow easy resizing and storage of data without the VM. For top disk performance, you may want to consider local storage instead.

In a future post, we’ll compare EBS storage (both general and provisioned iops) to local storage (disks attached to the VM like in the old days), and show the difference.


Scalebench Blog Kickoff

Welcome to the Scalebench blog! Here, we’ll be publishing our own benchmarks and helpful advice to compliment the Scalebench platform. Any technical questions, please use our form on the main site to get in touch.