iozone - a filesystem benchmark tool 主要是用來測試文件系統 性能


簡介:      

       磁盤設備之上是文件系統,測試磁盤的工具往往就是調用塊設備驅動的接口進行讀寫測試。而文件系統的測試軟件就是針對文件系統層提供的功能進行測試,包括文件的打開關閉速度以及順序讀寫隨機位置讀寫的速度。以及進程並發數目等各個方面進行詳細的測試。

       IOZone是目前應用非常廣泛的文件系統測試標准工具,它能夠產生並測量各種的操作性能,包括read, write, re-read, re-write, read backwards, read strided, fread, fwrite, random read, pread ,mmap, aio_read, aio_write等操作。Iozone目前已經被移植到各種體系結構計算機和操作系統上,廣泛用於文件系統性能測試、分析與評估的標准工具。

       IOZone和IOMeter不同,IOMeter的測試是基於數據塊的,而IOZome的測試是基於文件的,因此更適合用來測試文件系統的性能。使用IOZone 可以在多線程,多CPU,並指定CPU Cache 空間大小以及同步或者異步IO讀寫模式的情況下進行文件操作的性能測試。

參考鏈接:http://www.iozone.org/ 

下載:可以在參考鏈接進行下載;在寫此博文是 iozone的版本為3 487; 下載為 壓縮包,解壓后,根據軟件說明文檔可以進行編譯生成 對應平台的 測試文件;

常用參數:(具體參數,可以參考iozone 文檔,該文檔較為詳細)

-a     全面測試,比如塊大小它會自動加;

-i N           用來選擇測試項(具體參數,后面有詳細描述);

-r block size     制定一次寫入/讀出的塊大小;

-s file size                 制定測試文件的大小;

-f filename      制定測試文件的名字,完成后會自動刪除;

-F     file1 file2…..    多線程下測試的文件名;

-g –n        指定測試文件大小范圍。-n 后接最小值,-g 后接最大值 ,如測試512m-4G:-n 512m –g 4G;

-y –q        指定測試塊的大小范圍;

-R     產生excel到標准輸出;

-b     制定將結果輸出到制定文件上,比如:-Rb test.xls;

-i # 的詳細選項:

Used to specify which tests to run. (0=write/rewrite, 1=read/re-read, 2=random-read/write
3=Read-backwards, 4=Re-write-record, 5=stride-read, 6=fwrite/re-fwrite, 7=fread/Re-fread,
8=random mix, 9=pwrite/Re-pwrite, 10=pread/Re-pread, 11=pwritev/Re-pwritev, 12=preadv/Repreadv).
One will always need to specify 0 so that any of the following tests will have a file to measure.
-i # -i # -i # is also supported so that one may select more than one test.

使用:

我們可以把生成的iozone 可執行文件拷貝到需要運行掛載點進行運行。也可以使用 -f 指定路徑;

常用命令:

iozone –Ra

iozone –Rab output.wks

iozone –Ra –g 2G –i 0 –i 1

iozone –Rac (NFS 使用)注意此時-c 標志在nfs中的使用:

This tells Iozone to include the close() in the measurement. This may be needed if the client is
running NFS version 3. Including the close() helps to reduce the client side cache effects of NFS version 3.
If you use a file size that is larger than the amount of memory in the client then the ‘c’ flag is not needed. 
-c 標志的含義

使用范例:

在current目錄下,執行測試指令

[root@localhost current]# ./iozone -a -n 1g -g 4g -i 0 -f /test.txt -Rb ./test.xls

說明:

./iozone:運行iozone工具;

  -a:進行全面測試;

  -n 1g:測試最小文件為1g;

  -g 4g:  測試最大文件為4g;

  -I 0:  測試模式為寫;

  -f:   測試文件為:/test.txt;

  -Rb: 將測試結果放入test.xls;

測試結果如下圖所示:

測試結果分析:

 打開test.xls文件:

在excel文件中,說明了這個表單關於write的測試結果,最左側一列是測試文件的大小(Kbytes);最上的橫行,是記錄大小;中間數據是測試的傳輸數據。

如,213749:表示測試文件大小為1G,以記錄大小為1m來進行傳輸,它的傳輸速度為213749kbytes/s。

常用測試命令:

./iozone -R -a -b hvs-iozone.xls -c -i 0 -i 1 -i 2 -i 3 -i 4 -i 5 -i 8 

該命令中,-a表示使用全自動模式進行測試,並根據測試結果生成excel測試文件,程序生成的所有測試單次操作從4k到16M不等;文件尺寸從64k到512m不等;測試中-c表示包含close操作的時間,這在網絡文件系統中起到一定作用。命令中表示對 0=write/rewrite, 1=read/re-read,2=random-read/write,3=Read-backwards,4=Re-write-record, 5=stride-read, 8=random mix 這幾種讀寫模式進行測試;測試結果輸出在命令行中,同時在輸出 hvs-iozone.xls 文件中;

參考鏈接:

http://www.iozone.org/docs/IOzone_msword_98.pdf  (推薦)

https://www.cnblogs.com/ykhyq/p/9627843.html

保持更新,資源來源自網絡。如果對您有幫助,請點擊推薦給予鼓勵吧。cnblogs.com/xuyaowen


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM