Are MySQL 5.7 and 8.0 faster than 5.6? That depends a lot on the workload -- both types of SQL and amount of concurrency. Here I summarize results from sysbench on a larger server (48 cores) using 1, 4, 6, 8, 10, 20 and 40 clients to show how things change.
tl;dr
- the workload here is microbenchmarks with a database cached by InnoDB
- 5.7.44 is faster than 8.0.x at all concurrency levels on most microbenchmarks
- for 5.6.51 vs 8.0.x
- for point queries, 5.6.51 is faster at <= 8 clients
- for range queries without aggregation 5.6.51 is always faster
- for range queries with aggregation 5.6.51 is faster except at 40 clients
- for writes, 5.6.51 is almost always faster at 10 or fewer clients (excluding update-index)
- 5.7.44 is always faster than 8.0
- 8.0.28 suffers from bug 102037 - found by me with sysbench, fixed in 8.0.31
- at what level of concurrency do most things get faster in 5.7 & 8.0 vs 5.6?
- 5.7.44 becomes faster than 5.6.51 at 6+ clients
- 8.0.x becomes faster than 5.6.51 at between 10 and 20 clients
- Two of the microbenchmarks are always faster in 5.6.51 - both do non-covering queries on a secondary index
- 5.7.44 is always faster than 8.0x
- 5.6.51 is always faster than 5.7.44 and 8.0.x
- 5.7.44 is almost always faster than 8.0.x
- 5.7.44 becomes faster than 5.6.51 at 6+ clients
- 8.0.x becomes faster than 5.6.51 at 40 clients
- For update-index
- 5.7.44 and 8.0.x are always faster than 5.6.51 at 4+ clients
- There is an odd drop from ~6X to ~3X for 8.0.32 and 8.0.39 at 20 clients
- 5.7.44 is mostly faster than 8.0.x for 1 to 20 clients and they have similar results at 40 clients
- 5.7.44 & 8.0.x are always faster than 5.6.51 at 20+ clients
The tests run with 8 tables and 10M rows/table. There are 40 client threads, read-heavy microbenchmarks run for 180 seconds and write-heavy run for 300 seconds.
bash r.sh 8 10000000 180 300 md2 1 1 1bash r.sh 8 10000000 180 300 md2 1 1 4bash r.sh 8 10000000 180 300 md2 1 1 6bash r.sh 8 10000000 180 300 md2 1 1 8bash r.sh 8 10000000 180 300 md2 1 1 10bash r.sh 8 10000000 180 300 md2 1 1 20bash r.sh 8 10000000 180 300 md2 1 1 40
(QPS for $version) / (QPS for MySQL 5.6.51)
Notes on the charts
- the y-axis shows the relative QPS
- the y-axis starts at 0.80 to make it easier to see differences
- in some cases the y-axis truncates the good outliers, cases where the relative QPS is greater than 1.5. I do this to improve readability for values near 1.0. Regardless, the improvements are nice.
- 5.7.44 is always faster than 8.0
- 8.0.28 suffers from bug 102037 - found by me with sysbench, fixed in 8.0.31
- at what level of concurrency do most things get faster in 5.7 & 8.0 vs 5.6?
- 5.7.44 becomes faster than 5.6.51 at 6+ clients
- 8.0.x becomes faster than 5.6.51 at between 10 and 20 clients
- Two of the microbenchmarks are always faster in 5.6.51 - both do non-covering queries on a secondary index
- 5.7.44 is always faster than 8.0x
- 5.6.51 is always faster than 5.7.44 and 8.0.x
- 5.7.44 is almost always faster than 8.0.x
- 5.7.44 becomes faster than 5.6.51 at 6+ clients
- 8.0.x becomes faster than 5.6.51 at 40 clients
- For update-index
- 5.7.44 and 8.0.x are always faster than 5.6.51 at 4+ clients
- There is an odd drop from ~6X to ~3X for 8.0.32 and 8.0.39 at 20 clients but you can't see that on the charts in this section because of the truncation. It is visible in the next section. From vmstat I see an increase in CPU/operation (cpu/o) and context switches /operation (cs/o) at 20 clients but not at 40 clients.
- 5.7.44 is mostly faster than 8.0.x for 1 to 20 clients and they have similar results at 40 clients
- 5.7.44 & 8.0.x are always faster than 5.6.51 at 20+ clients