This has results from the Insert Benchmark for many versions of MyRocks and MySQL (InnoDB) on a small server with a cached database and low-concurrency workload.
The goal here is to document performance regressions over time for both upstream MySQL with InnoDB and FB MyRocks. If they get slower at a similar rate from MySQL 5.6 to 8.0 then the culprit is code above the storage engine. Otherwise, the regressions are from the storage engine.
tl;dr
- Regressions from 5.6 to 8.0 are worse for InnoDB than for MyRocks
- InnoDB is faster than MyRocks here because the workload is CPU-bound and InnoDB uses less CPU than MyRocks. A result from an IO-bound setup will be different.
- The worst case for MyRocks vs InnoDB here is on the range query benchmark steps (qr100, qr500, qr1000) because range queries with an LSM usually don't benefit from a bloom filter and do suffer from merging iterators -- which all increases the CPU overhead.
- I need to spend more time getting flamegraphs to document the differences.
I tested MyRocks from FB MySQL 5.6.35, 8.0.28 and 8.0.32.
- 5.6.35 was at git sha 4f3a57a1 using RocksDB 8.7.0
- 8.0.28 was at git sha c6c83b18 using RocksDB 8.7.0
- 8.0.32 was at git sha 59f03d5a using RocksDB 9.3.1
The benchmark steps are:
- l.i0
- insert X million rows in PK order. The table has a PK index but no secondary indexes. There is one connection per client. The value of X is 20M for SER4 and 30M for PN53.
- l.x
- create 3 secondary indexes per table. There is one connection per client.
- l.i1
- use 2 connections/client. One inserts 40M rows and the other does deletes at the same rate as the inserts. Each transaction modifies 50 rows (big transactions). This step is run for a fixed number of inserts, so the run time varies depending on the insert rate.
- l.i2
- like l.i1 but each transaction modifies 5 rows (small transactions) and 10M rows are inserted and deleted.
- Wait for X seconds after the step finishes to reduce variance during the read-write benchmark steps that follow. The value of X is a function of the table size.
- qr100
- use 3 connections/client. One does range queries and performance is reported for this. The second does does 100 inserts/s and the third does 100 deletes/s. The second and third are less busy than the first. The range queries use covering secondary indexes. This step is run for 1800 seconds. If the target insert rate is not sustained then that is considered to be an SLA failure. If the target insert rate is sustained then the step does the same number of inserts for all systems tested.
- qp100
- like qr100 except uses point queries on the PK index
- qr500
- like qr100 but the insert and delete rates are increased from 100/s to 500/s
- qp500
- like qp100 but the insert and delete rates are increased from 100/s to 500/s
- qr1000
- like qr100 but the insert and delete rates are increased from 100/s to 1000/s
- qp1000
- like qp100 but the insert and delete rates are increased from 100/s to 1000/s
- SER4 - all, InnoDB, MyRocks and MyRocks vs InnoDB
- PN53 - all, InnoDB, MyRocks and MyRocks vs InnoDB
- insert/s for l.i0, l.i1, l.i2
- indexed rows/s for l.x
- range queries/s for qr100, qr500, qr1000
- point queries/s for qp100, qp500, qp1000
- There is a large regression from 5.6 to 5.7 and then again from 5.7 to 8.0
- MySQL 8.0.37 gets ~30% less throughput relative to 5.6.51
- l.i0
- relative QPS is 0.84 in 5.7.44 with SER4
- relative QPS is 0.57 in 8.0.37 with SER4
- l.x - I ignore this for now
- l.i1, l.i2
- relative QPS is 1.15, 0.87 in 5.7.44 with SER4
- relative QPS is 1.02, 0.71 in 8.0.37 with SER4
- qr100, qr500, qr1000
- relative QPS is 0.75, 0.74, 0.73 in 5.7.44 with SER4
- relative QPS is 0.64, 0.64, 0.63 in 8.0.37 with SER4
- qp100, qp500, qp1000
- relative QPS is 0.81, 0.82, 0.83 in 5.7.44 with SER4
- relative QPS is 0.61, 0.61, 0.63 in 8.0.37 with SER4
- l.i0
- relative QPS is 0.89 in 5.7.44 with PN53
- relative QPS is 0.61 in 8.0.37 with PN53
- l.x - I ignore this for now
- l.i1, l.i2
- relative QPS is 1.06, 1.01 in 5.7.44 with PN53
- relative QPS is 0.98, 0.84 in 8.0.37 with PN53
- qr100, qr500, qr1000
- relative QPS is 0.83, 0.85, 0.83 in 5.7.44 with PN53
- relative QPS is 0.75, 0.76, 0.74 in 8.0.37 with PN53
- qp100, qp500, qp1000
- relative QPS is 0.87, 0.86, 0.86 in 5.7.44 with PN53
- relative QPS is 0.70, 0.69, 0.69 in 8.0.37 with PN53
- fbmy5635_rel_240606_4f3a57a1.cza1_bee or fbmy5635_rel_240606_4f3a57a1.cza1_c8r32
- fbmy8028_rel_240606_c6c83b18.cza1_bee, fbmy8028_rel_240606_c6c83b18.cza1_c8r32
- fbmy8032_rel_240606_59f03d5a.cza1_bee, fbmy8032_rel_240606_59f03d5a.cza1_c8r32
- These results have more variance than the InnoDB results above, especially for range queries. It might be that I need to run the qr* benchmark steps for more than 1800 seconds.
- l.i0
- relative QPS is 0.72 in 8.0.28 with SER4
- relative QPS is 0.67 in 8.0.32 with SER4
- l.x - I ignore this for now
- l.i1, l.i2
- relative QPS is 0.90, 0.85 in 8.0.28 with SER4
- relative QPS is 0.91, 0.82 in 8.0.32 with SER4
- qr100, qr500, qr1000
- relative QPS is 0.73, 1.04, 1.06 in 8.0.28 with SER4
- relative QPS is 0.64, 0.92, 0.85 in 8.0.32 with SER4
- qp100, qp500, qp1000
- relative QPS is 0.97, 0.95, 0.92 in 8.0.28 with SER4
- relative QPS is 0.87, 0.88, 0.88 in 8.0.32 with SER4
- l.i0
- relative QPS is 0.70 in 8.0.28 with PN53
- relative QPS is 0.66 in 8.0.32 with PN53
- l.x - I ignore this for now
- l.i1, l.i2
- relative QPS is 0.87, 0.90 in 8.0.28 with PN53
- relative QPS is 0.92, 0.88 in 8.0.32 with PN53
- qr100, qr500, qr1000
- relative QPS is 1.40, 1.12, 0.91 in 8.0.28 with PN53
- relative QPS is 0.81, 1.00, 0.83 in 8.0.32 with PN53
- qp100, qp500, qp1000
- relative QPS is 0.89, 0.89, 0.90 in 8.0.28 with PN53
- relative QPS is 0.87, 0.87, 0.88 in 8.0.32 with PN53
- For l.i0
- CPU overhead (see cpupq for SER4 and for PN53) increases a lot from 5.6 to 8.0 for both InnoDB and MyRocks, and the regressions are probably from code above the storage engine
- For l.i1 and l.i2
- CPU overhead (see cpupq for SER4 and for PN53) increases from 5.6 to 8.0 for MyRocks while for InnoDB there is more variance but less of an increase. Thus, while MyRocks was faster on l.i1 it became slower on l.i2 -- perhaps from tombstones, compaction and other MVCC GC overheads). Another difference between l.i1 and l.i2 is that the fraction of query time spent in the optimizer relative is larger with l.i2 because less work is done per DELETE statement. But I am speculating here and need more time to debug it.
- The charts with per-second rates for inserts and deletes show more variance for MyRocks (for SER4 and PN53) than for InnoDB (for SER4 and PN53).
- For qr100
- On the SER4 server the CPU overhead increases by ~1.5X from 5.6 to 8.0 for both MyRocks and InnoDB. But in absolute terms the increase is ~3X larger for MyRocks. On PN53 the relative increase is ~1.3X for both but the absolute increase for MyRocks is ~2X larger than for InnoDB. I need flamegraphs to understand why. See the cpupq column for SER4 and for PN53.
- For qp100
- l.i0
- relative QPS is 0.95 in MyRocks 8.0.32 with SER4
- relative QPS is 0.92 in MyRocks 8.0.32 with PN53
- l.x - I ignore this for now
- l.i1, l.i2
- relative QPS is 1.18, 0.79 in MyRocks 8.0.32 with SER4
- relative QPS is 1.30, 0.85 in MyRocks 8.0.32 with PN53
- qr100, qr500, qr1000
- relative QPS is 0.40, 0.44, 0.41 in MyRocks 8.0.32 with SER4
- relative QPS is 0.36, 0.40, 0.43 in MyRocks 8.0.32 with PN53
- qp100, qp500, qp1000
- relative QPS is 0.83, 0.85, 0.83 in MyRocks 8.0.32 with SER4
- relative QPS is 0.82, 0.82, 0.82 in MyRocks 8.0.32 with PN53





























