Skip to content

Instantly share code, notes, and snippets.

@namikawa
Last active April 5, 2017 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save namikawa/935d256e833c316d5cc5 to your computer and use it in GitHub Desktop.
Save namikawa/935d256e833c316d5cc5 to your computer and use it in GitHub Desktop.
#!/bin/bash
# conf
FILENAME=/data/testfile
SIZE=20G
RUNTIME=60
SLEEPTIME=10
# exec
echo -e "===== IOPS =====\n"
for NUMJOB in 1 2 4 8 16 32 64 128 256; do
echo "----- numjobs=$NUMJOB -----"
for TYPE in read write randread randwrite; do
fio -direct=1 -readwrite=$TYPE -group_reporting \
-filename=$FILENAME -size=$SIZE -runtime=$RUNTIME \
-bs=4k -numjobs=$NUMJOB -name=file1 | grep "iops="
echo 3 > /proc/sys/vm/drop_caches
sleep $SLEEPTIME
done
done
echo -e "\n===== Throughput =====\n"
for TYPE in read write; do
fio -direct=1 -readwrite=$TYPE -group_reporting \
-filename=$FILENAME -size=$SIZE -runtime=$RUNTIME \
-bs=32m -numjobs=16 -name=file1 | egrep "READ:|WRITE:"
echo 3 > /proc/sys/vm/drop_caches
sleep $SLEEPTIME
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment