All Projects → pmem → pmemkv-bench

pmem / pmemkv-bench

Licence: other
Benchmarking tools for pmemkv

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
groovy
2714 projects
shell
77523 projects
Makefile
30231 projects
c
50402 projects - #5 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to pmemkv-bench

pmemkv-java
Java bindings for pmemkv
Stars: ✭ 28 (+47.37%)
Mutual labels:  pmem, pmdk, pmemkv
aeon
AEON is an In-place file system designed for non-volatile memories.
Stars: ✭ 13 (-31.58%)
Mutual labels:  pmem
valgrind
Enhanced Valgrind for Persistent Memory
Stars: ✭ 85 (+347.37%)
Mutual labels:  pmem
llpl
Low Level Persistence Library
Stars: ✭ 95 (+400%)
Mutual labels:  pmdk

pmemkv-bench

.github/workflows/main.yml PMEMKV-BENCH version Language grade: Python

Benchmark for libpmemkv and its underlying libraries, based on leveldb's db_bench.

The pmemkv_bench utility provides some standard read, write & remove benchmarks. It's based on the db_bench utility included with LevelDB and RocksDB, although the list of supported parameters is slightly different.

We always try to improve this benchmark and keep it up-to-date with libpmemkv. Please don't fully rely on API and the results produced by this tool. If you have any questions, improvement ideas or you found a bug, please file a report in the issues tab. Contributions are also welcome - take a look at our CONTRIBUTING.md.

Note:

It is the user's responsibility to clear/remove DB (e.g. using pmempool rm). So running bench with --benchmarks=fillseq,fillrandom might have different results than running with --benchmarks=fillseq, removing DB and running bench one more time with --benchmarks--fillrandom, because in the first case fillrandom writes to the already filled DB.

Table of contents

  1. Build
  2. Execute
  3. Contact us

Build

Prerequisites

  • Linux 64-bit (OSX and Windows are not yet supported)
  • libpmemkv - library tested in this benchmark; currently version from master branch is required
  • libpmempool, which is part of PMDK - tool to manage persistent pools
  • python3 - for executing additional python scripts (and tests)
  • Used only for development:
    • clang-format-11 - to format and check cpp coding style, version 11 is required
    • black 21.4b2 - to format and check python coding style, version 21.4b2 is required

See our Dockerfile (used e.g. on our CI system) to get an idea what packages are required to build and run pmemkv-bench.

Setting up environment

Makefile tries to find required packages (especially libpmemkv and libpmempool) using pkg-config. If dependencies are not installed in the system PKG_CONFIG_PATH variable has to be set to point to .pc files.

For execution, additionally LD_LIBRARY_PATH variable should be set to the directory which contains libpmemkv.so.1 file, e.g.:

export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:</path/to/libpmemkv/pkgconfig/dir>
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:</path/to/libpmemkv/lib/dir>

Compile

To build pmemkv_bench, you can simple run:

make bench

Execute

To simply run pmemkv-bench on DRAM:

PMEM_IS_PMEM_FORCE=1 ./pmemkv_bench --db=/dev/shm/pmemkv --db_size_in_gb=1

or using make command (with custom testing path):

make run_bench [ KV_BENCH_TEST_PATH=<test_path> ]

Alternatively you can run building selected version of pmemkv (and required by it a libpmemobj-cpp library) and run benchmark scenarios using python script (available in project's root directory):

python3 run_benchmark.py <build_config_file> <bench_scenarios_file>

Example usage of this script is also shown in one of our tests.

Various Pools

Benchmarking on filesystem DAX (fsdax, mounted e.g. on /mnt/pmem):

./pmemkv_bench --db=/mnt/pmem/pmemkv --db_size_in_gb=1

Benchmarking on device DAX (dev-dax):

./pmemkv_bench --db=/dev/dax1.0

Benchmarking with poolset (to read more, see PMDK's manpage poolset(5)):

./pmemkv_bench --db=~/pmemkv.poolset

Remember:

The pmemkv-bench won't clear the pool passed in --db parameter on start or at finish. It is the user's responsibility to clear it if desired.

Runtime Parameters

All of supported pmemkv-bench's parameters are described in command's help (see it e.g. in bench's sources).

Nonetheless, the most important runtime parameters are:

--engine=<name>            (storage engine name, default: cmap)
--db=<location>            (path to persistent pool, default: /dev/shm/pmemkv_test_db)
                           (note: file on DAX filesystem, DAX device, or poolset file)
--db_size_in_gb=<integer>  (size of persistent pool to create in GiB, default: 0)
                           (note: for existing poolset or device DAX configs use 0 or leave default value)
                           (note: when pool path is non-existing, value should be > 0)
--histogram=<0|1>          (show histograms when reporting latencies)
--num=<integer>            (number of keys to place in database, default: 1000000)
--reads=<integer>          (number of read operations, default: 1000000)
--threads=<integer>        (number of concurrent threads, default: 1)
--key_size=<integer>       (size of keys in bytes, default: 16)
--value_size=<integer>     (size of values in bytes, default: 100)
--benchmarks=<name>,       (comma-separated list of benchmarks to run)
    fillseq                (load N values in sequential key order)
    fillrandom             (load N values in random key order)
    readseq                (read N values in sequential key order)
    readrandom             (read N values in random key order)
    readmissing            (read N missing values in random key order)
    deleteseq              (delete N values in sequential key order)
    deleterandom           (delete N values in random key order)
    readwhilewriting       (1 writer, N threads doing random reads)
    readrandomwriterandom  (N threads doing random-read, random-write)

To run the equivalent of "overwrite" benchmark, run fillrandom on already filled DB.

Contact us

For more information about pmemkv or pmemkv-bench, contact Igor Chorążewicz ([email protected]), Piotr Balcer ([email protected]) or post on our #pmem Slack channel using this invite link or Google group.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].