Fio

From wikieduonline
Jump to navigation Jump to search

wikipedia:fio is a flexible io performance tester. See following examples to learn how to test your storage devices.


fio examples

fio Random read

fio --randrepeat=1 --size=5G --ioengine=libaio --direct=1 --gtod_reduce=1 --bs=4k --iodepth=64 --readwrite=randread --name=MY_TEST --filename=TEST_TO_DELETE && rm TEST_TO_DELETE

fio Sequential Write

fio --randrepeat=1 --size=5G --ioengine=libaio --direct=1 --gtod_reduce=1 --bs=4k --iodepth=64 --readwrite=write --name=MY_TEST --filename=TEST_TO_DELETE && rm TEST_TO_DELETE

fio Random Write

fio --randrepeat=1 --size=5G --ioengine=libaio --direct=1 --gtod_reduce=1 --bs=4k --iodepth=64 --readwrite=randwrite --name=MY_TEST --filename=TEST_TO_DELETE && rm TEST_TO_DELETE

--randrepeat=1
--size=5G
--ioengine=libaio
--direct=1
--gtod_reduce=1
--bs=4k
--iodepth=64
--readwrite=randwrite
--name=MY_TEST
--filename=TEST_TO_DELETE


cat random-write-test.fio 
; random write of 1G of data

[random-write]
rw=randwrite
size=1G
directory=/tmp/fio-testing/data

$ mdir /tmp/fio-testing && fio random-write-test.fio [1]

Run status group 0 (all jobs):
  WRITE: bw=83.2MiB/s (87.3MB/s), 83.2MiB/s-83.2MiB/s (87.3MB/s-87.3MB/s), io=10.0GiB (10.7GB), run=123009-123009msec

Disk stats (read/write):
  sdd: ios=0/348004, merge=0/292322, ticks=0/156728, in_queue=183700, util=95.38%

Use direct=0 or direct=1 and compare results.

Sequential Write (not random)

cat write-test-sequential.fio 
; Sequential write of 1G of data

[write]
rw=write
size=10G
directory=/tmp/fio-testing

100% Read 4k

fio --filename=/dev/sdXXXX#### --direct=1 --rw=randrw --refill_buffers --norandommap --randrepeat=0 --ioengine=libaio --bs=4k --rwmixread=100 --iodepth=16 --numjobs=16 --runtime=60 --group_reporting --name=4ktest [2]

100% Write 4k

fio --filename=/dev/sdXXXX#### --direct=1 --rw=randrw --refill_buffers --norandommap --randrepeat=0 --ioengine=libaio --bs=4k --rwmixread=0 --iodepth=16 --numjobs=16 --runtime=60 --group_reporting --name=4ktest [3]

Example output:

.../...
Run status group 0 (all jobs):
  WRITE: bw=596KiB/s (611kB/s), 596KiB/s-596KiB/s (611kB/s-611kB/s), io=35.6MiB (37.3MB), run=61170-61170msec

Disk stats (read/write):
  sdc: ios=16/9115, merge=0/0, ticks=668/8173832, in_queue=8178340, util=99.90%
  • Performing a Random Write Test:

sudo fio --name=randwrite --ioengine=libaio --iodepth=1 --rw=randwrite --bs=4k --direct=0 --size=512M --numjobs=2 --runtime=240 --group_reporting[4]

  • Read Write Performance Test:

sudo fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=random_read_write.fio --bs=4k --iodepth=64 --size=4G --readwrite=randrw --rwmixread=75

Activities

  1. Read fio output explained article: https://tobert.github.io/post/2014-04-17-fio-output-explained.html
  2. Benchmark disk performance using fio
  3. Use direct=0 or direct=1 option and compare results. Review memory usage using free command
  4. review --fallocate=none option

See also

  • https://www.linux.com/tutorials/inspecting-disk-io-performance-fio/
  • https://www.storagereview.com/node/3520
  • https://www.storagereview.com/node/3520
  • https://dotlayer.com/how-to-use-fio-to-measure-disk-performance-in-linux/
  • Advertising: