Skip to content

Instantly share code, notes, and snippets.

@harshavardhana
Created February 7, 2022 18:29
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 harshavardhana/e8356610e1f1dfb0ed0cafda190dfdbf to your computer and use it in GitHub Desktop.
Save harshavardhana/e8356610e1f1dfb0ed0cafda190dfdbf to your computer and use it in GitHub Desktop.
fio.sh
#!/bin/bash
ENGINE=sync ## can be changed to psync as well
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 --fdatasync=1 --ioengine=$ENGINE --bs=8k --numjobs=8 --size=1G --runtime=60 --group_reporting >> $RESULT_FILE
echo "Running randread"
fio --name=randread --rw=randread --direct=1 --fdatasync=1 --ioengine=$ENGINE --bs=8k --numjobs=16 --size=1G --runtime=60 --group_reporting >> $RESULT_FILE
echo "Running seqwrite"
fio --name=seqwrite --rw=write --direct=1 --fdatasync=1 --ioengine=$ENGINE --bs=32k --numjobs=4 --size=2G --runtime=60 --group_reporting >> $RESULT_FILE
echo "Running randwrite"
fio --name=randwrite --rw=randwrite --direct=1 --fdatasync=1 --ioengine=$ENGINE --bs=64k --numjobs=8 --size=512m --runtime=60 --group_reporting >> $RESULT_FILE
echo "Running randreadwrite"
fio --name=randrw --rw=randrw --direct=1 --fdatasync=1 --ioengine=$ENGINE --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