From ce57f737388fc153f368a6081fd992f02a63506e Mon Sep 17 00:00:00 2001 From: root Date: Tue, 19 Apr 2016 05:24:45 -0700 Subject: initial commit --- .gitignore | 1 + benches/buffered-sync-append | 13 ++++ benches/dio-append | 13 ++++ benches/dio-append-one-cpu | 14 ++++ benches/dio-randread | 11 +++ benches/dio-randread-multithreaded | 12 +++ benches/dio-randrw | 11 +++ benches/dio-randrw-multithreaded | 12 +++ benches/dio-randwrite | 12 +++ benches/dio-randwrite-multithreaded | 13 ++++ benches/dio-randwrite-multithreaded-unwritten | 12 +++ benches/dio-randwrite-unwritten | 11 +++ prep-benchmark-fs.sh | 70 ++++++++++++++++++ run-benchmark.sh | 101 ++++++++++++++++++++++++++ 14 files changed, 306 insertions(+) create mode 100644 .gitignore create mode 100755 benches/buffered-sync-append create mode 100755 benches/dio-append create mode 100755 benches/dio-append-one-cpu create mode 100755 benches/dio-randread create mode 100755 benches/dio-randread-multithreaded create mode 100755 benches/dio-randrw create mode 100755 benches/dio-randrw-multithreaded create mode 100755 benches/dio-randwrite create mode 100755 benches/dio-randwrite-multithreaded create mode 100755 benches/dio-randwrite-multithreaded-unwritten create mode 100755 benches/dio-randwrite-unwritten create mode 100755 prep-benchmark-fs.sh create mode 100755 run-benchmark.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.* diff --git a/benches/buffered-sync-append b/benches/buffered-sync-append new file mode 100755 index 0000000..2d093d5 --- /dev/null +++ b/benches/buffered-sync-append @@ -0,0 +1,13 @@ +#!/bin/bash + +fio --group_reporting \ + --runtime=30 \ + --size=16G \ + --name=buffered-sync-append \ + --ioengine=sync \ + --sync=1 \ + --numjobs=64 \ + --rw=write \ + --blocksize=4k \ + --create_on_open=1 \ + --file_append=1 diff --git a/benches/dio-append b/benches/dio-append new file mode 100755 index 0000000..de5a9b3 --- /dev/null +++ b/benches/dio-append @@ -0,0 +1,13 @@ +#!/bin/bash + +fio --group_reporting \ + --runtime=30 \ + --size=16G \ + --name=dio-append \ + --ioengine=libaio \ + --direct=1 \ + --numjobs=64 \ + --rw=write \ + --blocksize=4k \ + --create_on_open=1 \ + --file_append=1 diff --git a/benches/dio-append-one-cpu b/benches/dio-append-one-cpu new file mode 100755 index 0000000..4ecdf9f --- /dev/null +++ b/benches/dio-append-one-cpu @@ -0,0 +1,14 @@ +#!/bin/bash + +fio --group_reporting \ + --runtime=30 \ + --size=16G \ + --name=dio-append-one-cpu \ + --ioengine=libaio \ + --direct=1 \ + --numjobs=64 \ + --rw=write \ + --blocksize=4k \ + --create_on_open=1 \ + --file_append=1 \ + --cpus_allowed=4 diff --git a/benches/dio-randread b/benches/dio-randread new file mode 100755 index 0000000..f935bfe --- /dev/null +++ b/benches/dio-randread @@ -0,0 +1,11 @@ +#!/bin/bash + +fio --group_reporting \ + --runtime=210 \ + --size=16G \ + --name=dio-randread \ + --ioengine=libaio \ + --direct=1 \ + --iodepth=64 \ + --rw=randread \ + --blocksize=4k diff --git a/benches/dio-randread-multithreaded b/benches/dio-randread-multithreaded new file mode 100755 index 0000000..ea7b2f0 --- /dev/null +++ b/benches/dio-randread-multithreaded @@ -0,0 +1,12 @@ +#!/bin/bash + +fio --group_reporting \ + --runtime=210 \ + --size=8G \ + --name=dio-randread \ + --ioengine=libaio \ + --direct=1 \ + --iodepth=64 \ + --rw=randread \ + --blocksize=4k \ + --numjobs=6 diff --git a/benches/dio-randrw b/benches/dio-randrw new file mode 100755 index 0000000..f39439e --- /dev/null +++ b/benches/dio-randrw @@ -0,0 +1,11 @@ +#!/bin/bash + +fio --group_reporting \ + --runtime=120 \ + --size=16G \ + --name=dio-randrw \ + --ioengine=libaio \ + --direct=1 \ + --iodepth=60 \ + --rw=randrw \ + --blocksize=4k diff --git a/benches/dio-randrw-multithreaded b/benches/dio-randrw-multithreaded new file mode 100755 index 0000000..5b7cb7b --- /dev/null +++ b/benches/dio-randrw-multithreaded @@ -0,0 +1,12 @@ +#!/bin/bash + +fio --group_reporting \ + --runtime=120 \ + --size=8G \ + --name=dio-randrw-multithreaded \ + --ioengine=libaio \ + --direct=1 \ + --iodepth=10 \ + --rw=randrw \ + --blocksize=4k \ + --numjobs=6 diff --git a/benches/dio-randwrite b/benches/dio-randwrite new file mode 100755 index 0000000..3dc5a68 --- /dev/null +++ b/benches/dio-randwrite @@ -0,0 +1,12 @@ +#!/bin/bash + +fio --group_reporting \ + --runtime=60 \ + --size=16G \ + --name=dio-randwrite \ + --ioengine=libaio \ + --direct=1 \ + --iodepth=64 \ + --rw=randwrite \ + --blocksize=4k \ + --overwrite=1 diff --git a/benches/dio-randwrite-multithreaded b/benches/dio-randwrite-multithreaded new file mode 100755 index 0000000..6eeac07 --- /dev/null +++ b/benches/dio-randwrite-multithreaded @@ -0,0 +1,13 @@ +#!/bin/bash + +fio --group_reporting \ + --runtime=60 \ + --size=8G \ + --name=dio-randwrite-multithreaded \ + --ioengine=libaio \ + --direct=1 \ + --iodepth=64 \ + --rw=randwrite \ + --blocksize=4k \ + --numjobs=6 \ + --overwrite=1 diff --git a/benches/dio-randwrite-multithreaded-unwritten b/benches/dio-randwrite-multithreaded-unwritten new file mode 100755 index 0000000..09e5afe --- /dev/null +++ b/benches/dio-randwrite-multithreaded-unwritten @@ -0,0 +1,12 @@ +#!/bin/bash + +fio --group_reporting \ + --runtime=60 \ + --size=8G \ + --name=dio-randwrite-multithreaded-unwritten \ + --ioengine=libaio \ + --direct=1 \ + --iodepth=64 \ + --rw=randwrite \ + --blocksize=4k \ + --numjobs=6 diff --git a/benches/dio-randwrite-unwritten b/benches/dio-randwrite-unwritten new file mode 100755 index 0000000..2c4d1f8 --- /dev/null +++ b/benches/dio-randwrite-unwritten @@ -0,0 +1,11 @@ +#!/bin/bash + +fio --group_reporting \ + --runtime=60 \ + --size=16G \ + --name=dio-randwrite-unwritten \ + --ioengine=libaio \ + --direct=1 \ + --iodepth=64 \ + --rw=randwrite \ + --blocksize=4k diff --git a/prep-benchmark-fs.sh b/prep-benchmark-fs.sh new file mode 100755 index 0000000..3a46946 --- /dev/null +++ b/prep-benchmark-fs.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +set -o nounset +set -o errexit +set -o errtrace +set -o pipefail + +while getopts "hd:m:f:" arg; do + case $arg in + h) + usage + exit 0 + ;; + d) + DEV=$OPTARG + ;; + m) + MNT=$OPTARG + ;; + f) + FS=$OPTARG + ;; + esac +done + +if [[ -z $DEV ]]; then + echo "Required parameter -d missing: device to test" + exit 1 +fi + +if [[ -z $MNT ]]; then + echo "Required parameter -m missing: mount point" + exit 1 +fi + +if [[ -z $FS ]]; then + echo "Required parameter -f missing: filesystem type" + exit 1 +fi + +umount $DEV >/dev/null 2>&1 || true +umount $MNT >/dev/null 2>&1 || true + +blkdiscard -s $DEV >/dev/null 2>&1 || + blkdiscard $DEV >/dev/null 2>&1 || + true + +case $FS in + bcache) + wipefs -a $DEV + bcache format \ + --error_action=panic \ + --data_csum_type=none \ + --cache $DEV + ;; + ext4) + mkfs.ext4 -F $DEV + ;; + ext4-no-journal) + mkfs.ext4 -F -O ^has_journal $DEV + ;; + xfs) + mkfs.xfs -f $DEV + ;; + btrfs) + mkfs.btrfs -f $DEV + ;; +esac + +mount $DEV $MNT diff --git a/run-benchmark.sh b/run-benchmark.sh new file mode 100755 index 0000000..6643523 --- /dev/null +++ b/run-benchmark.sh @@ -0,0 +1,101 @@ +#!/bin/bash + +set -o nounset +set -o errexit +set -o errtrace +set -o pipefail + +BENCHDIR=$(dirname "$(readlink -f "$0")") + +FILESYSTEMS="bcache ext4 ext4-no-journal xfs btrfs" +DEVS="/dev/rssda /dev/sdb /dev/sda5" +BENCHES=" \ + dio-randread \ + dio-randread-multithreaded \ + dio-randwrite \ + dio-randwrite-multithreaded \ + dio-randwrite-unwritten \ + dio-randwrite-multithreaded-unwritten \ + dio-randrw \ + dio-randrw-multithreaded \ + dio-append \ + dio-append-one-cpu \ + buffered-sync-append" +OUT="" +MNT=/mnt/run-benchmark + +while getopts "hd:f:b:m:o:" arg; do + case $arg in + h) + usage + exit 0 + ;; + d) + DEVS=$OPTARG + ;; + f) + FILESYSTEMS=$OPTARG + ;; + b) + BENCHES=$OPTARG + ;; + m) + MNT=$OPTARG + ;; + o) + OUT=$OPTARG + ;; + esac +done +shift $(( OPTIND - 1 )) + +if [[ -z $DEVS ]]; then + echo "Required parameter -d missing: device(s) to test" + exit 1 +fi + +if [[ -z $OUT ]]; then + for i in `seq -w 0 100`; do + OUT=/root/results/$(date -I)_$i + [[ ! -e $OUT ]] && break + done +fi + +mkdir $OUT +terse=$OUT/terse +full=$OUT/full + +truncate --size 0 $terse +truncate --size 0 $full + +echo "Test output in $OUT:" + +for dev in $DEVS; do + devname=$(basename $dev) + model=$(hdparm -i $dev |tr ',' '\n'|sed -n 's/.*Model=\(.*\)/\1/p') + + echo "Device $devname ($model):" |tee -a $terse + + for bench in $BENCHES; do + benchname=$(basename $bench) + echo " $benchname:" |tee -a $terse + + for fs in $FILESYSTEMS; do + out=$OUT/$devname-$benchname-$fs + printf " %-16s" $fs: |tee -a $terse + + $BENCHDIR/prep-benchmark-fs.sh -d $dev -m $MNT -f $fs >/dev/null 2>&1 + sleep 30 # quiesce + (cd $MNT; "$BENCHDIR/benches/$bench") > $out + umount $dev + + echo "**** Device $devname ($model) filesystem $fs benchmark $benchname:" >> $full + cat $out >> $full + echo >> $full + + sed -rne '/iops/ s/ +([[:alpha:]]+) ?:.*iops=([0-9]+).*/\1 \2/ p' $out| + awk '{printf("%8s %8d iops", $1, $2)} END {printf("\n")}'| + tee -a $terse + done + done +done -- cgit v1.2.3