From bb1cca522faa850d4d9b2e656b8f19a2caf0ac8c Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Tue, 28 Sep 2021 13:26:09 -0400 Subject: [PATCH] Revamp benchmark tests 1. Move to a time-based (60s) benchmark to avoid these taking an absurd amount of time to show the same information. 2. Eliminate the 256k random benchmarks, since they don't really add anything. 3. Add in a 4k single-queue benchmark as this might provide valuable insight into latency. 4. Adjust the output to reflect the above changes. While this does change the benchmarking, this should not invalidate any existing benchmarks since most of the test suit is unchanged (especially the most important 4M sequential and 4K random tests). It simply removes an unused entry and adds a more helpful one. The time-based change should not significantly affect the results either, just reduces the total runtime for long-tests and increase the runtime for quick tests to provide a better picture. --- api-daemon/pvcapid/benchmark.py | 45 ++++++++++++++++++++------------- client-cli/pvc/cli_lib/ceph.py | 19 +++++++++++--- client-cli/pvc/pvc.py | 2 +- 3 files changed, 45 insertions(+), 21 deletions(-) diff --git a/api-daemon/pvcapid/benchmark.py b/api-daemon/pvcapid/benchmark.py index 6c9d7b6c..dcec62a1 100755 --- a/api-daemon/pvcapid/benchmark.py +++ b/api-daemon/pvcapid/benchmark.py @@ -171,66 +171,77 @@ def run_benchmark(self, pool): test_matrix = { 'seq_read': { 'direction': 'read', + 'iodepth': '64', 'bs': '4M', 'rw': 'read' }, 'seq_write': { 'direction': 'write', + 'iodepth': '64', 'bs': '4M', 'rw': 'write' }, 'rand_read_4M': { 'direction': 'read', + 'iodepth': '64', 'bs': '4M', 'rw': 'randread' }, 'rand_write_4M': { 'direction': 'write', + 'iodepth': '64', 'bs': '4M', 'rw': 'randwrite' }, - 'rand_read_256K': { - 'direction': 'read', - 'bs': '256K', - 'rw': 'randread' - }, - 'rand_write_256K': { - 'direction': 'write', - 'bs': '256K', - 'rw': 'randwrite' - }, 'rand_read_4K': { 'direction': 'read', + 'iodepth': '64', 'bs': '4K', 'rw': 'randread' }, 'rand_write_4K': { 'direction': 'write', + 'iodepth': '64', 'bs': '4K', 'rw': 'randwrite' - } + }, + 'rand_read_4K_lowdepth': { + 'direction': 'read', + 'iodepth': '1', + 'bs': '4K', + 'rw': 'randread' + }, + 'rand_write_4K_lowdepth': { + 'direction': 'write', + 'iodepth': '1', + 'bs': '4K', + 'rw': 'randwrite' + }, } parsed_results = dict() for test in test_matrix: print("Running test '{}'".format(test)) fio_cmd = """ fio \ - --output-format=terse \ - --terse-version=5 \ + --name={test} \ --ioengine=rbd \ --pool={pool} \ --rbdname={volume} \ + --output-format=terse \ + --terse-version=5 \ --direct=1 \ --randrepeat=1 \ - --iodepth=64 \ - --size=8G \ - --name={test} \ + --iodepth={iodepth} \ + --numjobs=1 \ + --time_based \ + --runtime=60 \ --bs={bs} \ --readwrite={rw} """.format( + test=test, pool=pool, volume=volume, - test=test, + iodepth=test_matrix[test]['iodepth'], bs=test_matrix[test]['bs'], rw=test_matrix[test]['rw']) diff --git a/client-cli/pvc/cli_lib/ceph.py b/client-cli/pvc/cli_lib/ceph.py index f5b3273d..2f8b1ddc 100644 --- a/client-cli/pvc/cli_lib/ceph.py +++ b/client-cli/pvc/cli_lib/ceph.py @@ -1606,10 +1606,10 @@ def format_info_benchmark(config, benchmark_information): "seq_write": "Sequential Write (4M blocks)", "rand_read_4M": "Random Read (4M blocks)", "rand_write_4M": "Random Write (4M blocks)", - "rand_read_256K": "Random Read (256K blocks)", - "rand_write_256K": "Random Write (256K blocks)", "rand_read_4K": "Random Read (4K blocks)", - "rand_write_4K": "Random Write (4K blocks)" + "rand_write_4K": "Random Write (4K blocks)", + "rand_read_4K_lowdepth": "Random Read (4K blocks, single-queue)", + "rand_write_4K_lowdepth": "Random Write (4K blocks, single-queue)", } test_name_length = 30 @@ -1622,7 +1622,16 @@ def format_info_benchmark(config, benchmark_information): cpuutil_label_length = 11 cpuutil_column_length = 9 + # Work around old results that did not have these tests + if 'rand_read_4K_lowdepth' not in benchmark_details: + del nice_test_name_map['rand_read_4K_lowdepth'] + del nice_test_name_map['rand_write_4K_lowdepth'] + for test in benchmark_details: + # Work around old results that had these obsolete tests + if test == 'rand_read_256K' or test == 'rand_write_256K': + continue + _test_name_length = len(nice_test_name_map[test]) if _test_name_length > test_name_length: test_name_length = _test_name_length @@ -1659,6 +1668,10 @@ def format_info_benchmark(config, benchmark_information): cpuutil_column_length = _element_length for test in benchmark_details: + # Work around old results that had these obsolete tests + if test == 'rand_read_256K' or test == 'rand_write_256K': + continue + ainformation.append('') test_details = benchmark_details[test] diff --git a/client-cli/pvc/pvc.py b/client-cli/pvc/pvc.py index 3dd1e738..297eb6f4 100755 --- a/client-cli/pvc/pvc.py +++ b/client-cli/pvc/pvc.py @@ -2526,7 +2526,7 @@ def ceph_benchmark_run(pool): Run a storage benchmark on POOL in the background. """ try: - click.confirm('NOTE: Storage benchmarks generate significant load on the cluster and can take a very long time to complete on slow storage. They should be run sparingly. Continue', prompt_suffix='? ', abort=True) + click.confirm('NOTE: Storage benchmarks take approximately 8 minutes to run and generate significant load on the storage cluster; they should be run sparingly. Continue', prompt_suffix='? ', abort=True) except Exception: exit(0)