Skip to content

Commit

Permalink
Adding more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
vibhansa-msft committed Mar 1, 2024
1 parent fc57550 commit 134a41c
Show file tree
Hide file tree
Showing 15 changed files with 207 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/perftest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
id-token: write
contents: write
pages: write

steps:
# Print the host info
- name: 'Host info'
Expand Down
77 changes: 67 additions & 10 deletions benchmark/fio_bench.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
#!/bin/bash
set -e

output="./results_bandwidth"
# Each test will be performed 3 times
iterations=3
mount_dir=$1

rm -rf ./blobfuse2.log
rm -rf ${output}
mkdir -p ${output}
chmod 777 ${output}
# Mount path for blobfuse is supplied on command line while executing this script
mount_dir=$1

mount_blobfuse
rm -rf ${mount_dir}/*
./blobfuse2 unmount all
# Directory where output logs will be generated by fio
output="./results_bandwidth"

# --------------------------------------------------------------------------------------------------
# Method to mount blobfuse and wait for system to stablize

Check failure on line 14 in benchmark/fio_bench.sh

View workflow job for this annotation

GitHub Actions / Check for spelling errors

stablize ==> stabilize
mount_blobfuse() {
set +e

./blobfuse2 mount ${mount_dir} --config-file=./config.yaml
mount_status=$?
set -e
if [ $mount_status -ne 0 ]; then
echo "Failed to mount file system"
exit 1
fi

# Wait for daemon to come up and stablise
sleep 3
}

# --------------------------------------------------------------------------------------------------
# Method to execute fio command for a given config file and generate summary result
execute_test() {
job_file=$1
bench_file=$2
Expand All @@ -40,13 +43,15 @@ execute_test() {
do
echo -n "${i};"
set +e

timeout 300s fio --thread \
--output=${output}/${job_name}trial${i}.json \
--output-format=json \
--directory=${mount_dir} \
--filename=${bench_file}${i} \
--eta=never \
${job_file}

job_status=$?
set -e
if [ $job_status -ne 0 ]; then
Expand All @@ -55,13 +60,16 @@ execute_test() {
fi
done

# From the fio output get the bandwidth details and put it in a summary file
jq -n 'reduce inputs.jobs[] as $job (null; .name = $job.jobname | .len += 1 | .value += (if ($job."job options".rw == "read")
then $job.read.bw / 1024
elif ($job."job options".rw == "randread") then $job.read.bw / 1024
elif ($job."job options".rw == "randwrite") then $job.write.bw / 1024
else $job.write.bw / 1024 end)) | {name: .name, value: (.value / .len), unit: "MiB/s"}' ${output}/${job_name}trial*.json | tee ${output}/${job_name}_summary.json
}

# --------------------------------------------------------------------------------------------------
# Method to execute read benchmark using fio over different fio config files
read_fio_benchmark () {
jobs_dir=./benchmark/fio_read_config

Expand All @@ -79,6 +87,8 @@ read_fio_benchmark () {
done
}

# --------------------------------------------------------------------------------------------------
# Method to execute write benchmark using fio over different fio config files
write_fio_benchmark () {
jobs_dir=./benchmark/fio_write_config

Expand All @@ -96,8 +106,55 @@ write_fio_benchmark () {
done
}

# --------------------------------------------------------------------------------------------------
# Method to execute multi threaded benchmark using fio over different fio config files
multi_threaded_fio_benchmark () {
jobs_dir=./benchmark/fio_multi_threaded

for job_file in "${jobs_dir}"/*.fio; do
job_name=$(basename "${job_file}")
job_name="${job_name%.*}"

echo "Running Write benchmark for ${job_name}"
mount_blobfuse

execute_test $job_file ${job_name}.dat

./blobfuse2 unmount all
sleep 5
done
}

# --------------------------------------------------------------------------------------------------
# Method to prepare the system for test
prepare_system() {
# Clean up logs and create output directory
rm -rf ./blobfuse2.log
rm -rf ${output}
mkdir -p ${output}
chmod 777 ${output}

# Clean storage account before begining the test

Check failure on line 137 in benchmark/fio_bench.sh

View workflow job for this annotation

GitHub Actions / Check for spelling errors

begining ==> beginning
mount_blobfuse
rm -rf ${mount_dir}/*
./blobfuse2 unmount all
}


# --------------------------------------------------------------------------------------------------
# Prepare the system for test
prepare_system

# Execute write benchmark using fio
write_fio_benchmark

# Execute read benchmark using fio
read_fio_benchmark

# combine all bench results into one json file
# Execute multi-threaded benchmark using fio
multi_threaded_fio_benchmark
# --------------------------------------------------------------------------------------------------


# Merge all results and geenrate a json summary

Check failure on line 159 in benchmark/fio_bench.sh

View workflow job for this annotation

GitHub Actions / Check for spelling errors

geenrate ==> generate
jq -n '[inputs]' ${output}/*_summary.json | tee ./benchmark/results.json
24 changes: 24 additions & 0 deletions benchmark/fio_multi_threaded/rand_read_40threads.fio
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[global]
ioengine=libaio
direct=1
fadvise_hint=0
verify=0
rw=read
iodepth=64
invalidate=1
ramp_time=10s
runtime=60s
time_based=1
nrfiles=1
thread=1
openfiles=1
group_reporting=1
allrandrepeat=1
filename_format=$jobname.$jobnum.$filenum
rw=randread
bs=1M
size=1G

[Seq_Write_40thread]
stonewall
numjobs=128
24 changes: 24 additions & 0 deletions benchmark/fio_multi_threaded/seq_read_40threads.fio
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[global]
ioengine=libaio
direct=1
fadvise_hint=0
verify=0
rw=read
iodepth=64
invalidate=1
ramp_time=10s
runtime=60s
time_based=1
nrfiles=1
thread=1
openfiles=1
group_reporting=1
allrandrepeat=1
filename_format=$jobname.$jobnum.$filenum
rw=read
bs=1M
size=1G

[Seq_Write_40thread]
stonewall
numjobs=128
23 changes: 23 additions & 0 deletions benchmark/fio_multi_threaded/seq_write_40threads.fio
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[global]
ioengine=libaio
direct=1
fadvise_hint=0
verify=0
iodepth=64
invalidate=1
ramp_time=10s
runtime=60s
time_based=1
nrfiles=1
thread=1
openfiles=1
group_reporting=1
allrandrepeat=1
filename_format=$jobname.$jobnum.$filenum
rw=write
bs=1M
size=1G

[Seq_Write_40thread]
stonewall
numjobs=112
4 changes: 2 additions & 2 deletions benchmark/fio_read_config/rand_read.fio
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[global]
name=fs_bench
bs=256k
name=blobfuse_benchmark
bs=1M
runtime=30s
time_based
group_reporting
Expand Down
14 changes: 14 additions & 0 deletions benchmark/fio_read_config/rand_read_4thread.fio
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[global]
name=blobfuse_benchmark
bs=1M
runtime=30s
time_based
group_reporting

[random_read_four_threads]
size=10G
rw=randread
ioengine=sync
fallocate=none
numjobs=4
startdelay=30s
14 changes: 14 additions & 0 deletions benchmark/fio_read_config/rand_read_directio.fio
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[global]
name=blobfuse_benchmark
bs=1M
runtime=30s
time_based
group_reporting

[random_read_direct_io]
size=10G
rw=randread
ioengine=sync
fallocate=none
direct=1
startdelay=30s
4 changes: 2 additions & 2 deletions benchmark/fio_read_config/rand_read_small.fio
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[global]
name=fs_bench
bs=256k
name=blobfuse_benchmark
bs=1M
runtime=30s
time_based
group_reporting
Expand Down
4 changes: 2 additions & 2 deletions benchmark/fio_read_config/seq_read.fio
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[global]
name=fs_bench
bs=256k
name=blobfuse_benchmark
bs=1M
runtime=30s
time_based
group_reporting
Expand Down
14 changes: 14 additions & 0 deletions benchmark/fio_read_config/seq_read_16thread.fio
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[global]
name=blobfuse_benchmark
bs=1M
runtime=30s
time_based
group_reporting

[sequential_read_sixteen_threads]
size=10G
rw=read
ioengine=sync
fallocate=none
numjobs=16
startdelay=30s
4 changes: 2 additions & 2 deletions benchmark/fio_read_config/seq_read_4thread.fio
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[global]
name=fs_bench
bs=256k
name=blobfuse_benchmark
bs=1M
runtime=30s
time_based
group_reporting
Expand Down
14 changes: 14 additions & 0 deletions benchmark/fio_read_config/seq_read_directio.fio
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[global]
name=blobfuse_benchmark
bs=1M
runtime=30s
time_based
group_reporting

[sequential_read_direct_io]
size=10G
rw=read
ioengine=sync
fallocate=none
direct=1
startdelay=30s
4 changes: 2 additions & 2 deletions benchmark/fio_read_config/seq_read_small.fio
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[global]
name=fs_bench
bs=256k
name=blobfuse_benchmark
bs=1M
runtime=30s
time_based
group_reporting
Expand Down
4 changes: 2 additions & 2 deletions benchmark/fio_write_config/seq_write.fio
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[global]
name=fs_bench
bs=256k
name=blobfuse_benchmark
bs=1M
runtime=30s
time_based
group_reporting
Expand Down

0 comments on commit 134a41c

Please sign in to comment.