Difference between revisions of "Fio"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Tags: Mobile web edit, Mobile edit
 
(9 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
  
= fio Examples =
+
= fio examples =
 +
:--readwrite='''read'''
 +
:--readwrite='''randread'''
 +
:--readwrite='''write'''
 +
:--readwrite='''randwrite'''
 +
:--readwrite='''rw''' --rwmixwrite=70
  
 
== [[fio Random read]] ==
 
== [[fio Random read]] ==
 
<pre>
 
cat random-read-test.fio
 
;  <code>fio</code> random read of 1G of data
 
 
[random-read]
 
rw=randread
 
size=1G
 
directory=/tmp/fio-testing/data
 
</pre>
 
<code>mdir /tmp/fio-testing && fio random-read-test.fio</code> <ref>https://www.linux.com/tutorials/inspecting-disk-io-performance-fio/</ref>
 
 
  
 
<code>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</code>
 
<code>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</code>
  
== <code>fio</code> Sequential Write ==  
+
== [[fio Sequential Write]] ==  
  
 
<code>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</code>
 
<code>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</code>
  
== <code>fio</code> Random Write ==  
+
== [[fio Random Write]] ==  
  
 
<code>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</code>
 
<code>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</code>
Line 97: Line 90:
 
# [[Benchmark disk performance using fio]]
 
# [[Benchmark disk performance using fio]]
 
# Use <code>direct=0</code> or <code>direct=1</code> option and compare results. Review memory usage using <code>[[free (command)|free]]</code> command
 
# Use <code>direct=0</code> or <code>direct=1</code> option and compare results. Review memory usage using <code>[[free (command)|free]]</code> command
 +
# review <code>--fallocate=none</code> option
  
 
== See also ==
 
== See also ==
 
* {{Io performance commands}}
 
* {{Io performance commands}}
 +
* {{Block device hardware}}
 
* [[sysbench]]
 
* [[sysbench]]
 
* [[Benchmarking tools]]
 
* [[Benchmarking tools]]
  
 
[[Category:Storage]]
 
[[Category:Storage]]

Latest revision as of 11:55, 23 April 2020

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


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: