fio - flexible I/O tester

From man page: fio is a tool that will spawn a number of threads or processes doing a particular type of I/O action as specified by the user. The typical use of fio is to write a job file matching the I/O load one wants to simulate.

This example only show how to use fio to make reproduceable test on a file system. For me it's been useful to catch changes in I/O throughput before and after a system has gone into production. Buy running the same tests on all systems the numbers are comparable.

All parameter numbers are examples, define your own test according to what you want to measure.

Installing fio

apt-get install fio

Running fio

  • Change bsrange to the block size range you want to test.
  • numjobs is the number of simultanious read/write threads.
  • size is the working file size.
  • If you want to test a read heavy load, use rwmixread with a percentage of reads versus writes..
for i in read write readwrite randread randwrite randrw; do fio --name=fio  --write_bw_log=$i --write_iops_log=$i --write_lat_log=$i --ioengine=sync --size=10G --runtime=60 --rw=$i --norandommap --refill_buffers --randrepeat=0  --iodepth=1 --direct=1 --numjobs=8 --group_reporting --bsrange=4k-4k; done

Generating I/O plots

fio2gnuplot -i -g

For me is the most interesting plot is compare-result-2Dsmooth.png.

Generating bandwidth plots

Testing bandwidth is better to do with a larger block size. I usually set a block size between 64k to 1m.

for i in read write readwrite randread randwrite randrw; do fio --name=fio  --write_bw_log=$i --write_iops_log=$i --write_lat_log=$i --ioengine=sync --size=10G --runtime=60 --rw=$i --norandommap --refill_buffers --randrepeat=0  --iodepth=1 --direct=1 --numjobs=8 --group_reporting --bsrange=64k-1m; done

Generate the bandwidth plot.

fio2gnuplot -b -g

For me is the most interesting plot is compare-result-2Dsmooth.png.

Comments