Modern MariaDB is significantly faster than modern MySQL on a medium server with cached sysbench because MySQL suffers from too many CPU performance regressions (code bloat, etc) over time.
This post has results for sysbench with a cached database and medium server (16 cores) using MariaDB and MySQL. The benchmark is run with 12 threads. A full writeup for MySQL on this HW is here and for MariaDB on a smaller server is here.
Note that the great results for MariaDB only occur when MDEV-33894 has been fixed in versions 10.11 or greater -- it isn't a bug prior to 10.11. I reported that bug a few months ago and then worked with the MariaDB core team to explain the problem and validate the fix.
The gap between MariaDB and MySQL is likely to grow. While MySQL 8.0.40 might have fixes that undo some of the regressions that arrived in InnoDB after 8.0.28 (see PS-8822 and MySQL 111538), I expect to see improvements in MariaDB as well. I opened three perf bugs for MariaDB earlier this year. The great results here are due in part to fixing MDEV-33894 and there will be even better results in the future when the two other bugs are fixed: MDEV-34178 and MDEV-33966.
tl;dr
- The fix for MDEV-33894 is important
- MariaDB has done great at avoiding CPU performance regressions over time, MySQL has not
- Modern MariaDB is faster than modern MySQL
- MariaDB was faster on 41 microbenchmarks and slower on one (update-inlist)
- A typical result is MariaDB is ~11% faster than MySQL
- ma100244_rel_withdbg
- MariaDB 10.2.44
- ma100339_rel_withdbg
- MariaDB 10.3.29
- ma100434_rel_withdbg
- MariaDB 10.4.34
- ma100525_rel_withdbg
- MariDB 10.5.25
- ma100618_rel_withdbg
- MariaDB 10.6.18
- ma101108_rel_withdbg
- MariaDB 10.11.8
- ma1011_240723_c944cd6e_ilwas
- MariaDB 10.11 compiled on 24/07/23 at git hash c944cd6f with innodb_log_writeahead_size =4096. Note the git hash in ma1011_240723_c944cd6e_ilwas is a typo (should end in 6f)
- ma110402_rel_withdbg
- MariaDB 11.4.2
- ma1104_240723_2ee061c2_ilwas
- MariaDB 11.4 compiled on 24/07/23 at git hash 2ee061c2 with innodb_log_writeahead_size =4096
- ma110501_rel_withdbg
- MariaDB 11.5.1
- ma1105_240723_2f4b0ba3_ilwas
- MariaDB 11.5 compiled on 24/07/23 at git hash 2f4b0ba3 with innodb_log_writeahead_size =4096
- ma110600_rel_withdbg
- MariaDB 11.6.0
- ma1106_240723_d8374262_ilwas
- MariaDB 11.6 compiled on 24/07/23 at git hash d8374262 with innodb_log_writeahead_size =4096
# 8 tables, 10M rows/table, 12 threads
bash r.sh 8 10000000 300 600 md0 1 1 12
Results
The numbers in the spreadsheets and the tables below are the relative QPS which is (QPS for my version) / (QPS for base case). When the relative throughput is > 1 then that version is faster than the base case.
But the results also show new problems for MariaDB and MDEV-34178 and MDEV-33966 are open for these problems. The usual signal is an increase in the context switch rate (cs/o). Examples of that occur on:
- Relative QPS is: (QPS for MariaDB) / (QPS for MySQL)
- MariaDB is ma1104_240723_2ee061c2_ilwas (11.4 with MDEV-33894 fix)
- MySQL is 8.0.38
- MariaDB is faster than MySQL on all microbenchmarks except for update-inlist
- Relative QPS is: (QPS for modern MariaDB) / (QPS for older MariaDB)
- modern MariaDB is 11.4 without and with the MDEV-33894 fix -- ma110402_rel_withdbg and ma1104_240723_2ee061c2_ilwas
- older MariaDB is 10.2.44 -- ma100244_rel_withdbg
- Writes are faster in 11.4 than in 10.2 with the MDEV-33894 fix
- Reads are between 13% slower and 23% faster in 11.4 than in 10.2
- MariaDB has done great at avoiding regressions over time
- MariaDB has done much better than MySQL at avoiding CPU perf regressions over time
- For the scan microbenchmark modern MariaDB is faster than older MariaDB
- For write microbenchmarks the MDEV-33894 fix is important as QPS is almost 2X larger with it