rocks db - animeshtrivedi/notes GitHub Wiki
RocksDB notes
Bookmarks
- https://github.com/stonet-research/storage-systems-wiki-reading-list/wiki/RocksDB-notes
- https://github.com/facebook/rocksdb
db_bench
wiki page: https://github.com/EighteenZi/rocksdb_wiki/blob/master/Benchmarking-tools.md- https://www.intel.com/content/www/us/en/content-details/686417/rocksdb-db-bench-tuning-guide-on-3rd-generation-intel-xeon-scalable-processors-based-platform.html
- RocksDB* db_bench Tuning Guide on 3rd Generation Intel® Xeon® Scalable Processors Based Platform https://cdrdv2-public.intel.com/686417/rocksdb-benchmark-tuning-guide-on-xeon.pdf
Other bookmarks:
- Rocksdb blog: https://rocksdb.org/blog/
- how to interpret histogram output of db_bench
-
First column is the interval, let's say [9, 10). Next column is number of samples that fall in this interval. Third column represent percentage of samples in that interval. Fourth column is the cumulative percentage of samples up to this interval (meaning all samples less than 10 in this case). The last column is just a graphical representation of the second column.
-
- wiki: RocksDB In Memory Workload Performance Benchmarks
- has details about how to optimize/setup for high-performance file system media
- wiki: WAL Performance
- Talks about
sync
mode (the default isasync
mode)
- Talks about
- wiki: Direct IO
-
With buffered I/O, the data is copied twice between storage and memory because of the page cache as the proxy between the two.
-
- Clarification on max_total_wal_size
- cockroachdb: internal/record: use direct I/O for the WAL and MANIFEST #1159
Errors
open error: IO error: lock hold by current process, acquire time 1732119426 acquiring thread 372738: /home/animesh.trivedi/rocksdb-exp//ssd/LOCK: No locks available
Most likely you have --use_existing_db=false
and then using an destroying benchmarking.
Configuration space
Chenxingyu Zhao, Tapan Chugh, Jaehong Min, Ming Liu, and Arvind Krishnamurthy. 2022. Dremel: Adaptive Configuration Tuning of RocksDB KV-Store. Proc. ACM Meas. Anal. Comput. Syst. 6, 2, Article 37 (June 2022), 30 pages. https://doi.org/10.1145/3530903
WAL options
https://github.com/facebook/rocksdb/wiki/basic-operations#purging-wal-files
Plan
- install from source
- test a run with a single location
- read through the db_bench parameters
- generate per-seconds ops timeline
- separate the locations
- clean release build
- device pre-conditioning
- setup NVMe namespaces
- setup long-running experiments
Benchmarks and generating stats
use : fillrandom,stats,levelstats,memstats,sstables
Avoid seed reuse when --benchmarks has more than one test
How to generate per-second ops/s timeline
When does a flush happens from memtable
https://github.com/facebook/rocksdb/wiki/MemTable#flush
building rocksdb from src (2024-12)
sudo apt install autoconf automake libgflags-dev libtool autoconf-archive m4
sudo apt install libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev
git tag
git checkout v9.4.7
#DEBUG_LEVEL=0 ROCKSDB_PLUGINS="s2fs" USE_RTTI=1 PREFIX=/home/$USER/local/ DISABLE_JEMALLOC=1 DISABLE_WARNING_AS_ERROR=1 make -j4 db_bench install
DEBUG_LEVEL=0 USE_RTTI=1 PREFIX=/home/$USER/local/ DISABLE_JEMALLOC=1 DISABLE_WARNING_AS_ERROR=1 make -j32 db_bench install
Compile for release:
PREFIX=/home/$USER/local/ make -j32 release install
Old
So there is class DB which is the virtual class implementing the database, and one single implementation DBImpl and many wrapper. It is a very large class to make sense out of the blue for now.
(old) Performance links
- https://nni.readthedocs.io/en/stable/TrialExample/RocksdbExamples.html
- https://rocksdb.org/blog/2019/08/15/unordered-write.html (there is rocksdb blog)
- https://research.fb.com/wp-content/uploads/2020/02/Characterizing-Modeling-and-Benchmarking-RocksDB-Key-Value-Workloads-at-Facebook-v2.pdf
- Main man page: https://github.com/facebook/rocksdb/wiki/Benchmarking-tools
- Contains useful information to debug JNI bridge - https://github.com/facebook/rocksdb/wiki/JNI-Debugging