From b5d391f18fd0911e6b97b073b39b826c9cc46458 Mon Sep 17 00:00:00 2001 From: David Esparza Date: Tue, 10 Oct 2023 14:08:33 -0600 Subject: [PATCH] metrics: update iodepth and job size fio parameters to improve workload This PR updates the values of the fio parameters for iodepth requests and for the number of jobs, in order to increase the number of sequential operations. Additionally, it adds the list of packages needed to parse the results. Fixes: #8198 Signed-off-by: David Esparza (cherry picked from commit 873386a349de28e6c566e3c036f2a593d5b0d79d) --- .../storage/fio-dockerfile/workload/fio_bench.sh | 4 ++-- tests/metrics/storage/fio_test.sh | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/metrics/storage/fio-dockerfile/workload/fio_bench.sh b/tests/metrics/storage/fio-dockerfile/workload/fio_bench.sh index 43aed0136e..bf62e40f19 100755 --- a/tests/metrics/storage/fio-dockerfile/workload/fio_bench.sh +++ b/tests/metrics/storage/fio-dockerfile/workload/fio_bench.sh @@ -16,13 +16,13 @@ set -o pipefail # read, write, randread, randwrite, randrw, readwrite io_type="read" block_size="4k" -num_jobs="2" +num_jobs="4" # FIO default settings readonly ioengine="libaio" readonly rate_process="linear" readonly disable_buffered="1" -readonly iodepth="2" +readonly iodepth="8" readonly runtime="10s" # ramp time readonly rt="10s" diff --git a/tests/metrics/storage/fio_test.sh b/tests/metrics/storage/fio_test.sh index 7ea7deb8e9..91ebca5373 100755 --- a/tests/metrics/storage/fio_test.sh +++ b/tests/metrics/storage/fio_test.sh @@ -18,6 +18,7 @@ IMAGE="docker.io/library/fio-bench:latest" DOCKERFILE="${SCRIPT_PATH}/fio-dockerfile/Dockerfile" PAYLOAD_ARGS="${PAYLOAD_ARGS:-tail -f /dev/null}" TEST_NAME="fio" +REQUIRED_CMDS=("jq" "script") # Fio default number of jobs nj=4 @@ -34,7 +35,7 @@ trap release_resources EXIT function setup() { info "setup fio test" clean_env_ctr - check_cmds "${cmds[@]}" + check_cmds "${REQUIRED_CMDS[@]}" check_ctr_images "$IMAGE" "$DOCKERFILE" init_env @@ -135,21 +136,21 @@ function main() { # Collect bs=4K, num_jobs=4, io-direct, io-depth=2 info "Processing sequential type workload" sudo -E "${CTR_EXE}" t exec --exec-id "${RANDOM}" ${CONTAINER_ID} sh -c "./fio_bench.sh run-read-4k ${nj}" >/dev/null 2>&1 - local results_read_4K="$(sudo -E "${CTR_EXE}" t exec -t --exec-id "${RANDOM}" ${CONTAINER_ID} sh -c "./fio_bench.sh print-latest-results")" + local results_read_4K="$(script -qc "sudo -E ${CTR_EXE} t exec -t --exec-id ${RANDOM} ${CONTAINER_ID} sh -c './fio_bench.sh print-latest-results'")" sleep 0.5 sudo -E "${CTR_EXE}" t exec --exec-id "${RANDOM}" ${CONTAINER_ID} sh -c "./fio_bench.sh run-write-4k ${nj}" >/dev/null 2>&1 - local results_write_4K="$(sudo -E "${CTR_EXE}" t exec -t --exec-id "${RANDOM}" ${CONTAINER_ID} sh -c "./fio_bench.sh print-latest-results")" + local results_write_4K="$(script -qc "sudo -E ${CTR_EXE} t exec -t --exec-id ${RANDOM} ${CONTAINER_ID} sh -c './fio_bench.sh print-latest-results'")" # Collect bs=64K, num_jobs=4, io-direct, io-depth=2 info "Processing random type workload" sleep 0.5 sudo -E "${CTR_EXE}" t exec --exec-id "${RANDOM}" ${CONTAINER_ID} sh -c "./fio_bench.sh run-randread-64k ${nj}" >/dev/null 2>&1 - local results_rand_read_64K="$(sudo -E "${CTR_EXE}" t exec -t --exec-id "${RANDOM}" ${CONTAINER_ID} sh -c "./fio_bench.sh print-latest-results")" + local results_rand_read_64K="$(script -qc "sudo -E ${CTR_EXE} t exec -t --exec-id ${RANDOM} ${CONTAINER_ID} sh -c './fio_bench.sh print-latest-results'")" sleep 0.5 sudo -E "${CTR_EXE}" t exec --exec-id "${RANDOM}" ${CONTAINER_ID} sh -c "./fio_bench.sh run-randwrite-64k ${nj}" >/dev/null 2>&1 - local results_rand_write_64K="$(sudo -E "${CTR_EXE}" t exec -t --exec-id "${RANDOM}" ${CONTAINER_ID} sh -c "./fio_bench.sh print-latest-results")" + local results_rand_write_64K="$(script -qc "sudo -E ${CTR_EXE} t exec -t --exec-id ${RANDOM} ${CONTAINER_ID} sh -c './fio_bench.sh print-latest-results'")" # parse results metrics_json_init