Skip to content

Benchmarking

Cuong Nguyen edited this page Sep 4, 2022 · 31 revisions

Run a benchmark

You can run different kinds of workload with the benchmarking tool. For available workloads, see the latest code in benchmark.cpp. The parameters of a workload can be found near the beginning of its source code in the workload directory (example). When the benchmark finishes, csv files containing data to be analyzed later will be created in the directory specified with -out-dir flag. A benchmark can be run with closed-loop clients or with constant sending rate.

Closed-loop clients

In this mode, the benchmark spawns a set of parallel clients. Each client sends transactions in such a way that it does not send a new transaction until it receives the response for the one it's just sent. This running mode is used when the -duration and -clients arguments are specified. If the number of generated transactions specified with the -txns is positive (default is 100), the transactions will be pre-generated and looped over until the end of the benchmarking duration; if it is set to 0, the transactions are generated on-the-fly.

For example:

build/benchmark -config slog.conf -duration 10 -clients 5 -txns 100 -wl basic -params="mh=50,records=10" -out-dir .

This command starts a benchmark which runs for 10 seconds using 5 clients with the "basic" workload, 50% chance of a transaction being multi-home, and each transaction has 10 records. Each client will pre-generate 100 transactions and loop through these transactions until the end of the duration.

In the above example, all clients run on a single thread. To use more threads, specify the number of threads with the -generators argument.

Sending at constant rate

In this mode, the benchmark sends transactions at a constant rate regardless of the processing speed of the system. This running mode is used when the -rate argument is used. Additionally, if -duration is not zero, the benchmark runs until the end of the duration, otherwise, it sends as many transactions as specified with the -txns flag.

For example:

build/benchmark -config slog.conf -rate 200 -duration 0 -txns 10000 -wl basic -params="mh=0,mp=100,records=10" -out-dir .

This command starts a benchmark that sends 10000 transactions at the rate of 200 txns per second. The "basic" workload is used with only single-home and multi-partition transactions, and each transaction has 10 records.

Again, the -generators can be used to run the benchmark with more threads.

Clone this wiki locally