測試工具iometer, iozone, bonnie++

iometeriozone bonnie++

IOMeter是用來做塊級存儲測試IO性能的工具,比較適合做SANDAS存儲的測試,卻不適合做針對NAS或者文件系統的測試。雖然它可以運行在文件系統之上,但是其方式是在文件系統中創建一個大的文件,然後再往這個大文件中讀寫塊,這個模擬過程是不能完全反映文件系統的特性的。所以大部分對文件系統(包括NAS)的測試 工具一般選用IOZoneBonnie++等。

 

Iometer
Iometer是一個測試簡單系統和集羣系統下的IO子系統性能的工具;其中dynamometer起到引擎的作用(也就是負載生成器),iometer經常被當作測量工具,其實它也是一個負載生成器workload generator,通過配置可以將iometer仿真爲任意程序或benchmark下的磁盤IO負載或網絡IO負載,或用於生成合成IO負載。
IOmeter用於以下幾個方面:
1
Performance of disk and network controllers.//磁盤和網絡控制器的性能;
2
Bandwidth and latency capabilities of buses.//總線帶寬和延遲;
3
Network throughput to attached drives.      //到附聯驅動器的網絡帶寬;
4
Shared bus performance.                     //共享的總線性能;
5
System-level hard drive performance.        //系統級硬盤驅動器性能;  
6
System-level network performance.           //系統級網絡性能;

測試時分兩種情況:單機環境和網絡環境;
在單機環境下,運行iometer.exe,它自動運行dynamo,在iometer控制界面裏可設置測試參數;
在網絡環境下,也有幾種測試方式,最簡單也是最常用的方式是採用網絡映射方式將遠程目錄映射成本機的一個盤符,然後按照單機情況進行測試;

iozone
主頁地址: http://www.iozone.org
通過如下操作測試文件IO性能:read, write, re-read, re-write, read backwards, read strided, fread,fwrite, random read, pread, mmap, aio_read, aio_write.
iozone
具有如下特性:
ANSII C source 
POSIX async I/O 
Mmap() file I/O 
Normal file I/O 
Single stream measurement 
Multiple stream measurement 
Distributed fileserver measurements (Cluster) //
這個特性很實用 
POSIX pthreads 
Multi-process measurement 
Excel importable output for graph generation  //
一個有用的特性
Latency plots 
64bit compatible source 
Large file compatible 
Stonewalling in throughput tests to eliminate straggler effects 
Processor cache size configurable 
Selectable measurements with fsync, O_SYNC //bonnie++
最近版本已經加入fsync這一阻塞機制了,保證測試結果的真實性(有沒有同步並刷新到磁盤文件中,性能差別很大)
Builds for: AIX, BSDI, HP-UX, IRIX, FreeBSD, Linux, OpenBSD, NetBSD, OSFV3, OSFV4, OSFV5, SCO OpenServer, Solaris, Windows95/98/NT       //
支持的平臺真是多。

安裝及測試過程如下:
解壓:tar xvf iozone3_237.tar
進入src/current目錄;
敲入 make linux          //linux表示目標平臺;
編譯生成目標文件iozone

進行測試:比如 iozone -a;//所有參數都是缺省的,並完成所有的文件操作;
iozone -s15m -i0 -i1 -t50
:其含義如下:-s15m(文件的大小爲15MB);-i0(寫/重寫操作);-i1(讀/重讀操作);
-t50
(工作在throughput模式,並且線程數爲50
當然還有-u 就是工作在CPU利用率模式了,具體細節參考IOzone_msword_98.pdf

bonnie++
http://www.textuality.com/bonnie/
bonnie++
勝在簡單,不過準確性稍差
在編譯過程中,如果遇到以下錯誤,可能是因爲你沒有設置正確的環境變量,設置環境變量後繼續編譯,一般可以成功
# export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
# ./configure
編譯完成之後會生成bonnie++,可以用來測試了.

bonnie++[-d scratch-dir] 
測試目錄
        [-s size(Mb)[:chunk-size(b)]]
文件大小:塊大小  默認大小:300M8K             
        [-n number-to-stat[:max-size[:min-size][:num-directories]]]
文件創建測試的文件數n*1024,最大文件大小,最小文件大小,目錄數,max=-1hard link,-2soft link
        [-m machine-name]
機器名,僅用於顯示
        [-r ram-size-in-Mb]
機器內存大小
        [-x number-of-tests] test
數量
        [-u uid-to-use:gid-to-use] 
測試所用的用戶名:組名
        [-g gid-to-use]
        [-q]
安靜模式
        [-f]
快速模式,不進行單字符IO測試
        [-b]
不使用寫緩存
        [-p processes | -y] bonnie++
進程數,使用信號量同步多個進程
    [-y] 
每個測試開始之前等待信號量

測試實例:
bonnie++  -s 40 -r 1 -n 0 -u 0 -f>>bonnietest  
(生成的文件名)
bonnie++ -m go –d /tmp –s 30:512 –n 1 –r 2 –x 2 –u 0>>test

結果處理:
測試時,將測試結果重定向到文件,得到的文件內容如上所示
結果可以直接導入excel(新建一個文件,然後是菜單中的數據->導入外部數據)。得到結果中會有+++++的內容
+++++
的含義: 當所用時間小於1s的時候,結果不準確,所以不給出

結果項解析:
Sequential Output(
順序寫入
per char utc(),
每次一個字符,順序寫入,完成整個文件 
The CPU overhead here is that required to do the stdio code plus the OS file space allocation.
block
:每次一個塊,順序寫入,完成整個文件, 
The CPU overhead should be just the OS file space allocation.
rewrite
:每次讀出一個塊,修改其中一個字節,然後寫回 
this should test the effectiveness of the filesystem cache and the speed of data transfer.

Sequential Input(
順序讀出)
per char
get(),每次一個字符,順序讀出,完成整個文件 
This should exercise only stdio and sequential input. 
block
:每次一個塊,順序讀出,完成整個文件 
This should be a very pure test of sequential input performance. 

Random Seeks(
隨機尋道)
3
seeks進程,8K個隨機尋道操作,每次都是整塊讀出,%10得情況,修改一個字節,然後寫回

Sequential Create 
(建立文件時,是真正將文件寫入磁盤的)
create
read(stat) 
順序遍歷所有文件:操作:讀取文件屬性,如果文件大小不爲0,還要對文件內容進行讀取,
delete  
順序刪除所有文件

Random Create
create
read(stat) 
按隨機順序遍歷文件,文檔中說這一步不會遍歷所有文件,但是代碼裏邊反應的情況好像不是這樣
delete 
按隨機順序刪除所有文件

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章