,欢迎访问网页设计爱好者web开发。
原文链接:
http://www.eygle.com/unix/use.bonnie++.to.test.io.speed.htm
由于bonnie存在一些众所周知的问题,比如>2g的文件支持.
russell coker ([email protected]) 开发了一套新的代码,用以支持>2g的文件等.
得到tim bray ([email protected])的许可之后,russell把他的软件命名为bonnie++,在网上发布,并开始流行起来.
目前的版本已经更新到了1.03a,你可以到以下地址下载:
http://www.coker.com.au/bonnie++/
你也可以点击这里下载,这个版本需要编译,如果你没有编译环境,可以点击这里下载我编译好的,适用于sun solaris环境(solaris8测试通过)
russell coker的个人主页是:
http://www.coker.com.au/
bonnie++ 与 bonnie的区别主要是:
http://www.coker.com.au/bonnie++/diff.html
我简单介绍一下bonnie++的编译及使用:
1.编译
你需要把以上下载的源码编译以后才能使用,如果你没有编译环境,可以点击这里下载我编译好的,适用于sun solaris环境(solaris8测试通过)
当然你需要安装make,及gcc等必要编译器.在编译过程中,如果遇到以下错误,可能是因为你没有设置正确的环境变量
$ ./configure
grep: illegal option -- q
usage: grep -hblcnsviw pattern file . . .
grep: illegal option -- q
usage: grep -hblcnsviw pattern file . . .
checking for g++... g++
checking for c++ compiler default output... a.out
checking whether the c++ compiler works... configure: error: cannot run c++ compiled programs.
if you meant to cross compile, use `--host'.
see `config.log' for more details.
设置环境变量后继续编译,一般可以成功.
# export ld_library_path=/usr/lib:/usr/local/lib
# ./configure
grep: illegal option -- q
usage: grep -hblcnsviw pattern file . . .
grep: illegal option -- q
usage: grep -hblcnsviw pattern file . . .
checking for g++... g++
checking for c++ compiler default output... a.out
checking whether the c++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the gnu c++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the c++ preprocessor... g++ -e
checking for a bsd-compatible install... /usr/bin/install -c
checking for an ansi c-conforming const... yes
checking for egrep... egrep
checking for ansi c header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... no
checking for unistd.h... yes
checking for size_t... yes
checking vector.h usability... yes
checking vector.h presence... yes
checking for vector.h... yes
checking vector usability... yes
checking vector presence... yes
checking for vector... yes
checking algorithm usability... yes
checking algorithm presence... yes
checking for algorithm... yes
checking algo.h usability... yes
checking algo.h presence... yes
checking for algo.h... yes
checking algo usability... no
checking algo presence... no
checking for algo... no
configure: creating ./config.status
config.status: creating makefile
config.status: creating bonnie.h
config.status: creating port.h
config.status: creating bonnie++.spec
config.status: creating bon_csv2html
config.status: creating bon_csv2txt
config.status: creating sun/pkginfo
config.status: creating conf.h
config.status: conf.h is unchanged
编译完成之后会生成bonnie++,可以用来测试了.
2.下面是一些测试结果
a.t3大文件读写测试
# ./bonnie++ -d /data1 -u root -s 4096 -m billingusing uid:0, gid:1.writing with putc()...donewriting intelligently...donerewriting...donereading with getc()...donereading intelligently...donestart 'em...done...done...done...create files in sequential order...done.stat files in sequential order...done.delete files in sequential order...done.create files in random order...done.stat files in random order...done.delete files in random order...done.version 1.03 ------sequential output------ --sequential input- --random- -per chr- --block-- -rewrite- -per chr- --block-- --seeks--machine size k/sec %cp k/sec %cp k/sec %cp k/sec %cp k/sec %cp /sec %cpbilling 4g 9915 87 30319 56 11685 38 9999 99 47326 66 177.6 3 ------sequential create------ --------random create-------- -create-- --read--- -delete-- -create-- --read--- -delete-- files /sec %cp /sec %cp /sec %cp /sec %cp /sec %cp /sec %cp 16 639 19 +++++ +++ 1258 22 679 16 +++++ +++ 1197 27billing,4g,9915,87,30319,56,11685,38,9999,99,47326,66,177.6,3,16,639,19,+++++,+++,1258,22,679,16,+++++,+++,1197,27
b. emc clariion cx500 测试数据
这个是在我禁用了写cache以后的测试数据:
4块盘的raid1+0测试:
# ./bonnie++ -d /eygle -u root -s 4096 -m jump using uid:0, gid:1.file size should be double ram for good results, ram is 4096m.# ./bonnie++ -d /eygle -u root -s 8192 -m jumpusing uid:0, gid:1.writing with putc()...donewriting intelligently...donerewriting...donereading with getc()...donereading intelligently...donestart 'em...done...done...done...create files in sequential order...done.stat files in sequential order...done.delete files in sequential order...done.create files in random order...done.stat files in random order...done.delete files in random order...done.version 1.03 ------sequential output------ --sequential input- --random- -per chr- --block-- -rewrite- -per chr- --block-- --seeks--machine size k/sec %cp k/sec %cp k/sec %cp k/sec %cp k/sec %cp /sec %cpjump 8g 12647 36 13414 8 7952 13 33636 97 146503 71 465.7 5 ------sequential create------ --------random create-------- -create-- --read--- -delete-- -create-- --read--- -delete-- files /sec %cp /sec %cp /sec %cp /sec %cp /sec %cp /sec %cp 16 86 1 +++++ +++ 161 1 81 1 +++++ +++ 163 1jump,8g,12647,36,13414,8,7952,13,33636,97,146503,71,465.7,5,16,86,1,+++++,+++,161,1,81,1,+++++,+++,163,1
4块盘的raid5,禁用写cache后的速度:
# ./bonnie++ -d /eygle -u root -s 8192 -m jumpusing uid:0, gid:1.writing with putc()...donewriting intelligently...donerewriting...donereading with getc()...donereading intelligently...donestart 'em...done...done...done...create files in sequential order...done.stat files in sequential order...done.delete files in sequential order...done.create files in random order...done.stat files in random order...done.delete files in random order...done.version 1.03 ------sequential output------ --sequential input- --random- -per chr- --block-- -rewrite- -per chr- --block-- --seeks--machine size k/sec %cp k/sec %cp k/sec %cp k/sec %cp k/sec %cp /sec %cpjump 8g 10956 30 10771 6 3388 5 34169 98 158861 75 431.1 5 ------sequential create------ --------random create-------- -create-- --read--- -delete-- -create-- --read--- -delete-- files /sec %cp /sec %cp /sec %cp /sec %cp /sec %cp /sec %cp 16 81 1 +++++ +++ 160 1 82 1 +++++ +++ 109 1jump,8g,10956,30,10771,6,3388,5,34169,98,158861,75,431.1,5,16,81,1,+++++,+++,160,1,82,1,+++++,+++,109,1
对比这两个结果我们发现(单位k/sec):
字符写block写字符读block读raid1012,64713,41433,636146,503raid510,95610,77134,169158,861diff1,6912,643-533-12,358
我们看到,在直接读写上,写raid10会略快于raid5;而在读取上,raid5会略快于raid10,这符合我们通常的观点.
这里需要提一下的是,通常我们建议把redolog file存放在raid10的磁盘上,因其具有写优势.