AMD EPYC Performance Testing… or Don’t get on the wrong side of SystemDVadim Tkachenko
Ever since AMD released their EPYC CPU for servers I wanted to test it, but I did not have the opportunity until recently, when Packet.net started offering bare metal servers for a reasonable price. So I started a couple of instances to test Percona Server for MySQL under this CPU. In this benchmark, I discovered some interesting discrepancies in performance between AMD and Intel CPUs when running under systemd .
The set up
To test CPU performance, I used a read-only in-memory sysbench OLTP benchmark, as it burns CPU cycles and no IO is performed by Percona Server.
For this benchmark I used Packet.net c2.medium.x86 instances powered by AMD EPYC 7401P processors. The OS is exposed to 48 CPU threads.
For the OS I tried
- Ubuntu 16.04 with default kernel 4.4 and upgraded to 4.15
- Ubuntu 18.04 with kernel 4.15
- Percona Server started from SystemD and without SystemD (for reasons which will become apparent later)
To have some points for comparison, I also ran a similar workload on my 2 socket Intel CPU server, with CPU: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz. I recognize this is not most recent Intel CPU, but this was the best I had at the time, and it also gave 48 CPU Threads.
Or in tabular format:
|Threads||Ubuntu 16, kernel 4.4; systemd||Ubuntu 16, kernel 4.4;
Ubuntu 16, kernel 4.15
There are few conclusions we can see from this data
- AMD EPYC CPU scales quite well to the number of CPU Threads
- The recent kernel helps to boost the throughput.
Now, let’s review the results for Ubuntu 18.04
|Threads||Ubuntu 18, systemd||
Ubuntu 18, NO systemd
This is where the result surprised me: on Ubuntu 18.04 with SystemD running Percona Server for MySQL as a service the throughput was up to 24% better than if Percona Server for MySQL is started from a bash shell. I do not know exactly what causes this dramatic difference—systemd uses different slices for services and user commands, and somehow it affects the performance.
To establish a baseline, I ran the same benchmark on my Intel box, running Ubuntu 16, and I tried two kernels: 4.13 and 4.15
|Threads||Ubuntu 16, kernel 4.13, systemd||Ubuntu 16, kernel 4.15, systemd||
Ubuntu 16, kernel 4.15, NO systemd
Here we see the opposite result with SystemD: Percona Server running from a bash shell shows the better throughput compared with the SystemD service. So for some reason, systemd works differently for AMD and Intel CPUs. Please let me know if you have any ideas on how to deal with the impact that systemd has on performance.
So there are some conclusions from these results:
- AMD EPYC shows a decent performance scalability; the new kernel helps to improve it
- systemd shows different effects on throughput for AMD and Intel CPUs
- With AMD the throughput declines for a high concurrent workload with 512 threads, while Intel does not show a decline.