From 53bb6932e5e3437b1a46b6ac23273f425be8c366 Mon Sep 17 00:00:00 2001 From: Renan Magagnin Date: Mon, 9 Dec 2024 09:54:03 +0000 Subject: [PATCH 1/5] Create seq_write_small.fio Signed-off-by: Renan Magagnin --- .../scripts/fio/write/seq_write_small.fio | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 mountpoint-s3/scripts/fio/write/seq_write_small.fio diff --git a/mountpoint-s3/scripts/fio/write/seq_write_small.fio b/mountpoint-s3/scripts/fio/write/seq_write_small.fio new file mode 100644 index 000000000..a87546d1b --- /dev/null +++ b/mountpoint-s3/scripts/fio/write/seq_write_small.fio @@ -0,0 +1,15 @@ +[global] +name=fs_bench +bs=256k +runtime=30s +time_based +group_reporting + +[sequential_write_small_file] +size=5m +rw=write +ioengine=sync +fallocate=none +create_on_open=1 +fsync_on_close=1 +unlink=1 From e7924defbf9e62fcca7095c450c79b8a55ce0679 Mon Sep 17 00:00:00 2001 From: Renan Magagnin Date: Tue, 10 Dec 2024 14:24:09 +0000 Subject: [PATCH 2/5] Change seq_write_small from throughput to latency benchmark Signed-off-by: Renan Magagnin --- .../fio/{write => write_latency}/seq_write_small.fio | 9 ++++----- mountpoint-s3/scripts/fs_latency_bench.sh | 10 ++++++++-- 2 files changed, 12 insertions(+), 7 deletions(-) rename mountpoint-s3/scripts/fio/{write => write_latency}/seq_write_small.fio (71%) diff --git a/mountpoint-s3/scripts/fio/write/seq_write_small.fio b/mountpoint-s3/scripts/fio/write_latency/seq_write_small.fio similarity index 71% rename from mountpoint-s3/scripts/fio/write/seq_write_small.fio rename to mountpoint-s3/scripts/fio/write_latency/seq_write_small.fio index a87546d1b..b316279da 100644 --- a/mountpoint-s3/scripts/fio/write/seq_write_small.fio +++ b/mountpoint-s3/scripts/fio/write_latency/seq_write_small.fio @@ -1,15 +1,14 @@ [global] name=fs_bench -bs=256k -runtime=30s -time_based -group_reporting +bs=1B [sequential_write_small_file] -size=5m +size=1B rw=write ioengine=sync fallocate=none create_on_open=1 fsync_on_close=1 unlink=1 +unlink_each_loop=1 +loops=10 diff --git a/mountpoint-s3/scripts/fs_latency_bench.sh b/mountpoint-s3/scripts/fs_latency_bench.sh index 439b33461..bcf24a3a9 100755 --- a/mountpoint-s3/scripts/fs_latency_bench.sh +++ b/mountpoint-s3/scripts/fs_latency_bench.sh @@ -127,8 +127,9 @@ do done -# start time to first byte benchmark -jobs_dir=mountpoint-s3/scripts/fio/read_latency +run_start_time_to_first_byte_benchmarks() { + category=$1 + jobs_dir=mountpoint-s3/scripts/fio/${category}_latency for job_file in "${jobs_dir}"/*.fio; do mount_dir=$(mktemp -d /tmp/fio-XXXXXXXXXXXX) job_name=$(basename "${job_file}") @@ -183,7 +184,12 @@ for job_file in "${jobs_dir}"/*.fio; do # delete the raw output file from fio rm ${results_dir}/${job_name}.json + done +} + +run_start_time_to_first_byte_benchmarks read +run_start_time_to_first_byte_benchmarks write # combine all bench results into one json file jq -n '[inputs]' ${results_dir}/*.json | tee ${results_dir}/output.json From e77e680348e903706acf535172932b661b8f2217 Mon Sep 17 00:00:00 2001 From: Renan Magagnin Date: Tue, 10 Dec 2024 16:04:21 +0000 Subject: [PATCH 3/5] Improve naming of benchmark and script function Signed-off-by: Renan Magagnin --- .../scripts/fio/write_latency/seq_write_small.fio | 2 +- mountpoint-s3/scripts/fs_latency_bench.sh | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/mountpoint-s3/scripts/fio/write_latency/seq_write_small.fio b/mountpoint-s3/scripts/fio/write_latency/seq_write_small.fio index b316279da..fa4b2a76a 100644 --- a/mountpoint-s3/scripts/fio/write_latency/seq_write_small.fio +++ b/mountpoint-s3/scripts/fio/write_latency/seq_write_small.fio @@ -2,7 +2,7 @@ name=fs_bench bs=1B -[sequential_write_small_file] +[time_to_write_one_byte_file] size=1B rw=write ioengine=sync diff --git a/mountpoint-s3/scripts/fs_latency_bench.sh b/mountpoint-s3/scripts/fs_latency_bench.sh index bcf24a3a9..74d4a379f 100755 --- a/mountpoint-s3/scripts/fs_latency_bench.sh +++ b/mountpoint-s3/scripts/fs_latency_bench.sh @@ -126,8 +126,7 @@ do dir_size=$(awk "BEGIN {print $dir_size*10}") done - -run_start_time_to_first_byte_benchmarks() { +run_file_benchmarks() { category=$1 jobs_dir=mountpoint-s3/scripts/fio/${category}_latency for job_file in "${jobs_dir}"/*.fio; do @@ -188,8 +187,8 @@ for job_file in "${jobs_dir}"/*.fio; do done } -run_start_time_to_first_byte_benchmarks read -run_start_time_to_first_byte_benchmarks write +run_file_benchmarks read +run_file_benchmarks write # combine all bench results into one json file jq -n '[inputs]' ${results_dir}/*.json | tee ${results_dir}/output.json From 81c79aaa75fd35414196bbdfaf726c81de711402 Mon Sep 17 00:00:00 2001 From: Renan Magagnin Date: Tue, 10 Dec 2024 16:11:17 +0000 Subject: [PATCH 4/5] Adjust benchmark file name Signed-off-by: Renan Magagnin --- .../{seq_write_small.fio => time_to_write_one_byte_file.fio} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename mountpoint-s3/scripts/fio/write_latency/{seq_write_small.fio => time_to_write_one_byte_file.fio} (100%) diff --git a/mountpoint-s3/scripts/fio/write_latency/seq_write_small.fio b/mountpoint-s3/scripts/fio/write_latency/time_to_write_one_byte_file.fio similarity index 100% rename from mountpoint-s3/scripts/fio/write_latency/seq_write_small.fio rename to mountpoint-s3/scripts/fio/write_latency/time_to_write_one_byte_file.fio From 06b3fac3a5f990e0457d30a7571cf3655a3a7061 Mon Sep 17 00:00:00 2001 From: Renan Magagnin Date: Tue, 10 Dec 2024 17:13:21 +0000 Subject: [PATCH 5/5] Improve formatting in run_file_benchmarks() Signed-off-by: Renan Magagnin --- mountpoint-s3/scripts/fs_latency_bench.sh | 111 +++++++++++----------- 1 file changed, 56 insertions(+), 55 deletions(-) diff --git a/mountpoint-s3/scripts/fs_latency_bench.sh b/mountpoint-s3/scripts/fs_latency_bench.sh index 74d4a379f..c5803509d 100755 --- a/mountpoint-s3/scripts/fs_latency_bench.sh +++ b/mountpoint-s3/scripts/fs_latency_bench.sh @@ -129,62 +129,63 @@ done run_file_benchmarks() { category=$1 jobs_dir=mountpoint-s3/scripts/fio/${category}_latency -for job_file in "${jobs_dir}"/*.fio; do - mount_dir=$(mktemp -d /tmp/fio-XXXXXXXXXXXX) - job_name=$(basename "${job_file}") - job_name="${job_name%.*}" - - log_dir=logs/${job_name} - mkdir -p $log_dir - - echo "Running ${job_name}" - - # mount file system - cargo run --release ${S3_BUCKET_NAME} ${mount_dir} \ - --allow-delete \ - --allow-overwrite \ - --log-directory=$log_dir \ - --prefix=${S3_BUCKET_TEST_PREFIX} \ - --log-metrics \ - ${optional_args} - mount_status=$? - if [ $mount_status -ne 0 ]; then - echo "Failed to mount file system" - exit 1 - fi - - # Lay out files for the test: - echo >&2 Laying out files for $job_file - fio --thread \ - --directory=${mount_dir} \ - --create_only=1 \ - --eta=never \ - ${job_file} - - # run the benchmark - echo >&2 Running $job_file - timeout 300s fio --thread \ - --output=${results_dir}/${job_name}.json \ - --output-format=json \ - --directory=${mount_dir} \ - ${job_file} - job_status=$? - if [ $job_status -ne 0 ]; then - tail -1000 ${log_dir}/mountpoint-s3-* - echo "Job ${job_name} failed with exit code ${job_status}" - exit 1 - fi - - jq -n 'inputs.jobs[] | if (."job options".rw == "read") - then {name: .jobname, value: (.read.lat_ns.mean / 1000000), unit: "milliseconds"} - elif (."job options".rw == "randread") then {name: .jobname, value: (.read.lat_ns.mean / 1000000), unit: "milliseconds"} - elif (."job options".rw == "randwrite") then {name: .jobname, value: (.write.lat_ns.mean / 1000000), unit: "milliseconds"} - else {name: .jobname, value: (.write.lat_ns.mean / 1000000), unit: "milliseconds"} end' ${results_dir}/${job_name}.json | tee ${results_dir}/${job_name}_parsed.json - - # delete the raw output file from fio - rm ${results_dir}/${job_name}.json + + for job_file in "${jobs_dir}"/*.fio; do + mount_dir=$(mktemp -d /tmp/fio-XXXXXXXXXXXX) + job_name=$(basename "${job_file}") + job_name="${job_name%.*}" -done + log_dir=logs/${job_name} + mkdir -p $log_dir + + echo "Running ${job_name}" + + # mount file system + cargo run --release ${S3_BUCKET_NAME} ${mount_dir} \ + --allow-delete \ + --allow-overwrite \ + --log-directory=$log_dir \ + --prefix=${S3_BUCKET_TEST_PREFIX} \ + --log-metrics \ + ${optional_args} + mount_status=$? + if [ $mount_status -ne 0 ]; then + echo "Failed to mount file system" + exit 1 + fi + + # Lay out files for the test: + echo >&2 Laying out files for $job_file + fio --thread \ + --directory=${mount_dir} \ + --create_only=1 \ + --eta=never \ + ${job_file} + + # run the benchmark + echo >&2 Running $job_file + timeout 300s fio --thread \ + --output=${results_dir}/${job_name}.json \ + --output-format=json \ + --directory=${mount_dir} \ + ${job_file} + job_status=$? + if [ $job_status -ne 0 ]; then + tail -1000 ${log_dir}/mountpoint-s3-* + echo "Job ${job_name} failed with exit code ${job_status}" + exit 1 + fi + + jq -n 'inputs.jobs[] | if (."job options".rw == "read") + then {name: .jobname, value: (.read.lat_ns.mean / 1000000), unit: "milliseconds"} + elif (."job options".rw == "randread") then {name: .jobname, value: (.read.lat_ns.mean / 1000000), unit: "milliseconds"} + elif (."job options".rw == "randwrite") then {name: .jobname, value: (.write.lat_ns.mean / 1000000), unit: "milliseconds"} + else {name: .jobname, value: (.write.lat_ns.mean / 1000000), unit: "milliseconds"} end' ${results_dir}/${job_name}.json | tee ${results_dir}/${job_name}_parsed.json + + # delete the raw output file from fio + rm ${results_dir}/${job_name}.json + + done } run_file_benchmarks read