JavaScript must be enabled in order for you to see "WP Copy Data Protect" effect. However, it seems JavaScript is either disabled or not supported by your browser. To see full result of "WP Copy Data Protector", enable JavaScript by changing your browser options, then try again.

透過FIO做各種Disk的Benchmark與Simulate各種Condition


感覺一週Po一次費文成了慣例,不過還是紀錄一下如何決定帶哪種Parameter做測試外,得到的Result如何檢視等等,雖然有很多Tool也可以做Benchmark,如IOMeter、Hdparm與DD等等,但是很難符合現在實際上的環境,所以話不多說,直接看看如何實作就知道囉,如下:

1) Install the fio from the source(可以從這邊下載Source)
#tar zxvf fio-<version>.tar.gz
#cd fio-<version>
#./configure && make && make install

2) Introduction the parameter about the fio
--filename:你想要測試的Disk(RAW或Partition皆可)
--direct:如果為1(True),則使用Non-Buffered(I/O),Default為0(False)
--rw:設定I/O Pattern的類型,有read、write、randread、randwrite、rw與randrw(Rand為隨機,其餘為順序)
--ioengine:定義如何執行I/O,有sync、psync、vsync、libaio(Linux native[Default]、posixaio、mmap、splice、syslet-rw、sg、null、net、netsplice、cpuio、guasi與external
--bs:Block Size,寫入檔案的大小,Default為4K
--rwmixread:設定Mixed中Read Loading的百分比,Default為50(限定有RW)
--refill_buffers:Default為Enabled,預防跑到Buffer的控制Option
--iodepth:同一時間有多少I/O在做存取
--numjobs:在一個Job(Workload)下指定多少複製出來的Processes/Threads
--runtime:設定這一Round要跑的時間(單位:秒)
--group_reporting:如果有Enable,Report會以per-group的顯示方式,而不是預設的pre-job
--name:指定新Job的Name
--time_based:若Enabled,即使Job已經完成Read或Write後,還是會繼續執行至時間到為止

3) Example for the increasing numjobs(以Thread為1,2,4,8…512為例)
#vi fio_sample_incr_njs.sh
#! /bin/bash
CNT=0
while [[ $CNT -lt 10 ]]
do
fio --filename=/dev/sdb --direct=1 --rw=randread --ioengine=libaio --bs=16k --iodepth=16 --numjobs=$((2**$CNT)) --runtime=30 --group_reporting --name=conf_$(($CNT+1)) --output=fio_$(($CNT+1)).log
((CNT++))
done
#chmod a+x fio_sample_incr_njs.sh
#./fio_sample_incr_njs.sh
#cat fio_*.log

4) Review and explain the result from the fio(The last line 2)
Run status group 0 (all jobs):
READ: io=xxxxx.xMB, aggrb=xxxxxxKB/s, minb=xxxxxxKB/s, maxb=xxxxxxKB/s, mint=xxxxxmsec, maxt=xxxxxmsec
Disk stats (read/write):
sdb: ios=xxxxx/0, merge=0/0, ticks=xxxxx/0, in_queue=xxxxx, util=xx.xx%
io:Number of megabytes I/O performed. -> ios*bs
aggrb:Aggregate bandwidth of threads in the group.
minb:Minimum average bandwidth a thread saw.
maxb:Maximum average bandwidth a thread saw.
mint:Shortest runtime of threads in the group.
maxt:Longest runtime of threads in the group.
ios:Number of I/Os performed by all groups. -> IOPS=ios/runtime(s)
merge:Number of merges in the I/O scheduler.
ticks:Number of ticks we kept the disk busy.
io_queue:Total time spent in the disk queue.
util:Disk utilization.

◎、以上就是FIO這支Tool的簡易使用介紹,若要用於SSD前請先做資料的破碎化,此外,上述Parameter的部分均可自行寫成一個Configuration File後,直接#fio .cfg來做執行即可。上述內容均參考Benjr大大文章,至於看倌們想要知道更多,可以直接到這裡參詳參詳一下吧,先到這,收工囉!

  1. 嗨 請問要怎麼做SSD的破碎化? 有參考文章嗎? 謝謝

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
This site is protected by WP-CopyRightPro