M6g ARM Graviton 2 MariaDB performance

Graviton2 processors are custom built by Amazon Web Services using 64-bit Arm Neoverse cores and deliver several performance optimizations over first-generation AWS Graviton processors. This includes 7x the performance, 4x the number of computing cores, 2x larger private caches per core, 5x faster memory, and 2x faster floating-point performance per core. Additionally, the AWS Graviton2 processors feature always-on fully encrypted DDR4 memory and 50% faster per core encryption performance. These performance improvements make the Graviton2 M6g and R6g database instances a great choice for database workloads.

Installing MariaDB as well as sysbench in order to load test it.

Sysbench is a popular open-source benchmark to test DBMSs.

A read/write performance test is performed. Let's go!

sudo apt-get install -y sysbench mariadb-serversudo mysql -u root -e ‘create database sbtest’sudo sysbench /usr/share/sysbench/oltp_read_write.lua  — db-driver=mysql  — threads=4  — mysql-host=localhost  — mysql-user=root  — mysql-port=3306  — tables=5  — table-size=10000000 preparesudo sysbench /usr/share/sysbench/oltp_read_write.lua  — db-driver=mysql  — threads=16  — events=0  — time=300  — mysql-host=localhost  — mysql-user=root  — tables=5  — delete_inserts=10  — index_updates=10  — non_index_updates=10  — table-size=10000000  — db-ps-mode=disable  — report-interval=1 run

The results:

SQL statistics:

  • queries performed:
  • read: 436520
  • write: 1247200
  • other: 62360
  • total: 1746080
  • transactions: 31180. (103.91 per sec.)
  • queries: 1746080 (5819.10 per sec.)
  • ignored errors: 0. (0.00 per sec.)
  • reconnects: 0. (0.00 per sec.)

General statistics:

  • total time: 300.0588s
  • total number of events: 31180

Latency (ms):

  • min: 6.92
  • avg: 153.96
  • max: 975.64
  • 95th percentile: 314.45
  • sum: 4800464.88

Threads fairness:

  • events (avg/stddev): 1948.7500/19.35
  • execution time (avg/stddev): 300.0291/0.02

M6G.xlarge Maria DB Performance:

  • queries performed:
  • read: 451836
  • write: 1290960
  • other: 64548
  • total: 1807344
  • transactions: 32274. (107.56 per sec.)
  • queries: 1807344 (6023.09 per sec.)
  • ignored errors: 0. (0.00 per sec.)
  • reconnects: 0. (0.00 per sec.)

General statistics:

  • total time: 300.0680s
  • total number of events: 32274

Latency (ms):

  • min: 5.66
  • avg: 148.74
  • max: 833.04
  • 95th percentile: 303.33
  • sum: 4800535.10

Threads fairness:

  • events (avg/stddev): 2017.1250/22.81
  • execution time (avg/stddev): 300.0334/0.02

Pivot performance metrics table:

m5.xlarge

Transactions 103.91 / second

Queries 5819.10 / second

m6g.xlarge

Transactions 107.56 / second

Queries 6023.09 / second

Image for post
Image for post

Here, the Arm-powered m6g Graviton2 instance was not just not slower then Intel RISC x86 architecture however even 3.45% faster for both Transactions and Queries and 21.7% cheaper.

The main difference that M5.large instance has 4 vCPU that is equal to 2 physical CPUs with 2 threads per CPU. Basically multi-threading is good not for all workload. When one tread uses shared core second thread just waiting. Also, Context switches have some overhead. Graviton 2 ARM instance has 4 Physical cores that are better than 2 Physical Intel CPUs with 2 threads per processor = 4 vCPUs.

Image for post
Image for post

Written by

Magento/APP Cloud Architect. Melting metal server infrastructure into cloud solutions.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store