Yahoo! Cloud Serving Benchmark(YCSB) written in C++. This is a fork of YCSB-C with some additions
- Tail latency report using HdrHistogram_c
- Modified the workload more similar to the original YCSB
- Supported databases: LevelDB, RocksDB, LMDB, WiredTiger, SQLite
Additionally, this repository is an extension of the original YCSB-cpp project, now supporting a few more databases (e.g. Speedb, TerarkDB, UnQLite, etc.) and including instructions to build and install DBs from source (locally, without root).
This specific fork serves as a portion of an end-of-semester project for Georgia Tech's CS 6400 Databases course
- Clone this repository, recursing to all submodules
git clone --recurse-submodules git@github.com:richardso21/YCSB-cpp.git- Ensure you have
gccandcmakeinstalled
- LevelDB is included as a submodule in this repository. To build it, run the following commands:
cd YCSB-cpp/third-party/leveldb
mkdir build && cd build
# to install globally...
cmake -DCMAKE_BUILD_TYPE=Release ..
# or, to install locally (e.g. if you are on PACE)
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/.local ..
make install- If you installed locally, you will need to add the following to your
.bashrcor.bash_profile(orzshequivalents):
export PATH=$PATH:~/.local/bin
export CPATH=$CPATH:~/.local/include
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.local/libLevelDB is included in order to provide a reference point for the original
YCSBimplementation in Java.
-
TerarkDB is included as a submodule, found within
YCSB-cpp/terarkdb/terarkdb. -
IMPORTANT: If you are on PACE, or you do not have XSL (or you do not know what it is), you will need to modify
terarkdb/terarkdb/third-party/CMakeLists.txtat line 203. Change the line from:
INSTALL_COMMAND $(MAKE) install PREFIX=${CMAKE_BINARY_DIR}to:
INSTALL_COMMAND $(MAKE) install_bin install_include install_lib PREFIX=${CMAKE_BINARY_DIR}- To build TerarkDB as a static library for YCSB-cpp, run the following commands:
cd YCSB-cpp/terarkdb/terarkdb
WITH_TESTS=OFF WITH_ZNS=OFF ./build.shNOTE: TerarkDB is a fork of RocksDB, and thus shares the same header paths. Do not compile YCSB-cpp with both TerarkDB and RocksDB binded simultaneously!
Initialize submodule and use make to build.
git clone https://github.com/ls4154/YCSB-cpp.git
cd YCSB-cpp
git submodule update --init
makeDatabases to bind must be specified as build options. You may also need to add additional link flags (e.g., -lsnappy).
To bind LevelDB:
make BIND_LEVELDB=1To build with additional libraries and include directories:
make BIND_LEVELDB=1 EXTRA_CXXFLAGS=-I/example/leveldb/include \
EXTRA_LDFLAGS="-L/example/leveldb/build -lsnappy"Or modify config section in Makefile.
RocksDB build example:
EXTRA_CXXFLAGS ?= -I/example/rocksdb/include
EXTRA_LDFLAGS ?= -L/example/rocksdb -ldl -lz -lsnappy -lzstd -lbz2 -llz4
BIND_ROCKSDB ?= 1git submodule update --init
mkdir build
cd build
cmake -DBIND_ROCKSDB=1 -DBIND_WIREDTIGER=1 -DBIND_LMDB=1 -DBIND_LEVELDB=1 -DWITH_SNAPPY=1 -DWITH_LZ4=1 -DWITH_ZSTD=1 ..
makesee BUILD_ON_WINDOWS
Load data with leveldb:
./ycsb -load -db leveldb -P workloads/workloada -P leveldb/leveldb.properties -sRun workload A with leveldb:
./ycsb -run -db leveldb -P workloads/workloada -P leveldb/leveldb.properties -sLoad and run workload B with rocksdb:
./ycsb -load -run -db rocksdb -P workloads/workloadb -P rocksdb/rocksdb.properties -sPass additional properties:
./ycsb -load -db leveldb -P workloads/workloadb -P rocksdb/rocksdb.properties \
-p threadcount=4 -p recordcount=10000000 -p leveldb.cache_size=134217728 -s