Run YCSB workload for RocksDB

659 views
Skip to first unread message

Kovida Surampudi

unread,
Jun 28, 2023, 3:07:02 AM6/28/23
to rocksdb

Hello,

 I am new to RocksDB and as a part of my Master's project, I need to benchmark RocksDB using YCSB. I am unsure how I should proceed after the following steps. Can someone please guide me?

  1.  I have cloned RocksDB repository.
    1. git clone https://github.com/facebook/rocksdb.git
    2. cd rocksdb
    3. mkdir build && cd build
    4. cmake .. -DWITH_STATIC_LIB=ON -DWITH_SHARED_LIB=ON
    5. make

2.               2. I have compiled it to .so and .a files.

  1. Compile RocksDB first by executing make static_lib in parent dir
  2. Compile all examples: cd examples/; make all

Thanks in advance,
Kovida.

Dimitra Giantsidi

unread,
Jun 28, 2023, 3:31:01 AM6/28/23
to Kovida Surampudi, rocksdb
Hello there,

There are two ways to do that:
1) Use the db_bench_tool provided by rocksdb-repository (https://github.com/facebook/rocksdb/blob/bfdc91017c0667e05cd2f2b49337446e0fb5c1b1/tools/db_bench_tool.cc#L8455). There some key-distributions that are supported but you would probably need to implement the one you want (uniform, zipfian, random). YCSB supports all of them. The benchmark will use RocksDB as a library so in single node system.
2) The second approach is to use use a separate process to run YCSB (https://github.com/brianfrankcooper/YCSB/tree/master/rocksdb). Here the ease is that you only need to write a config file for the workload characteristics but there will be two processes running: the RocksDB (as a java app) and the workload generator (YCSB). That benchmarking setup allows you to evaluate the code in a distributed setup (and a single-node one).

- Dimitra

--
You received this message because you are subscribed to the Google Groups "rocksdb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rocksdb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rocksdb/d5cae9f0-74b5-4747-b292-2b9d1eb9abcdn%40googlegroups.com.


--
Giantsidi Dimitra

Adam Retter

unread,
Jun 28, 2023, 9:26:22 AM6/28/23
to Dimitra Giantsidi, Kovida Surampudi, rocksdb
It is also worth being aware that RocksJava is slower than RocksDB due
to the JNI interface overhead. So if you want to benchmark RocksDB, I
would not use YCSB.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rocksdb/CA%2BM-wDCLg%2Bo5Zab1r%3DnYQk5zZCebYrgZQJ2-tVxH1k8Q91GUjA%40mail.gmail.com.



--
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk

Kovida Surampudi

unread,
Jul 19, 2023, 9:18:42 AM7/19/23
to Adam Retter, Dimitra Giantsidi, rocksdb
Hello,

I have a few follow-up questions on my previous query.

1. I am unsure if all the prerequisites are set up properly on my pc for running YCSB benchmarks on RocksDB. This is how I got the output of Load using Workload A. I would like to know if this is correct in general.

  ./bin/ycsb load rocksdb -s -P workloads/workloada -p rocksdb.dir=/tmp/ycsb-rocksdb-data
[WARN]  Running against a source checkout. In order to get our runtime dependencies we'll have to invoke Maven. Depending on the state of your system, this may take ~30-45 seconds
[DEBUG]  Running 'mvn -pl site.ycsb:rocksdb-binding -am package -DskipTests dependency:build-classpath -DincludeScope=compile -Dmdep.outputFilterFile=true'
/usr/lib/jvm/default-java/bin/java -cp /home/kovidaunix/rocksdb/YCSB/rocksdb/conf:/home/kovidaunix/rocksdb/YCSB/rocksdb/target/rocksdb-binding-0.18.0-SNAPSHOT.jar:/home/kovidaunix/.m2/repository/org/apache/htrace/htrace-core4/4.1.0-incubating/htrace-core4-4.1.0-incubating.jar:/home/kovidaunix/.m2/repository/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar:/home/kovidaunix/.m2/repository/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar:/home/kovidaunix/.m2/repository/org/hdrhistogram/HdrHistogram/2.1.4/HdrHistogram-2.1.4.jar:/home/kovidaunix/.m2/repository/org/codehaus/jackson/jackson-mapper-asl/1.9.4/jackson-mapper-asl-1.9.4.jar:/home/kovidaunix/.m2/repository/org/rocksdb/rocksdbjni/6.2.2/rocksdbjni-6.2.2.jar:/home/kovidaunix/.m2/repository/org/codehaus/jackson/jackson-core-asl/1.9.4/jackson-core-asl-1.9.4.jar:/home/kovidaunix/rocksdb/YCSB/core/target/core-0.18.0-SNAPSHOT.jar site.ycsb.Client -db site.ycsb.db.rocksdb.RocksDBClient -s -P workloads/workloada -p rocksdb.dir=/tmp/ycsb-rocksdb-data -load
Command line: -db site.ycsb.db.rocksdb.RocksDBClient -s -P workloads/workloada -p rocksdb.dir=/tmp/ycsb-rocksdb-data -load
YCSB Client 0.18.0-SNAPSHOT

Loading workload...
Starting test.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2023-06-29 17:43:41:670 0 sec: 0 operations; est completion in 0 second
DBWrapper: report latency for each error is false and specific error codes to track for latency are: []
2023-06-29 17:43:41:978 0 sec: 1000 operations; 2347.42 current ops/sec; [CLEANUP: Count=1, Max=1827, Min=1827, Avg=1827, 90=1827, 99=1827, 99.9=1827, 99.99=1827] [INSERT: Count=1000, Max=18511, Min=20, Avg=99.3, 90=101, 99=510, 99.9=17919, 99.99=18511]
[OVERALL], RunTime(ms), 427
[OVERALL], Throughput(ops/sec), 2341.92037470726
[TOTAL_GCS_G1_Young_Generation], Count, 1
[TOTAL_GC_TIME_G1_Young_Generation], Time(ms), 17
[TOTAL_GC_TIME_%_G1_Young_Generation], Time(%), 3.9812646370023423
[TOTAL_GCS_G1_Old_Generation], Count, 0
[TOTAL_GC_TIME_G1_Old_Generation], Time(ms), 0
[TOTAL_GC_TIME_%_G1_Old_Generation], Time(%), 0.0
[TOTAL_GCs], Count, 1
[TOTAL_GC_TIME], Time(ms), 17
[TOTAL_GC_TIME_%], Time(%), 3.9812646370023423
[CLEANUP], Operations, 1
[CLEANUP], AverageLatency(us), 1827.0
[CLEANUP], MinLatency(us), 1827
[CLEANUP], MaxLatency(us), 1827
[CLEANUP], 95thPercentileLatency(us), 1827
[CLEANUP], 99thPercentileLatency(us), 1827
[INSERT], Operations, 1000
[INSERT], AverageLatency(us), 99.298
[INSERT], MinLatency(us), 20
[INSERT], MaxLatency(us), 18511
[INSERT], 95thPercentileLatency(us), 140
[INSERT], 99thPercentileLatency(us), 510
[INSERT], Return=OK, 1000


2. The main doubt I have is the step of setting up the database to run the workloads. I am unsure how I should do this for rocksdb.


3.  Also, in this link (https://github.com/brianfrankcooper/YCSB/tree/master/rocksdb), in the following step, I would like to know whether I need to create a new folder or is it any folder which can be created in rocksdb directory?

RocksDB Configuration Parameters

  • rocksdb.dir - (required) A path to a folder to hold the RocksDB data files.
    • EX. /tmp/ycsb-rocksdb-data
  • rocksdb.optionsfile - A path to a RocksDB options file.
    • EX. ycsb-rocksdb-options.ini


Reply all
Reply to author
Forward
0 new messages