fio was created to allow benchmarking specific disk IO workloads. It can issue its IO requests using one of many synchronous and asynchronous IO APIs, and can also use various APIs which allow many IO requests to be issued with a single API call. You can also tune how large the files fio uses are, at what offsets in those files IO is to happen at, how much delay if any there is between issuing IO requests, and what if any filesystem sync calls are issued between each IO request. A sync call tells the operating system to make sure that any information that is cached in memory has been saved to disk and can thus introduce a significant delay. The options to fio allow you to issue very precisely defined IO patterns and see how long it takes your disk subsystem to complete these tasks.
Example config is blow.
Command line:
$ fio -section=seq-write db-postgresql-load2.fio
[seq-read]
# Sequential reads
rw=read
# Size if the the I/O
size=100g
# Directory where the test file will be created
directory=/fs01/fio-test
# Diables posix_fadvise - predeclare an access pattern for file data
fadvise_hint=0
# Block size
blocksize=8k
# Use of direct I/O
direct=0
# Number of I/O threads :
numjobs=1
# Number of files :
nrfiles=1
# Duration of the test in seconds
runtime=300
# Usage of ASYNC I/O
# ioengine=libaio
# Runtime based, overwrites or overreads several times the specified file
time_based
# To free pagecache, dentries and inodes (only possible as root, therefore commented out) :
exec_prerun=echo 3 > /proc/sys/vm/drop_caches
[seq-write]
rw=write
size=100g
directory=/fs01/fio-test
fadvise_hint=0
blocksize=8k
direct=0
numjobs=1
nrfiles=1
runtime=300
# ioengine=libaio
time_based
exec_prerun=echo 3 > /proc/sys/vm/drop_caches
[random-read]
# Each process allocates one file, therefore to have 8G the size should be set to 1G with 8 processes
rw=randread
size=10g
directory=/utest
fadvise_hint=0
blocksize=8k
direct=0
numjobs=10
nrfiles=1
runtime=300
# ioengine=libaio
time_based
exec_prerun=echo 3 > /proc/sys/vm/drop_caches
[random-write]
# Each process allocates one file, therefore to have 8G the size should be set to 1G with 8 processes
rw=randwrite
size=10g
directory=/fs01/fio-test
fadvise_hint=0
blocksize=8k
direct=0
numjobs=10
nrfiles=1
runtime=300
# ioengine=libaio
time_based
exec_prerun=echo 3 > /proc/sys/vm/drop_caches
[read-write]
# Each process allocates one file, therefore to have 8G the size should be set to 1G with 8 processes
rw=rw
rwmixread=80
size=10g
directory=/fs01/fio-test
fadvise_hint=0
blocksize=8k
direct=0
numjobs=10
nrfiles=1
runtime=300
# ioengine=libaio
time_based
exec_prerun=echo 3 > /proc/sys/vm/drop_caches
|