基本语法
./fio -filename=/mnt/sdcard/fiofile -direct=1 -rw=read -bs=8k -siz
e=1G -numjobs=8 -runtime=10 -group_reporting -name=fio_test
--help
/mnt/sdcard # ./fio --help
fio-2.20
./fio [options] [job options] <job file(s)>
--debug=options Enable debug logging. May be one/more of:
process,file,io,mem,blktrace,verify,random,parse,
diskutil,job,mutex,profile,time,net,rate,compress,
steadystate,helperthread
--parse-only Parse options only, don't start any IO
--output Write output to file
--bandwidth-log Generate aggregate bandwidth logs
--minimal Minimal (terse) output
--output-format=type Output format (terse,json,json+,normal)
--terse-version=type Set terse version output format (default 3, or 2 or 4)
--version Print version info and exit
--help Print this page
--cpuclock-test Perform test/validation of CPU clock
--crctest=type Test speed of checksum functions
--cmdhelp=cmd Print command help, "all" for all of them
--enghelp=engine Print ioengine help, or list available ioengines
--enghelp=engine,cmd Print help for an ioengine cmd
--showcmd Turn a job file into command line options
--eta=when When ETA estimate should be printed
May be "always", "never" or "auto"
--eta-newline=time Force a new line for every 'time' period passed
--status-interval=t Force full status dump every 't' period passed
--readonly Turn on safety read-only checks, preventing writes
--section=name Only run specified section in job file, multiple sections can be specified
--alloc-size=kb Set smalloc pool to this size in kb (def 16384)
--warnings-fatal Fio parser warnings are fatal
--max-jobs=nr Maximum number of threads/processes to support
--server=args Start a backend fio server
--daemonize=pidfile Background fio server, write pid to file
--client=hostname Talk to remote backend(s) fio server at hostname
--remote-config=file Tell fio server to load this local job file
--idle-prof=option Report cpu idleness on a system or percpu basis
(option=system,percpu) or run unit work
calibration only (option=calibrate)
--inflate-log=log Inflate and output compressed log
--trigger-file=file Execute trigger cmd when file exists
--trigger-timeout=t Execute trigger af this time
--trigger=cmd Set this command as local trigger
--trigger-remote=cmd Set this command as remote trigger
--aux-path=path Use this path for fio state generated files
Fio was written by Jens Axboe <jens.axboe@oracle.com>
Jens Axboe <jaxboe@fusionio.com>
Jens Axboe <axboe@fb.com>
基本每太看懂 不过按照语法还是可以用的
基本语法中,-rw=read/write/randread/randwrite 可以简单测试读写性能。
结果
/mnt/sdcard # ./fio -filename=/mnt/sdcard/fiofile -direct=1 -rw=read -bs=8k -siz
e=1G -numjobs=8 -runtime=10 -group_reporting -name=fio_test
fio_test: (g=0): rw=read, bs=(R) 8192B-8192B, (W) 8192B-8192B, (T) 8192B-8192B, ioengine=psync, iodepth=1
...
fio-2.20
Starting 8 processes
Jobs: 8 (f=8): [R(8)][100.0%][r=14.8MiB/s,w=0KiB/s][r=1899,w=0 IOPS][eta 00m:00s]
fio_test: (groupid=0, jobs=8): err= 0: pid=4542: Wed Aug 12 17:53:16 2020
read: IOPS=2177, BW=17.0MiB/s (17.8MB/s)(170MiB/10005msec)
clat (usec): min=614, max=1000.1k, avg=3640.26, stdev=36487.91
lat (usec): min=620, max=1000.1k, avg=3643.89, stdev=36488.06
clat percentiles (usec):
| 1.00th=[ 1032], 5.00th=[ 1080], 10.00th=[ 1096], 20.00th=[ 1144],
| 30.00th=[ 1176], 40.00th=[ 1208], 50.00th=[ 1272], 60.00th=[ 1352],
| 70.00th=[ 1432], 80.00th=[ 1512], 90.00th=[ 1592], 95.00th=[ 1656],
| 99.00th=[ 9792], 99.50th=[74240], 99.90th=[659456], 99.95th=[897024],
| 99.99th=[995328]
bw ( KiB/s): min= 16, max= 6435, per=0.01%, avg=2483.22, stdev=2170.08
lat (usec) : 750=0.01%, 1000=0.33%
lat (msec) : 2=97.77%, 4=0.71%, 10=0.20%, 20=0.36%, 50=0.09%
lat (msec) : 100=0.10%, 250=0.08%, 500=0.16%, 750=0.12%, 1000=0.06%
lat (msec) : 2000=0.01%
cpu : usr=1.43%, sys=3.70%, ctx=21914, majf=0, minf=151
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.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.0%, >=64=0.0%
issued rwt: total=21785,0,0, short=0,0,0, dropped=0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1
Run status group 0 (all jobs):
READ: bw=17.0MiB/s (17.8MB/s), 17.0MiB/s-17.0MiB/s (17.8MB/s-17.8MB/s), io=170MiB (178MB), run=10005-10005msec
Disk stats (read/write):
mmcblk1: ios=21118/5, merge=0/1, ticks=57616/3072, in_queue=61611, util=98.98%
一个简单的-rw=read的测试结果。
/mnt/sdcard # ./fio -filename=/mnt/sdcard/fiofile -direct=1 -rw=write -bs=8k -si
ze=1G -numjobs=8 -runtime=10 -group_reporting -name=fio_test
fio_test: (g=0): rw=write, bs=(R) 8192B-8192B, (W) 8192B-8192B, (T) 8192B-8192B, ioengine=psync, iodepth=1
...
fio-2.20
Starting 8 processes
Jobs: 8 (f=8): [W(8)][100.0%][r=0KiB/s,w=4472KiB/s][r=0,w=559 IOPS][eta 00m:00s]
fio_test: (groupid=0, jobs=8): err= 0: pid=4678: Wed Aug 12 18:01:38 2020
write: IOPS=535, BW=4283KiB/s (4386kB/s)(41.9MiB/10016msec)
clat (msec): min=1, max=371, avg=14.89, stdev=61.66
lat (msec): min=1, max=371, avg=14.89, stdev=61.66
clat percentiles (usec):
| 1.00th=[ 1160], 5.00th=[ 1192], 10.00th=[ 1224], 20.00th=[ 1256],
| 30.00th=[ 1320], 40.00th=[ 1448], 50.00th=[ 1784], 60.00th=[ 1848],
| 70.00th=[ 1880], 80.00th=[ 1960], 90.00th=[ 2096], 95.00th=[14912],
| 99.00th=[329728], 99.50th=[337920], 99.90th=[350208], 99.95th=[362496],
| 99.99th=[370688]
bw ( KiB/s): min= 304, max= 919, per=0.01%, avg=538.71, stdev=162.41
lat (msec) : 2=83.61%, 4=10.16%, 10=0.65%, 20=1.01%, 50=0.19%
lat (msec) : 100=0.06%, 250=0.19%, 500=4.14%
cpu : usr=0.38%, sys=1.71%, ctx=10964, majf=0, minf=155
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.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.0%, >=64=0.0%
issued rwt: total=0,5362,0, short=0,0,0, dropped=0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1
Run status group 0 (all jobs):
WRITE: bw=4283KiB/s (4386kB/s), 4283KiB/s-4283KiB/s (4386kB/s-4386kB/s), io=41.9MiB (43.9MB), run=10016-10016msec
Disk stats (read/write):
mmcblk1: ios=0/5264, merge=0/1, ticks=0/8771, in_queue=8744, util=88.05%
个简单的-rw=write的测试结果。