FIO參數
filename=/export/1.txt 支持文件系統或者裸設備,-filename=/dev/sda2或-filename=/dev/sdb direct=1 測試過程繞過機器自帶的buffer,使測試結果更真實 rw=randwread 測試隨機讀的I/O rw=randwrite 測試隨機寫的I/O rw=randrw 測試隨機混合寫和讀的I/O rw=read 測試順序讀的I/O rw=write 測試順序寫的I/O rw=rw 測試順序混合寫和讀的I/O bs=4k 單次io的塊文件大小為4k bsrange=512-2048 同上,提定數據塊的大小范圍 size=5g 本次的測試文件大小為5g,以每次4k的io進行測試 numjobs=30 本次的測試線程為30 runtime=1000 測試時間為1000秒,如果不寫則一直將5g文件分4k每次寫完為止 ioengine=psync io引擎使用pync方式,如果要使用libaio引擎,需要yum install libaio-devel包 rwmixwrite=30 在混合讀寫的模式下,寫占30% group_reporting 關于顯示結果的,匯總每個進程的信息 lockmem=1g 只使用1g內存進行測試 zero_buffers 用0初始化系統buffer nrfiles=8 每個進程生成文件的數量
?
ioengine參數
sync:Basic read(2) or write(2) I/O. fseek(2) is used to position the I/O location.psync:Basic pread(2) or pwrite(2) I/O.vsync: Basic readv(2) or writev(2) I/O. Will emulate queuing by coalescing adjacents IOs into a single submission.libaio: Linux native asynchronous I/O.posixaio: glibc POSIX asynchronous I/O using aio_read(3) and aio_write(3).mmap: File is memory mapped with mmap(2) and data copied using memcpy(3).splice: splice(2) is used to transfer the data and vmsplice(2) to transfer data from user-space to the kernel.syslet-rw: Use the syslet system calls to make regular read/write asynchronous.sg:SCSI generic sg v3 I/O.net : Transfer over the network. filename must be set appropriately to `host/port’ regardless of data direction. If receiving,only the port argument is used.netsplice: Like net, but uses splice(2) and vmsplice(2) to map data and send/receive.guasi: The GUASI I/O engine is the Generic Userspace Asynchronous Syscall Interface approach to asycnronous I/O.
?
測試結果解讀
4k隨機讀寫,70%讀+30%寫,30個并發
fio -filename=/export/1.txt -direct=1 -iodepth 1 -thread -rw=randrw -rwmixread=70 -ioengine=psync -bs=4k -size=10G -numjobs=30 -runtime=60 -group_reporting -name=randrw_70read_4k
輸出結果:
Jobs: 30 (f=30): [mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm] [100.0% done] [99648K/42236K/0K /s] [24.1K/10.6K/0 iops] [eta 00m:00s] randrw_70read_4k: (groupid=0, jobs=30): err= 0: pid=4183: Sun May 5 14:56:16 2019read : io=5873.2MB, bw=100232KB/s, iops=25057 , runt= 60002msecclat (usec): min=129 , max=17247 , avg=872.95, stdev=884.86lat (usec): min=129 , max=17247 , avg=873.04, stdev=884.86clat percentiles (usec):| 1.00th=[ 141], 5.00th=[ 149], 10.00th=[ 157], 20.00th=[ 175],| 30.00th=[ 193], 40.00th=[ 788], 50.00th=[ 988], 60.00th=[ 1096],| 70.00th=[ 1192], 80.00th=[ 1304], 90.00th=[ 1448], 95.00th=[ 1576],| 99.00th=[ 2640], 99.50th=[ 8512], 99.90th=[ 9152], 99.95th=[ 9280],| 99.99th=[10048]bw (KB/s) : min= 2680, max= 3992, per=3.34%, avg=3342.81, stdev=180.17write: io=2519.1MB, bw=43005KB/s, iops=10751 , runt= 60002msecclat (usec): min=45 , max=21382 , avg=750.66, stdev=874.94lat (usec): min=45 , max=21382 , avg=750.85, stdev=874.94clat percentiles (usec):| 1.00th=[ 52], 5.00th=[ 57], 10.00th=[ 60], 20.00th=[ 68],| 30.00th=[ 79], 40.00th=[ 644], 50.00th=[ 868], 60.00th=[ 988],| 70.00th=[ 1080], 80.00th=[ 1192], 90.00th=[ 1320], 95.00th=[ 1448],| 99.00th=[ 1816], 99.50th=[ 8384], 99.90th=[ 9024], 99.95th=[ 9280],| 99.99th=[ 9920]bw (KB/s) : min= 1016, max= 2064, per=3.34%, avg=1434.25, stdev=131.77lat (usec) : 50=0.06%, 100=11.02%, 250=26.21%, 500=0.67%, 750=2.40%lat (usec) : 1000=13.91%lat (msec) : 2=44.51%, 4=0.41%, 10=0.79%, 20=0.01%, 50=0.01%cpu : usr=0.19%, sys=2.19%, ctx=4148485, majf=0, minf=18446744073708663675IO 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 : total=r=1503524/w=645100/d=0, short=r=0/w=0/d=0Run status group 0 (all jobs):READ: io=5873.2MB, aggrb=100231KB/s, minb=100231KB/s, maxb=100231KB/s, mint=60002msec, maxt=60002msecWRITE: io=2519.1MB, aggrb=43005KB/s, minb=43005KB/s, maxb=43005KB/s, mint=60002msec, maxt=60002msecDisk stats (read/write):sda: ios=1499788/643481, merge=0/1, ticks=271811/40234, in_queue=311058, util=98.88%
縮寫解釋:
io=執行了多少M的IObw=平均IO帶寬 iops=IOPS runt=線程運行時間 slat=提交延遲 clat=完成延遲 lat=響應時間 bw=帶寬 cpu=利用率 IO depths=io隊列 IO submit=單個IO提交要提交的IO數 IO complete=Like the above submit number, but for completions instead. IO issued=The number of read/write requests issued, and how many of them were short. IO latencies=IO完延遲的分布io=總共執行了多少size的IO aggrb=group總帶寬 minb=最小.平均帶寬. maxb=最大平均帶寬. mint=group中線程的最短運行時間. maxt=group中線程的最長運行時間.ios=所有group總共執行的IO數. merge=總共發生的IO合并數. ticks=Number of ticks we kept the disk busy. io_queue=花費在隊列上的總共時間. util=磁盤利用率
?
在8塊800GB的SSD做RAID 10的存儲上使用psync引擎進行測試,測試結果:
4k+70%隨機讀+30%隨機寫: 24.1K+10.6K 4k+100%隨機讀: 127K 4k+100%隨機寫: 16.2K1k+70%隨機讀+30%隨機寫: 23.4K+10.4K 1k+100%隨機讀: 131K 1k+100%隨機寫: 13.8K
上面跑的時間較短,測試誤差較大!
?
抄自:
https://www.cnblogs.com/raykuan/p/6914748.html
http://blog.yufeng.info/archives/1497
http://blog.yufeng.info/archives/677