Fio

From wikieduonline
Jump to navigation Jump to search

fio examples[edit]

--readwrite=read
--readwrite=randread
--readwrite=write
--readwrite=randwrite
--readwrite=rw --rwmixwrite=70

fio Random read[edit]

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[edit]

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[edit]

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)[edit]

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

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

100% Read 4k[edit]

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[edit]

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[edit]

  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[edit]

  • 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: