用bonnie測試硬碟

tonykorn97發表於2007-05-11

最近測試陣列櫃,學習了三個程式,分別是:
iozone,xdd,bonnie
總的來說,各有優缺點。

iozone命令測試的專案比較多,結果也比較多,需要耐心察看,但是不能測試裸裝置。
xdd可以測試裸裝置,但是可以察看的結果指標也比較少。
bonnie也不能測試裸裝置,相對於iozone來說專案結果比較少,相對比較清晰。

下面看一下bonnie的用法。


1,下載程式.

2,解壓:
[root@test root]# tar -zxvf bonnie.tar.gz
Makefile
Instructions
Bonnie.c
bonnie.1

3,編譯:
[root@test bonnie]# ls -al
總用量 40
drwxr-xr-x 2 root root 4096 5?? 11 21:46 .
drwxr-x--- 15 root root 4096 5?? 11 21:46 ..
-rw-rw-r-- 1 468 ftp 2451 1996-08-29 bonnie.1
-rw-r--r-- 1 468 ftp 17816 1996-08-29 Bonnie.c
-rw-r--r-- 1 468 ftp 551 1996-08-29 Instructions
-rw-r--r-- 1 468 ftp 237 1996-08-29 Makefile
[root@test bonnie]# make
Options are "make bsd" and "make SysV" - the default is "bsd".
If you get messages about missing functions, try "make SysV."
make Bonnie
make[1]: Entering directory `/root/bonnie'
cc -O Bonnie.c -o Bonnie
make[1]: Leaving directory `/root/bonnie'
[root@test bonnie]# ls
Bonnie bonnie.1 Bonnie.c Instructions Makefile

4,命令非常簡單,只有幾個選項:
The Bonnie command line, given here in Unix style, is:


Bonnie [-d scratch-dir] [-s size-in-Mb] [-m machine-label] [-html]

All the things enclosed in square brackets may be left out. The meaning of the things on this line is:

Bonnie
The name of the program. You might want to give it a different name. If you are sitting in the same directory as the program, you might have to use something like ./Bonnie.

-d scratch-dir
The name of a directory; Bonnie will write and read scratch files in this directory. Bonnie does not do any special interpretation of the directory name, simply uses it as given. Suppose you used -d /raid1/TestDisk; Bonnie would write, then read back, a file whose name was something like /raid1/TestDisk/Bonnie.34251.
If you do not use this option, Bonnie will write to and read from a file in the current directory, using a name something like ./Bonnie.35152.
Bonnie does clean up by removing the file after using it; however, if Bonnie dies in the middle of a run, it is quite likely that a (potentially very large) file will be left behind.

-s size-in-Mb
The number of megabytes to test with. If you do not use this, Bonnie will test with a 100Mb file. In this discussion, Megabyte means 1048576 bytes. If you have a computer that does not allow 64-bit files, the maximum value you can use is 2047.
It is important to use a file size that is several times the size of the available memory (RAM) - otherwise, the operating system will cache large parts of the file, and Bonnie will end up doing very little I/O. At least four times the size of the available memory is desirable.

-m machine-label
This is the label that Bonnie will use to label its report. If you do not use this, Bonnie will use no label at all.

-html
If you use this, Bonnie will generate a report in HTML form, as opposed to plain text. This is not all that useful unless you are prepared to write a table header.

5,測試:
[root@test bonnie]# ./Bonnie -d /root -s 2048 -m jump
File too large for 32-bit machine, sorry
第一次出現錯誤,看作者的命令說明就知道了。

[root@test bonnie]# ./Bonnie -d /root -s 2046 -m jump
File '/root/Bonnie.24943', size: 2145386496
Writing with putc()...done
Rewriting...done
Writing intelligently...done
Reading with getc()...done
Reading intelligently...done
Seeker 1...Seeker 2...Seeker 3...start 'em...done...done...done...
-------Sequential Output-------- ---Sequential Input-- --Random--
-Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
Machine MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU /sec %CPU
jump 2046 13597 93.4 24547 17.8 12959 9.0 9682 59.7 32970 9.6 226.0 1.9

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/312079/viewspace-245660/,如需轉載,請註明出處,否則將追究法律責任。

相關文章