[root@dntosu001 vdbench]# cat pbd.conf*SD: Storage Definition*WD: Workload Definition*RD: Run Definition*validate= yes(-v)/read_after_write(-vr)/no_pr ...
[root@dntosu001 vdbench]# cat pbd.conf
*SD: Storage Definition
*WD: Workload Definition
*RD: Run Definition
*validate= yes(-v)/read_after_write(-vr)/no_preread(-vw)/time(-vt)
*journal= yes/recover/only/noflush
monitor=/root/vdbench/shutdown
data_errors=(1000000000,6000)
sd=sd1,lun=/dev/pbd0,size=500g,journal=/root/journal,openflags=o_direct,threads=256
wd=wd1,sd=sd1,xfersize=8192,rdpct=0
rd=pbdtets,wd=wd1,iorate=max,elapsed=30m,interval=1
參數說明:
journal:指定數據存儲路徑,使用數據校驗功能時可以通過設置journal保存測試數據,第二次運行vdbench時通過journal參數讀取
上次的測試數據.
data_errors:當發生IO錯誤時,如果error總數超過1000000000或者運行時間超過6000s則退出
threads: 並行IO數,預設為8
open_flags=o_direct: 測試裸塊設備時,必須是o_direct
xfersize: 測試數據塊大小,預設4096,4K
monitor: 通過CTRL-C,Kill關閉vdbench,下次恢復journal繼續校驗數據將失敗,設置monitor後,vdbench將檢查參數指定的文
件內容,通過設置文件可以正常關閉vdbench
[root@dntosu001 vdbench]# ./vdbench -f pbd.conf -jn -v
[-jn: 將測試數據非同步方式寫入journal日誌,同步方式性能太差,測不出壓力]
[-v: 啟用數據校驗功能]
-jn,-v參數可以放入配置文件pbd.conf中(journal=noflush,validate=yes)
測試一段時間後,dd寫入數據到pbd0,模擬數據丟失
[root@dntosu001 vdbench]# echo "end_vdbench" > /root/vdbench/shutdown
正常關閉vdbench
[root@dntosu001 vdbench]# ./vdbench -f pbd.conf -jnr -v
啟動vdbench,並讀取上次測試數據進行校驗並繼續測試. 校驗完成結果:
localhost-0: 16:35:47.087 Total amount of key blocks read and validated: 13,904,362; key blocks marked in error: 0
dd寫後會立馬報錯.
vdbench errorlog分析
寫入時間戳: 0x53c4c79d79c66
[root@dntosu002 ~]# python
Python 2.7.5 (default, Nov 20 2015, 02:00:19)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> int(0x53c4c79d79c66)
1473674042907750
>>> s, ms = divmod(1473674042907750, 1000000)
>>> '%s.%06d' % (time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(s)), ms)
'2016-09-12 09:54:02.907750'
讀取errorlog中報錯的塊數據內容
[root@dntosu001 vdbench]# ./vdbench print /dev/pbd0 0x29acab6000 8192