[MDEV-13845] benchmark RocksDB engine Created: 2017-09-19 Updated: 2021-09-16 Resolved: 2021-09-16 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - RocksDB |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | Axel Schwenke | Assignee: | Axel Schwenke |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | benchmarking | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Description |
|
Check RocksDB performance for common database operations (reads/writes). Especially how it compares to InnoDB in terms of throughput and storage needs. |
| Comments |
| Comment by Sergei Petrunia [ 2018-09-23 ] | ||||||
|
See also | ||||||
| Comment by Sergei Petrunia [ 2018-09-23 ] | ||||||
|
axel, can you re-run the benchmark with the patch for | ||||||
| Comment by Axel Schwenke [ 2018-11-08 ] | ||||||
|
New results (MyRocks and InnoDB from MariaDB 10.3.10) in spreadsheet MDEV-13845-B.ods | ||||||
| Comment by Sergei Petrunia [ 2018-11-11 ] | ||||||
|
axel, thanks for the new results.
Questions about the configuration
| ||||||
| Comment by Axel Schwenke [ 2018-11-15 ] | ||||||
|
psergey some answers to your questions:
| ||||||
| Comment by Mark Callaghan [ 2018-11-21 ] | ||||||
|
In the comment above this one there are links to 2 github directories, and each of those directories has many files like my.cnf.X. How do I find the the my.cnf used for MyRocks and InnoDB from these many possible my.cnf files? | ||||||
| Comment by Sergei Petrunia [ 2018-11-28 ] | ||||||
|
As far as I understand, the two digit number is the run number.
| ||||||
| Comment by Sergei Petrunia [ 2018-11-28 ] | ||||||
|
This agrees with my.cnf files. Also, some of them are symlinks.
mdcallag, so as far as my understanding goes, the issue (MyRocks slower than InnoDB for in-memory workload, on recent build) was observed on these: InnoDB: https://github.com/hgxl64/mariadb-benchmarks/blob/master/Sysbench-0.5/MDEV-13845/RocksDB-10.3.10/my.cnf.03 | ||||||
| Comment by Sergei Petrunia [ 2018-11-28 ] | ||||||
|
I haven't yet tried to reproduce myself. It would be interesting to do so (to check if there are some hidden factors at play) | ||||||
| Comment by Mark Callaghan [ 2018-11-28 ] | ||||||
|
— Overview From sysbench on my hardware (at home and at work), MyRocks in FB MySQL 5.6.35 vs InnoDB from upstream
From results by Alex (
For sysbench read-write with 22% writes I see:
in-memory, big server - http://smalldatum.blogspot.com/2017/12/sysbench-in-memory-and-fast-server.html While these blog posts don't always share the absolute values for sysbench QPS, I have that data too archived elsewhere. — Summary Questions about HW:
Things to debug: PMP stack traces will help figure out both issues. Things that might help me:
— Feedback on my.cnf From the my.cnf files that Sergey listed: This is small (~100MB/s) and might cause writes to be throttled. I frequently don't set it for benchmarks.
From the other options: ;\ The number of background threads used for compaction/flush was not set and should be set for a benchmark. The default is probably too small and the outcome will be more write stalls. On current MyRocks the option is rocksdb_max_background_jobs. Compression is zstd for all levels. For in-memory benchmark I would disable compression as that can help write throughput and reduce CPU load. If database is small enough to fit in-memory than there isn't much to be gained from compression. If you must use MyRocks compression in this case then switch to lz4 or snappy. For IO-bound tests I use no compression for L0, L1 and L2 then lz4 or snappy for remaining levels except the max, then zstd for the max. Or just use snappy/lz4 for all levels. zlib and zstd impose big CPU overhead with little gain for L0, L1, L2. I would start with a normal bloom filter. The above used a prefix bloom filter. So rather than: ;\ I would use: ;\ My general tuning advice is at: | ||||||
| Comment by Mark Callaghan [ 2018-11-28 ] | ||||||
|
I don't like that MyRocks appears to be worse at too-much concurrency than InnoDB on the sysbench read-only and in-memory workload. But I am also not that interested in that workload – 256 or 128 concurrent queries with an in-memory database and a server with much less than 128 CPU cores means the CPU is significantly oversubscribed and that is not a good way to run MySQL or MariaDB. Alas the MySQL community has been putting too much focus on that result for a long time. So I won't blame Axel here. | ||||||
| Comment by Axel Schwenke [ 2018-12-04 ] | ||||||
|
Hi mdcallag. Some answers to your questions:
The test server has 128G of RAM, so the test uses only a small portion. There are 16 physical cores (in 2 sockets), HT is on, so Linux sees 32 cores. The storage is two SATA SSD (INTEL SSDSC2BB300H4) in RAID0 (Linux md, 1M chunks) formatted with ext4 (relatime,data=ordered).
InnoDB in MariaDB 10.3 is from MySQL 5.7.21, MyRocks reports "rocksdb_version=5.8.0" | ||||||
| Comment by Mark Callaghan [ 2018-12-04 ] | ||||||
|
RocksDB 5.8 is from December, 2017. While that is now ~1 year old, it has many of the important fixes. So I won't suggest it is too old. For 16 cores and 32 HW threads I am not that interested in throughput for an in-memory workload and 128 or 256 concurrent clients running without think time. Alas, I also want to know that MyRocks doesn't fall over (QPS collapse) at that point and perhaps it does in this case. PMP stack traces might help to debug it. | ||||||
| Comment by Sergei Petrunia [ 2018-12-06 ] | ||||||
|
> InnoDB in MariaDB 10.3 is from MySQL 5.7.21, MyRocks reports "rocksdb_version=5.8.0"
(we should look at printing a value for rocksdb_build_git_sha... But there is @@rocksdb_git_hash status variable also, which gives one the git hash of the RocksDB's revision) | ||||||
| Comment by Axel Schwenke [ 2018-12-06 ] | ||||||
I looked in the OPTIONS* file in the RocksDB datadir. But I made a mistake. 5.8.0 is the RocksDB version in MariaDB 10.3.6. It's indeed 5.14.0 in 10.3.10. I'd like to have the RocksDB version printed to the server error log at startup, just like InnoDB does. Want a MDEV for that? | ||||||
| Comment by Axel Schwenke [ 2019-01-22 ] | ||||||
|
I added results from a comparison between RocksDB in MariaDB 10.3.10 and RocksDB from Facebook 5.6.35. The file is MDEV-13845-upstream.ods Observations:
I also tested InnoDB performance in both variants (sheet #2 in the document). In MariaDB InnoDB is mostly better when it has enough memory and uses many threads, but slower if it runs IO bound. |