This has performance results for InnoDB from MySQL 5.6.51, 5.7.44, 8.0.X, 8.4.8 and 9.7.0 on a small server with sysbench microbenchmarks. The workload here is cached by InnoDB and my focus is on regressions from new CPU overheads.
In many cases, MySQL 5.6.51 gets about 1.5X more QPS than modern MySQL (8.0.x thru 9.7). The root cause is new CPU overhead, possibly from code bloat.
tl;dr
- There are too many performance regressions in MySQL 8.0.X
- There are few performance regressions in MySQL 8.4 through 9.7.0
- In many cases MySQL 5.6.51 gets ~1.5X more QPS than 9.7.0 because 9.7.0 uses more CPU
- Large regressions arrived in MySQL 8.0.30 and 8.0.32, especiall for full-table scans
The server is an ASUS ExpertCenter PN53 with AMD Ryzen 7 7735HS, 32G RAM and an m.2 device for the database. More details on it are here. The OS is Ubuntu 24.04 and the database filesystem is ext4 with discard enabled.
The my.cnf files are here for 5.6, 5.7, 8.4 and 9.7.
There my.cnf files are here fo 8.0.28, 8.0.30, 8.0.31, 8.0.32, 8.0.33, 8.0.34, 8.0.35, 8.0.36 and 8.0.45.
Benchmark
The tests are run using 1 table with 50M rows. The read-heavy microbenchmarks run for 630 seconds and the write-heavy for 930 seconds.
I provide tables below with relative QPS. When the relative QPS is > 1 then some version is faster than the base version. When it is < 1 then there might be a regression. The relative QPS is below where the base version is either MySQL 5.6.51 or 8.0.28:
(QPS for some version) / (QPS for base version)
- there are large regressions from 5.6.51 to 5.7.44
- there are larger regressions from 5.7.44 to 8.0.45
- the regressions from 8.0.45 to 9.7.0 are small
- the regressions in the random-points tests are larger for range=10 than range=1000 (larger when the range is smaller). So the regressions are more likely to be in places other than InnoDB. The problem is new CPU overhead (see cpu/o here) which is 1.55X larger in 9.7.0 vs 5.6.51 for random-points_range=10 but only 1.19X larger in 9.7.0 for random-points_range=1000.
- The large regressions in 8.0.x for point queries (see above) occur prior to 8.0.28
- there are large regressions from 5.6.51 to 5.7.44
- there are larger regressions from 5.7.44 to 8.0.45
- the regressions from 8.0.45 to 9.7.0 are small
- the problem is new CPU overhead and for the scan test the CPU overhead per query is about 1.5X larger in modern MySQL (8.0 thru 9.7) relative to MySQL 5.6.51 (see cpu/o here)
- There is a large regression in 8.0.30 and a larger one in 8.0.32
- The scan test is the worst case for the regression.
- there are large regressions from 5.6.51 to 5.7.44
- there are larger regressions from 5.7.44 to 8.0.45
- the regressions from 8.0.45 to 9.7.0 are small
- There are significant regressions in 8.0.30 and 8.0.32
- there are large regressions from 5.6.51 to 5.7.44
- there are larger regressions from 5.7.44 to 8.0.45
- the regressions from 8.0.45 to 9.7.0 are small
- the insert test is the worst case and a big part of that is new CPU overhead, see cpu/o here, where it is 2.13X larger in 9.7.0 than 5.6.51. But for update-one the problem is writing more to storage per commit (see wkbpi here) rather than new CPU overhead.
- There are significant regressions in 8.0.30 and 8.0.32


