Skip to content

Benchmark results in GCP VM

Aaron Riekenberg edited this page Feb 7, 2023 · 16 revisions

Setup

Results in Google Cloud (GCP) VM using JDK 17. Running on n1-standard-32 VM (32 CPUs, 120GB RAM), CentOS 7.

In the OffHeapGetPutBenchmark test NMA and RocksDB are populated with 50,000 byte array values of size 100KB each (5GB of data)

The keys are the strings "0" - "49999"

In NMA tests data is not persisted on disk.

Command to build JMH fat-jar:

./gradlew clean jmhJar

JMH Configuration:

# JMH version: 1.35
# VM version: JDK 17.0.6, Java HotSpot(TM) 64-Bit Server VM, 17.0.6+9-LTS-190
# VM invoker: /home/bastion/jdk-17.0.6/bin/java
# VM options: -Xmx4G -Drocksdb.dir=/tmp/tmpfs/rocksdb
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 10 iterations, 10 s each
# Measurement: 20 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 32 threads, will synchronize iterations
# Benchmark mode: Throughput, ops/time

For RocksDB create a 10GB tmpfs mount:

mkdir /tmp/tmpfs
mount -t tmpfs -o size=10G tmpfs /tmp/tmpfs/

Results

1. Read-only benchmark with 32 threads

Run Command:

java -jar ./benchmarks-jmh.jar -wi 10 -i 20 -f 1 -gc true -foe true -tg 32 -jvmArgs '-Xmx4G -Drocksdb.dir=/tmp/tmpfs/rocksdb' read_only

JMH Output:

Benchmark                         (cacheType)   Mode  Cnt       Score       Error  Units
OffHeapGetPutBenchmark.read_only          NMA  thrpt   20  956848.673 ± 26026.607  ops/s
OffHeapGetPutBenchmark.read_only      RocksDB  thrpt   20  117913.445 ±   697.106  ops/s

2. Write-only benchmark with 32 threads

Run Command:

java -jar ./benchmarks-jmh.jar -wi 10 -i 20 -f 1 -gc true -foe true -tg 32 -jvmArgs '-Xmx4G -Drocksdb.dir=/tmp/tmpfs/rocksdb' write_only

JMH Output:

Benchmark                          (cacheType)   Mode  Cnt       Score      Error  Units
OffHeapGetPutBenchmark.write_only          NMA  thrpt   20  178040.420 ± 2233.948  ops/s
OffHeapGetPutBenchmark.write_only      RocksDB  thrpt   20    2584.361 ±  484.602  ops/s

3. Read and write benchmark with 32 threads (24 read threads, 8 write threads)

Run Command:

java -jar ./benchmarks-jmh.jar -wi 10 -i 20 -f 1 -gc true -foe true -tg 24,8 -jvmArgs '-Xmx4G -Drocksdb.dir=/tmp/tmpfs/rocksdb'   readwrite

JMH Output:

Benchmark                                       (cacheType)   Mode  Cnt       Score       Error  Units
OffHeapGetPutBenchmark.readwrite                        NMA  thrpt   20  523658.868 ± 17041.978  ops/s
OffHeapGetPutBenchmark.readwrite:readwrite_get          NMA  thrpt   20  453740.362 ± 15160.647  ops/s
OffHeapGetPutBenchmark.readwrite:readwrite_put          NMA  thrpt   20   69918.506 ±  2055.057  ops/s
OffHeapGetPutBenchmark.readwrite                    RocksDB  thrpt   20  100642.780 ± 16556.694  ops/s
OffHeapGetPutBenchmark.readwrite:readwrite_get      RocksDB  thrpt   20   99192.827 ± 16332.061  ops/s
OffHeapGetPutBenchmark.readwrite:readwrite_put      RocksDB  thrpt   20    1449.953 ±   371.341  ops/s