As part of my benchmarks of binary logs, I’ve decided to check how the recently released MySQL 8.0 performance is affected in similar scenarios, especially as binary logs are enabled by default. It is also interesting to check how MySQL 8.0 performs against the claimed performance improvements in redo logs subsystem.
I will use a similar setup as in my last blog with MySQL 8.0, using the utf8mb4 charset.
I have a few words about MySQL 8.0 tuning. Dimitri’s recommends in his blog posts using innodb_undo_log_truncate=off and innodb_doublewrite=0. However, in my opinion, using these setting are the same as participating in a car race without working breaks: you will drive very fast, but it will end badly. So, contrary to Dimitri’s recommendations I used innodb_undo_log_truncate=on and innodb_doublewrite=1.
For the first run, let’s check the results without binary logs vs. with binary logs enabled, but with sync_binlog=1 for Percona Server for MySQL 5.7 vs. MySQL 8.0.
In tabular form:
| Binary log | Buffer pool, GB | MYSQL8 | PS57 | Ratio PS57/MySQL8 |
| binlog | 5 | 768.0375 | 771.5532 | 1.00 |
| binlog | 10 | 1224.535 | 1245.496 | 1.02 |
| binlog | 20 | 1597.48 | 1625.153 | 1.02 |
| binlog | 30 | 1859.603 | 1979.328 | 1.06 |
| binlog | 40 | 2164.329 | 2388.804 | 1.10 |
| binlog | 50 | 2572.827 | 2942.082 | 1.14 |
| binlog | 60 | 3158.408 | 3528.791 | 1.12 |
| binlog | 70 | 3883.275 | 4535.281 | 1.17 |
| binlog | 80 | 4390.69 | 5246.567 | 1.19 |
| nobinlog | 5 | 788.9388 | 783.155 | 0.99 |
| nobinlog | 10 | 1290.035 | 1294.098 | 1.00 |
| nobinlog | 20 | 1745.464 | 1743.759 | 1.00 |
| nobinlog | 30 | 2109.301 | 2158.267 | 1.02 |
| nobinlog | 40 | 2508.28 | 2649.695 | 1.06 |
| nobinlog | 50 | 3061.196 | 3334.766 | 1.09 |
| nobinlog | 60 | 3841.92 | 4168.089 | 1.08 |
| nobinlog | 70 | 4772.747 | 5140.316 | 1.08 |
| nobinlog | 80 | 5727.795 | 5947.848 | 1.04 |
In tabular form:
| Buffer pool, GB | server | binlog | nobinlog | Ratio nobinlog / binlog |
| 5 | MYSQL8 | 768.0375 | 788.9388 | 1.03 |
| 5 | PS57 | 771.5532 | 783.155 | 1.02 |
| 10 | MYSQL8 | 1224.535 | 1290.0352 | 1.05 |
| 10 | PS57 | 1245.496 | 1294.0983 | 1.04 |
| 20 | MYSQL8 | 1597.48 | 1745.4637 | 1.09 |
| 20 | PS57 | 1625.153 | 1743.7586 | 1.07 |
| 30 | MYSQL8 | 1859.603 | 2109.3005 | 1.13 |
| 30 | PS57 | 1979.328 | 2158.2668 | 1.09 |
| 40 | MYSQL8 | 2164.329 | 2508.2799 | 1.16 |
| 40 | PS57 | 2388.804 | 2649.6945 | 1.11 |
| 50 | MYSQL8 | 2572.827 | 3061.1956 | 1.19 |
| 50 | PS57 | 2942.082 | 3334.7656 | 1.13 |
| 60 | MYSQL8 | 3158.408 | 3841.9203 | 1.22 |
| 60 | PS57 | 3528.791 | 4168.0886 | 1.18 |
| 70 | MYSQL8 | 3883.275 | 4772.7466 | 1.23 |
| 70 | PS57 | 4535.281 | 5140.316 | 1.13 |
| 80 | MYSQL8 | 4390.69 | 5727.795 | 1.30 |
| 80 | PS57 | 5246.567 | 5947.8477 | 1.13 |
It seems that binary logs have quite an effect MySQL 8.0, and we see up to a 30% performance penalty as opposed to the 13% for Percona Server for MySQL 5.7.
In general, for in-memory workloads, Percona Server for MySQL 5.7 outperforms MySQL 8.0 by 10-20% with binary logs enabled, and 4-9% without binary logs enabled.
For io-bound workloads (buffer pool size <= 30GB), the performance numbers for Percona Server for MySQL and MySQL are practically identical.
Supermicro server:
My goal is to provide fully repeatable benchmarks. I have shared all scripts and settings I used in the following GitHub repo:
https://github.com/Percona-Lab-results/201805-sysbench-tpcc-mysql8
Resources
RELATED POSTS