From a83cd9f43938cfa1b1d01433e82523a64f2b8eb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20W=C3=BCnsche?= Date: Tue, 23 Jan 2024 17:20:20 +0100 Subject: [PATCH] benchmarks: improve README --- betree/haura-benchmarks/README.md | 35 ++++++++++++++ .../example_config/example-config.json | 47 +++++++++++++++++++ betree/haura-benchmarks/run.sh | 42 ++++++++--------- 3 files changed, 103 insertions(+), 21 deletions(-) create mode 100644 betree/haura-benchmarks/example_config/example-config.json diff --git a/betree/haura-benchmarks/README.md b/betree/haura-benchmarks/README.md index b85f68e1..c20018a9 100644 --- a/betree/haura-benchmarks/README.md +++ b/betree/haura-benchmarks/README.md @@ -7,3 +7,38 @@ This directory contains some additional tools and benchmarks which can be helpfu - `src/main.rs`: CLI to select and configure a benchmark, also spawns the sysinfo-log binary - `src/{ingest, rewrite, switchover, tiered1, zip, scientific_evaluation, filesystem, filesystem_zip, checkpoints}.rs`: Individual benchmarks - `run.sh`: Example usage, runs benchmarks with different configurations + +## Configuration + +All benchmark invocations can be seen in the `run.sh` script, which can be used +to create a custom benchmark run. Benchmarks are represented by their own +function you can uncomment at the bottom of the script. + +If you have followed the general scripts to setup `bectl` and `haura` in the +[documentation](https://parcio.github.io/haura/) you are good to go. Otherwise, +provide a configuration for the benchmarks either by pointing to a valid +configuration in the `BETREE_CONFIG` environment variable or by creating a +`perf-config.json` in the `haura-benchmarks` directory. A collection of example +configurations can be found in the `example_config` directory. + +``` sh +$ # EITHER +$ export BETREE_CONFIG= +$ # OR +$ cp example_config/example-config.json perf-config.json +``` + +Be sure to modify the example config, if chosen, to your desired specification. + + +## Running the benchmark + +If you have configured your benchmarks *and* chosen a configuration for Haura, +you can start the benchmark. If required for identification of multiple runs a +name can be given with each invocation which will be used in the stored results: + +``` sh +$ ./run.sh my-benchmark-run +``` + +After each individual benchmark an idle period of 1 minute is done by default. diff --git a/betree/haura-benchmarks/example_config/example-config.json b/betree/haura-benchmarks/example_config/example-config.json new file mode 100644 index 00000000..ace8b289 --- /dev/null +++ b/betree/haura-benchmarks/example_config/example-config.json @@ -0,0 +1,47 @@ +{ + "storage": { + "tiers": [ + { + "top_level_vdevs": [ + { + "mem": 4294967296 + } + ], + "preferred_access_type": "Unknown" + }, + { + "top_level_vdevs": [ + { + "path": "/tmp/example_disk", + "direct": true + } + ], + "preferred_access_type": "Unknown" + } + ], + "queue_depth_factor": 20, + "thread_pool_size": null, + "thread_pool_pinned": false + }, + "alloc_strategy": [ + [ + 0 + ], + [ + 0 + ], + [ + 0 + ], + [ + 0 + ] + ], + "default_storage_class": 0, + "compression": "None", + "cache_size": 268435456, + "access_mode": "AlwaysCreateNew", + "sync_interval_ms": null, + "migration_policy": null, + "metrics": null +} diff --git a/betree/haura-benchmarks/run.sh b/betree/haura-benchmarks/run.sh index 38859927..453aa48b 100755 --- a/betree/haura-benchmarks/run.sh +++ b/betree/haura-benchmarks/run.sh @@ -68,43 +68,43 @@ function run { function tiered() { ( export BETREE__ALLOC_STRATEGY='[[0],[0],[],[]]' - run "$VDEV_TYPE" tiered1_all0_alloc tiered1 + run "$RUN_IDENT" tiered1_all0_alloc tiered1 ) ( export BETREE__ALLOC_STRATEGY='[[0],[1],[],[]]' - run "$VDEV_TYPE" tiered1_id_alloc tiered1 + run "$RUN_IDENT" tiered1_id_alloc tiered1 ) ( export BETREE__ALLOC_STRATEGY='[[1],[1],[],[]]' - run "$VDEV_TYPE" tiered1_all1_alloc tiered1 + run "$RUN_IDENT" tiered1_all1_alloc tiered1 ) } function scientific_evaluation() { export BETREE__ALLOC_STRATEGY='[[0],[1],[],[]]' - run "$VDEV_TYPE" scientific_evaluation_id_alloc evaluation-read 30 + run "$RUN_IDENT" scientific_evaluation_id_alloc evaluation-read 30 } function evaluation_rw() { export BETREE__ALLOC_STRATEGY='[[0],[1],[],[]]' - run "$VDEV_TYPE" file_system_three evaluation-rw + run "$RUN_IDENT" file_system_three evaluation-rw } function filesystem_zip() { export BETREE__ALLOC_STRATEGY='[[0],[1],[2],[]]' - run "$VDEV_TYPE" file_system_three "$ZIP_ARCHIVE" + run "$RUN_IDENT" file_system_three "$ZIP_ARCHIVE" } function checkpoints() { export BETREE__ALLOC_STRATEGY='[[0, 1],[1],[],[]]' - run "$VDEV_TYPE" checkpoints_fastest checkpoints + run "$RUN_IDENT" checkpoints_fastest checkpoints } function filesystem() { export BETREE__ALLOC_STRATEGY='[[0],[1],[2],[]]' - run "$VDEV_TYPE" file_system_three filesystem + run "$RUN_IDENT" file_system_three filesystem } function zip_cache() { @@ -113,7 +113,7 @@ function zip_cache() { for cache_mib in 32 64 128 256 512 1024 2048 4096 8192; do ( export BETREE__CACHE_SIZE=$((cache_mib * 1024 * 1024)) - run "$VDEV_TYPE" "zip_cache_$cache_mib" zip 4 100 10 "$ZIP_ARCHIVE" "$F_CD_START" + run "$RUN_IDENT" "zip_cache_$cache_mib" zip 4 100 10 "$ZIP_ARCHIVE" "$F_CD_START" ) done } @@ -134,7 +134,7 @@ function zip_mt() { local per_worker=$((total / num_workers)) local per_run=$((per_worker / 10)) - run "$VDEV_TYPE" "zip_mt_${cache_mib}_${num_workers}_${per_run}_10" zip "$num_workers" "$per_run" 10 "$F" "$F_CD_START" + run "$RUN_IDENT" "zip_mt_${cache_mib}_${num_workers}_${per_run}_10" zip "$num_workers" "$per_run" 10 "$F" "$F_CD_START" done ) done @@ -159,17 +159,17 @@ function zip_tiered() { ( export BETREE__ALLOC_STRATEGY='[[0],[0],[],[]]' - run "$VDEV_TYPE" "zip_tiered_all0_${cache_mib}_${num_workers}_${per_run}_10" zip "$num_workers" "$per_run" 10 "$ZIP_ARCHIVE" "$F_CD_START" + run "$RUN_IDENT" "zip_tiered_all0_${cache_mib}_${num_workers}_${per_run}_10" zip "$num_workers" "$per_run" 10 "$ZIP_ARCHIVE" "$F_CD_START" ) ( export BETREE__ALLOC_STRATEGY='[[0],[1],[],[]]' - run "$VDEV_TYPE" "zip_tiered_id_${cache_mib}_${num_workers}_${per_run}_10" zip "$num_workers" "$per_run" 10 "$ZIP_ARCHIVE" "$F_CD_START" + run "$RUN_IDENT" "zip_tiered_id_${cache_mib}_${num_workers}_${per_run}_10" zip "$num_workers" "$per_run" 10 "$ZIP_ARCHIVE" "$F_CD_START" ) ( export BETREE__ALLOC_STRATEGY='[[1],[1],[],[]]' - run "$VDEV_TYPE" "zip_tiered_all1_${cache_mib}_${num_workers}_${per_run}_10" zip "$num_workers" "$per_run" 10 "$ZIP_ARCHIVE" "$F_CD_START" + run "$RUN_IDENT" "zip_tiered_all1_${cache_mib}_${num_workers}_${per_run}_10" zip "$num_workers" "$per_run" 10 "$ZIP_ARCHIVE" "$F_CD_START" ) done @@ -187,21 +187,21 @@ function ingest() { for level in $(seq 1 16); do ( export BETREE__COMPRESSION="{ Zstd = { level = $level } }" - run "$VDEV_TYPE" "ingest_hdd_zstd_$level" ingest "$ZIP_ARCHIVE" + run "$RUN_IDENT" "ingest_hdd_zstd_$level" ingest "$ZIP_ARCHIVE" ) done ) } function switchover() { - run "$VDEV_TYPE" switchover_tiny switchover 32 "$((32 * 1024 * 1024))" - run "$VDEV_TYPE" switchover_small switchover 8 "$((128 * 1024 * 1024))" - run "$VDEV_TYPE" switchover_medium switchover 4 "$((2 * 1024 * 1024 * 1024))" - run "$VDEV_TYPE" switchover_large switchover 4 "$((8 * 1024 * 1024 * 1024))" + run "$RUN_IDENT" switchover_tiny switchover 32 "$((32 * 1024 * 1024))" + run "$RUN_IDENT" switchover_small switchover 8 "$((128 * 1024 * 1024))" + run "$RUN_IDENT" switchover_medium switchover 4 "$((2 * 1024 * 1024 * 1024))" + run "$RUN_IDENT" switchover_large switchover 4 "$((8 * 1024 * 1024 * 1024))" } function ci() { - run "$VDEV_TYPE" switchover_small switchover 4 "$((128 * 1024 * 1024))" + run "$RUN_IDENT" switchover_small switchover 4 "$((128 * 1024 * 1024))" } cargo build --release @@ -215,7 +215,7 @@ export ROOT="$PWD" export ZIP_ARCHIVE="$PWD/data/linux.zip" # Category under which the default runs should be made, a function may modify # this if multiple categories are needed. -export VDEV_TYPE="default" +export RUN_IDENT="default" if [ "$1" == "-h" ] || [ "$1" == "--help" ] || [ "$1" = "help" ] then @@ -226,7 +226,7 @@ fi if [ -n "$*" ] then - export VDEV_TYPE=$* + export RUN_IDENT=$* fi ensure_bectl