Skip to content

Instantly share code, notes, and snippets.

@tibkiss
Forked from fdegir/fio.sh
Created September 6, 2020 09:19
Show Gist options
  • Save tibkiss/24e71c1a5dc48c4a3e56a8cecd59fd8d to your computer and use it in GitHub Desktop.
Save tibkiss/24e71c1a5dc48c4a3e56a8cecd59fd8d to your computer and use it in GitHub Desktop.
fio
#!/bin/bash
RESULT_FILE=/tmp/result_$$
rm -rf $HOME/tmp-fio
mkdir -p $HOME/tmp-fio && cd $HOME/tmp-fio
echo "Starting storage tests"
echo "Results will be saved in $RESULT_FILE"
echo "Running seqread"
fio --name=seqread --rw=read --direct=1 --ioengine=libaio --bs=8k --numjobs=8 --size=1G --runtime=60 --group_reporting >> $RESULT_FILE
echo "Running randread"
fio --name=randread --rw=randread --direct=1 --ioengine=libaio --bs=8k --numjobs=16 --size=1G --runtime=60 --group_reporting >> $RESULT_FILE
echo "Running seqwrite"
fio --name=seqwrite --rw=write --direct=1 --ioengine=libaio --bs=32k --numjobs=4 --size=2G --runtime=60 --group_reporting >> $RESULT_FILE
echo "Running randwrite"
fio --name=randwrite --rw=randwrite --direct=1 --ioengine=libaio --bs=64k --numjobs=8 --size=512m --runtime=60 --group_reporting >> $RESULT_FILE
echo "Running randreadwrite"
fio --name=randrw --rw=randrw --direct=1 --ioengine=libaio --bs=16k --numjobs=8 --rwmixread=90 --size=1G --runtime=60 --group_reporting >> $RESULT_FILE
echo "Done. Results are"
echo "iops"
echo "----------------------------------------------------------------------"
cat $RESULT_FILE | grep 'iops'
echo "----------------------------------------------------------------------"
echo "read/write"
echo "----------------------------------------------------------------------"
cat $RESULT_FILE | grep 'READ\|WRITE'
echo "----------------------------------------------------------------------"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment