summaryrefslogtreecommitdiffstats
path: root/dev-tools/io_test.sh
diff options
context:
space:
mode:
authorjandob2016-03-24 11:52:44 +0100
committerjandob2016-03-24 11:52:44 +0100
commit7f738a8d4c5bf7f717b77136f8b705fbb4143799 (patch)
treec80e96d492b999e4ca1fdf2a7d3bb4f05c1c2928 /dev-tools/io_test.sh
parentMerge branch 'master' of git.openslx.org:openslx-ng/systemd-init (diff)
downloadsystemd-init-7f738a8d4c5bf7f717b77136f8b705fbb4143799.tar.gz
systemd-init-7f738a8d4c5bf7f717b77136f8b705fbb4143799.tar.xz
systemd-init-7f738a8d4c5bf7f717b77136f8b705fbb4143799.zip
add performance tests
Diffstat (limited to 'dev-tools/io_test.sh')
-rwxr-xr-xdev-tools/io_test.sh66
1 files changed, 45 insertions, 21 deletions
diff --git a/dev-tools/io_test.sh b/dev-tools/io_test.sh
index d511ee86..74e88a31 100755
--- a/dev-tools/io_test.sh
+++ b/dev-tools/io_test.sh
@@ -1,11 +1,10 @@
-#image="$(realpath "$1")"
-image="/home/h4ct1c/git/masterteamprojekt/dnbd3_images/archLinux/archLinux.vdi.r10"
+image="$(realpath "$1")"
test_directory=/tmp/performance_test
[ ! -z $2 ] && test_directory="$2"
-
+test_time=20
image_directory="$(dirname "$image")"
-dnbd3_rootfs_directory="../builder/dnbd3-rootfs"
-log_directory="./io_test_logs"
+dnbd3_rootfs_directory="$(dirname "${BASH_SOURCE[0]}")/../builder/dnbd3-rootfs"
+log_directory="$(dirname "${BASH_SOURCE[0]}")/io_test_logs"
mountpoint_xmount="${test_directory}/mnt_xmount"
mountpoint="${test_directory}/mnt"
@@ -44,8 +43,8 @@ fio_test() {
shift
local name="$1"
shift
- fio --readonly --name=hans --direct=1 --write_bw_log="$name" \
- --size=2G --filename="$device" $@
+ fio --readonly --name=job --direct=1 --write_bw_log="$name" \
+ --runtime=$test_time --filename="$device" "$@"
}
test_device() {
local device="$1"
@@ -55,43 +54,60 @@ test_device() {
#echo "-------------- $2 read test (dd)"
#dd_test "$device" 1000
- #echo "-------------- $2 read test (fio)"
- #fio_test "$device" "$name" --rw=read
+ echo "-------------- $2 read test (fio seq read)"
+ fio_test "$device" "$name.seq" --rw=read --ioengine=sync
echo "-------------- $2 read test (fio random read)"
- fio_test "$device" "${name}.rand" --rw=randread
+ fio_test "$device" "${name}.rand" --rw=randread --ioengine=sync
+
+ echo "-------------- $2 read test (fio seq read libaio)"
+ fio_test "$device" "${name}.seq_libaio" --rw=read --ioengine=libaio
- #echo "-------------- $2 read test (fio random read libaio)"
- #fio_test "$device" "${name}.rand,libaio" --rw=randread --ioengine=libaio
+ echo "-------------- $2 read test (fio random read libaio)"
+ fio_test "$device" "${name}.rand_libaio" --rw=randread --ioengine=libaio
- #echo "-------------- $2 read test (find)"
- #mount -o ro "$device"p2 "$mountpoint"
- #(time find "$mountpoint" 1>/dev/null) 2>&1 | grep -E 'user|sys'
- #umount "$mountpoint"
}
test_qemu() {
# qemu-nbd test (no cache)
modprobe nbd max_part=16
+ qemu_nbd_version="$( qemu-nbd --version \
+ | grep 'version' | cut --delimiter ' ' --field 3 )"
qemu-nbd --connect=/dev/nbd0 --read-only --persistent --nocache "$image"
#ln -s /dev/nbd0 "$image" # device as file (for dnbd3)
- test_device "/dev/nbd0" "qemu-nbd (nocache)"
+ test_device "/dev/nbd0" "qemu-nbd $qemu_nbd_version (nocache)"
# qemu-nbd teardown
qemu-nbd -d /dev/nbd0 >/dev/null # disconnect
# qemu-nbd test
qemu-nbd --connect=/dev/nbd0 --read-only --persistent "$image"
- test_device "/dev/nbd0" "qemu-nbd"
+ test_device "/dev/nbd0" "qemu-nbd $qemu_nbd_version"
# qemu-nbd teardown
qemu-nbd -d /dev/nbd0 >/dev/null # disconnect
}
test_xmount() {
#xmount test
+ xmount_version="$( ${test_directory}/xmount/bin/xmount --info \
+ | grep 'xmount v' | cut --delimiter ' ' --field 2 )"
+ ${test_directory}/xmount/bin/xmount --in qemu "$image" \
+ --out raw "${mountpoint_xmount}" \
+
+ loop_device="$(losetup -f)"
+ losetup "$loop_device" "${mountpoint_xmount}"/*.dd --partscan
+ test_device "$loop_device" "xmount ${xmount_version}"
+
+ # xmount teardown
+ losetup -d "$loop_device"
+ umount "$mountpoint_xmount"
+
+ #xmount test with writeback
${test_directory}/xmount/bin/xmount --in qemu "$image" \
- --out raw "${mountpoint_xmount}"
+ --inopts bdrv_cache=writeback \
+ --out raw "${mountpoint_xmount}" \
+
loop_device="$(losetup -f)"
losetup "$loop_device" "${mountpoint_xmount}"/*.dd --partscan
- test_device "$loop_device" "xmount"
+ test_device "$loop_device" "xmount ${xmount_version} with writeback"
# xmount teardown
losetup -d "$loop_device"
@@ -101,5 +117,13 @@ test_xmount() {
test_qemu
test_xmount
chown $(who | awk '{print $1}') *.log
-fio2gnuplot -b -g
+# bw logs
+fio2gnuplot --gnuplot -p '*seq_bw*.log'
+fio2gnuplot --gnuplot -p '*rand_bw*.log'
+fio2gnuplot --gnuplot -p '*seq_libaio_bw*.log'
+fio2gnuplot --gnuplot -p '*rand_libaio_bw*.log'
+chown $(who | awk '{print $1}') *.png
+rm *2Dsmooth*
+rm *2Dtrend*
+rm '$3.png'
popd