Skip to content

Benchmarking storage with fio

What is fio ?

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.

How to install fio ?

Debian / Ubuntu:

apt-get install fio

Centos 6.x

yum install libibverbs.x86_64
wget http://pkgs.repoforge.org/fio/fio-2.1.10-1.el6.rf.x86_64.rpm
rpm -iv fio-2.1.10-1.el6.rf.x86_64.rpm

Centos 7

wget http://pkgs.repoforge.org/fio/fio-2.1.10-1.el7.rf.x86_64.rpm
rpm -iv fio-2.1.10-1.el7.rf.x86_64.rpm

Let’s run fio on a server with 240 GB SSD:

root@ips:~# fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randrw --rwmixread=75
test: (g=0): rw=randrw, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=64
fio-2.1.11
Starting 1 process
Jobs: 1 (f=1): [m(1)] [100.0% done] [189.4MB/64816KB/0KB /s] [48.5K/16.3K/0 iops] [eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=20157: Sun Nov  6 02:03:09 2016
  read : io=3071.7MB, bw=196685KB/s, iops=49171, runt= 15992msec
  write: io=1024.4MB, bw=65590KB/s, iops=16397, runt= 15992msec
  cpu          : usr=10.08%, sys=22.01%, ctx=1039240, majf=0, minf=6
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.1%, >=64=0.0%
     issued    : total=r=786347/w=262229/d=0, short=r=0/w=0/d=0
     latency   : target=0, window=0, percentile=100.00%, depth=64

Run status group 0 (all jobs):
   READ: io=3071.7MB, aggrb=196685KB/s, minb=196685KB/s, maxb=196685KB/s, mint=15992msec, maxt=15992msec
  WRITE: io=1024.4MB, aggrb=65590KB/s, minb=65590KB/s, maxb=65590KB/s, mint=15992msec, maxt=15992msec

Disk stats (read/write):
    dm-0: ios=782566/260992, merge=0/0, ticks=840764/171008, in_queue=1012024, util=99.41%, aggrios=783192/261858, aggrmerge=3155/376, aggrticks=841996/171660, aggrin_queue=1013796, aggrutil=99.02%
  sda: ios=783192/261858, merge=3155/376, ticks=841996/171660, in_queue=1013796, util=99.02%

For more info, you can read the manual (man fio)

Published inBenchmarksLinux