Fio (Flexible IO Tester) is a benchmarking tool written by Jens Axboe, who is the maintainer of the Linux kernel’s block IO subsystem. Thanks to Jens efforts and porting done by many, Fio is available on most platforms. It provides a wide range of test and output options. Because of this flexibility, it has a reputation for being difficult. Misunderstood would be accurate. Today, we will show a read & write IO test then explain Fio IO results.
On CentOS 6/7 or Redhat 6/7
sudo yum install fio
On OSX , if you use Homebrew (does not appear to be available in Macports)
brew install fio
On Windows, binaries of fio can be found at http://www.bluestop.org/fio/
Build from source (if you must)
git clone --branch fio-2.1.8 http://git.kernel.dk/fio.git fio-2.1.8 # or wget http://brick.kernel.dk/snaps/fio-2.1.8.tar.bz2 && \ tar -xjvf fio-2.1.8.tar.bz2 cd fio-2.1.8 ./configure make make install
Basic IO test on Linux
Let’s use 10 GB of data to test IO on a subdirectory /home/fio using one (1) thread.
First, create a directory to run the test, hold the configuration options for the test and the results of the test
# mkdir /home/fio # Unix: this directory will written to by fio
Fio configuration file for Basic IO test on Linux (/home/fio/basic.fio)
Use vi to create the configuration options file (/home/fio/basic.fio)
# vi /home/fio/basic.fio
[global] ioengine=posixaio rw=readwrite size=10g directory=/home/fio thread=1 [basic-readwrite-10g]
Execute Basic IO test on Linux
# cd /home/fio # fio basic.fio
Fio Output Explained
The first line of output states Fio processed 10GB of data (io) at an IO rate (bw) of 63.317MB/s with a total of 15829 IOPS using a default 4k block size.
Total runtime (runt) for the operation was 2 minutes and 45 seconds.
read : io=10240MB, bw=63317KB/s, iops=15829, runt=165607msec
The first latency metric is submission latency (slat), “how long did it take to submit this IO to the kernel for processing?”.
slat (usec): min=3, max=335, avg= 9.73, stdev= 5.76
Next is completion latency (clat), “the time that passes between submission to the kernel and when the IO is complete, not including submission latency”.
clat (usec): min=1, max=18600, avg=51.29, stdev=16.79
Next is estimated application latency (lat). “the best representation of what applications will experience”
lat (usec): min=44, max=18627, avg=61.33, stdev=17.91
Completion latency percentiles are next, the following data is from a 7200 RPM SAS drive.
clat percentiles (usec): | 1.00th=[ 3952], 5.00th=[ 5792], 10.00th=[ 7200], 20.00th=[ 8896], | 30.00th=, 40.00th=, 50.00th=, 60.00th=, | 70.00th=, 80.00th=, 90.00th=, 95.00th=, | 99.00th=, 99.50th=, 99.90th=, 99.95th=, | 99.99th=
Bandwidth (bw) is the data being read or written to the device per second.
bw (KB /s): min=52536, max=75504, per=67.14%, avg=63316.81, stdev=4057.09