Skip to content

Instantly share code, notes, and snippets.

@davidjb
Last active November 8, 2017 00:08
Show Gist options
  • Save davidjb/8777451 to your computer and use it in GitHub Desktop.
Save davidjb/8777451 to your computer and use it in GitHub Desktop.
I/O Performance tests with fio
#!/bin/sh
#Run like this:
# wget -O - https://gist.githubusercontent.com/davidjb/8777451/raw/test-io.sh | sudo sh
# or
# curl https://gist.githubusercontent.com/davidjb/8777451/raw/test-io.sh | sudo sh
if command -v yum > /dev/null 2>&1; then
sudo rpm -ihv http://mirrors.kernel.org/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo yum install -y fio git
elif command -v apt-get > /dev/null 2>&1; then
sudo apt-get install -y fio git
fi
git clone https://gist.github.com/8777451.git test-io
cd test-io
# Run the tests
echo "********************SEQUENTIAL READ*********************"
fio test-read.fio
sleep 3
echo "********************SEQUENTIAL WRITE********************"
fio test-write.fio
sleep 3
echo "***********************RANDOM READ**********************"
fio test-random-read.fio
sleep 3
echo "********************RANDOM READ/WRITE*******************"
fio test-random-readwrite.fio
sleep 3
echo "*************SIMULTANEOUS RANDOM READ/WRITE*************"
fio test-random-io.fio
sleep 3
[global]
rw=randread
size=128m
ioengine=libaio
iodepth=4
invalidate=1
direct=1
[bgwriter]
rw=randwrite
iodepth=32
[queryA]
iodepth=1
ioengine=mmap
direct=0
thinktime=3
[queryB]
iodepth=1
ioengine=mmap
direct=0
thinktime=5
[bgupdater]
rw=randrw
iodepth=16
thinktime=40
size=32m
[random-read]
rw=randread
size=128m
[readwrite]
rw=readwrite
size=256m
[read]
rw=read
size=512m
[write]
rw=write
size=512m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment