Recently we were asked to check the performance of the new family of AMD EPYC processors when using MySQL in Google Cloud Virtual Machines. This was motivated by a user running MySQL in the N1 machines family and willing to upgrade to N2D generation considering the potential cost savings using the new AMD family.
The idea behind the analysis is to do a side-by-side comparison of performance considering some factors:
The goal of this analysis is to check if cost reductions by upgrading from N1 to N2D are worth the change to avoid suffering from performance problems and eventually reduce the machine size from the current 64 cores based (N1 n1-highmem-64 – Intel Haswell) to either N2D 64 cores (n2d-highmem-64 – AMD Rome) or even to 48 cores (n2d-highmem-48 – AMD Rome), to provide some extra context we included N2 (the new generation of Intel machines) into the analysis.
In order to do a purely CPU performance comparison we created 4 different VMs:
NAME: n1-64
MACHINE_TYPE: n1-highmem-64
Intel Haswell – Xeon 2.30GHz
*This VM corresponds to the same type as the type we use in Production.
NAME: n2-64
MACHINE_TYPE: n2-highmem-64
Intel Cascade Lake – Xeon 2.80GHz
NAME: n2d-48
MACHINE_TYPE: n2d-highmem-48
AMD Epyc Rome – 2.25Ghz
NAME: n2d-64
MACHINE_TYPE: n2d-highmem-64
AMD Epyc Rome – 2.25Ghz
For the analysis, we used MySQL Community Server 5.7.35-log and this is the basic configuration:
|
1 |
[mysqld]<br>datadir = /var/lib/mysql<br>socket = /var/lib/mysql/mysql.sock<br>log-error = /var/lib/mysql/mysqld.err<br>pid-file = /var/run/mysqld/mysqld.pid<br>server_id = 100<br>log_bin<br>binlog_format = ROW<br>sync_binlog = 1000<br>expire_logs_days = 2<br>skip_name_resolve<br><br>innodb_buffer_pool_size = 350G<br>innodb_buffer_pool_instances = 32<br>innodb_concurrency_tickets = 5000<br>innodb_thread_concurrency = 128<br>innodb_write_io_threads = 16<br>innodb_read_io_threads = 16<br>innodb_flush_log_at_trx_commit = 1<br>innodb_flush_method = O_DIRECT<br>innodb_log_file_size = 8G<br>innodb_file_per_table = 1<br>innodb_autoinc_lock_mode = 2<br>innodb_buffer_pool_dump_at_shutdown = 1<br>innodb_buffer_pool_load_at_startup = 1<br><br>table_open_cache = 5000<br>thread_cache_size = 2000<br>query_cache_size = 0<br>query_cache_type = 0 |
In all cases, we placed a 1TB balanced persistent drive so we get enough IO performance for the tests. We wanted to normalize all the specs so we can focus on the CPU performance, so don’t pay too much attention to the chances for improving performance for IO operations and so.
The analysis is based on sysbench oltp read-only workload with an in-memory dataset, the reason for this is that we want to generate traffic that can saturate CPU while not being affected by IO or Memory.
The approach for the benchmark was also simple, we executed RO OLTP work for 16, 32, 64, 128, and 256 threads with a one-minute wait between runs. Scripts and results from tests can be found here.
Let’s jump into the analysis, these are the number of Queries that instances are capable to run:

The maximum amount of TPS by Instance Type by the number of threads:
| Threads/Instance | N1-64 | N2-64 | N2D-48 | N2D-64 |
|
16 |
164k | 230k | 144k |
155k |
|
32 |
265k | 347k | 252k | 268k |
|
64 |
415k | 598k | 345k |
439k |
|
128 |
398k | 591k | 335k |
444k |
| 256 | 381k | 554k | 328k |
433k |
Some observations:
Let’s have a look at the CPU utilization on each node:




Additional observations:
For the sake of analysis this is the estimated costs of each of used machines (at the moment of writing the post):
n1-highmem-64 $2,035.49/month = $0.000785297/second
n2-highmem-64 $2,549.39/month = $0.000983561/second
n2d-highmem-48 $1,698.54/month = $0.000655301/second
n2d-highmem-64 $2,231.06/month = $0.000860748/second
Costs above will give us roughly at peaks of TPS:
n1-highmem-64 costs are $0.0000000019/trx
n2-highmem-64 costs are $0.0000000016/trx
n2d-highmem-48 costs are $0.0000000019/trx
n2d-highmem-64 costs are $0.0000000019/trx
While this is not a super exhaustive analysis of all implications of CPU performance for MySQL workload we get a very good understanding of cost vs performance analysis.