Chinaunix首页 | 论坛 | 博客
  • 博客访问: 567304
  • 博文数量: 118
  • 博客积分: 2114
  • 博客等级: 大尉
  • 技术积分: 1275
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-10 00:02
文章分类

全部博文(118)

文章存档

2019年(1)

2018年(4)

2017年(1)

2016年(6)

2015年(1)

2014年(1)

2013年(5)

2012年(4)

2011年(17)

2010年(13)

2009年(65)

分类: 系统运维

2011-08-17 13:26:47



iozone介绍:

iozone()是一个文件系统的benchmark工具,可以测试不同的操作系统中文件系统的读写性能。
可以测试 Read, write, re-read,re-write, read backwards, read strided, fread, fwrite, random read, pread,
mmap, aio_read, aio_write 等等不同的模式下的硬盘的性能。

测试参数: -i # 用来指定测试内容.

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/Re-preadv

测试格式为-i #,比如测试写:-i 0,测试读和写:-i 0 -i 1。

-R 产生execl格式的输出日志。

-b 将产生二进制的execl的日志文件名。

-s 测试的文件大小。

-r 文件块大小。

-a 在希望的文件系统上测试,不过只有-a的话会进行全面测试,要花费很长时间,最好用-i指定测试范围。

-g 指定最大测试文件大小。

-n 指定最小测试文件大小。

-f 指定测试文件。

-C 显示每个节点的吞吐量。

-c 测试包括文件的关闭时间

用tee命令生成log信息。

./iozone -g 2G -n 512M -i 0 -i 1 -f /mnt/test -Rab /home/iozone.xls -C | tee /home/iozone.log

iozone的日志文件写入到了iozone.log内。

测试实例

$ iozone -i 0 -i 1 -Rab ~/test-iozone.xls -g 4M -n 1M -C
通过iozone测试硬盘性能
通过iozone测试硬盘性能

---------------------------------------------------------------
iozone的确是一款不错的文件系统性能测试工具,可以就文件系统的很多方面作自动测试。地址:

用法:

在希望进行测试的文件系统上运行:
/opt/iozone/bin/iozone -a
即可进行全面的自动测试,不过通常需要很长的时间,要耐心等待。

/opt/iozone/bin/iozone -a -i 1
只对write, rewrite进行性能测试

/opt/iozone/bin/iozone -a -i 1 -i 0
对读写进行性能测试

/opt/iozone/bin/iozone -a -g 1G -i 0 -i 1
对读写进行性能测试,并且最大测试文件为1G

/opt/iozone/bin/iozone -Ra
测试所有方面,并且生成excel文件
上面的命令在执行时,最好通过重定向保存到另外一个文件中.
/opt/iozone/bin/iozone –Rab output.wks

测试小文件
/opt/iozone/bin/iozone -a -s 512m -y 1k -q 8k -b minfile_result.xls

测试普通文件
如果2G内存测试,时间太长,先在grub.conf里把内存变成256m,这时使用512m的文件测试,就不会使用缓存了。
可以保证测试的准确性
/opt/iozone/bin/iozone -a -s 512m -y 8k -q 512k -b comfile_result.xls

测试大文件
/opt/iozone/bin/iozone -a -s 512m -y 1024k -q 10240k -i 0 -i 1 -i 2 -b largefile_result.xls

测试-i命令的使用
/opt/iozone/bin/iozone -Rab output.wks -g 1G -i 0 -i 1 -i 2 -i 8


-R 创建 Excel 报告

-g 设置自动模式下最大文件大小
Set maximum file size (in Kbytes) for auto mode.

-s 指定文件大小
-s 512k or -s 512M or -s 1G

-f filename
指定临时文件

-F filename filename filename
指定临时文件组

-t #
线程数

-q 指定最大记录大小
-q 512K or -q 512M or -q 1g

-y 指定最小记录大小
-y 512K or -q 512M or -q 1g

-U mountpoint
Mount point to unmount and remount between tests. Iozone will unmount and remount
this mount point before beginning each test. This guarantees that the buffer cache does not
contain any of the file under test.

 

通常情况下,测试的文件大小要求至少是系统cache的两倍以上,这样,测试的结果才是真是可信的。如果小于cache的两倍,文件的读写测试读写的将是cache的速度,测试的结果大打折扣。


root@cnxass03:/data/export/scratch_dev# ./iozone -g 64G -n 32G -i 0 -i 1 -Rab 2g.xls -C |tee 2g.xls.log
Iozone: Performance Test of File I/O
Version $Revision: 3.217 $
Compiled for 32 bit mode.
Build: Solaris

Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins
Al Slater, Scott Rhine, Mike Wisner, Ken Goss
Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR,
Randy Dunlap, Mark Montague, Dan Million,
Jean-Marc Zucconi, Jeff Blomberg,
Erik Habbinga, Kris Strecker.

Run began: Tue May 25 14:21:19 2010

Using maximum file size of 67108864 kilobytes.
Using minimum file size of 33554432 kilobytes.
Excel chart generation enabled
Auto Mode
Command line used: ./iozone -g 64G -n 32G -i 0 -i 1 -Rab 2g.xls -C
Output is in Kbytes/sec
Time Resolution = 0.000001 seconds.
Processor cache size set to 1024 Kbytes.
Processor cache line size set to 32 bytes.
File stride size set to 17 * record size.
random random bkwd record stride
KB reclen write rewrite read reread read write read rewrite read fwrite frewrite fread freread
33554432 64 1179901 64467 1298656 1258552
33554432 128 1957763 2034826 1327885 1248860
33554432 256 1727353 2271494 1256912 1208756
33554432 512 2034995 2101127 1309971 1279301
33554432 1024 1603967 2231453 1291523 1215190
33554432 2048 2126641 2160447 1291470 1259356
33554432 4096 1650188 2328070 1208303 1263471
33554432 8192 1977145 2002877 1293798 1280477
33554432 16384 1787942 2099042 1263556 1222422
67108864 64 1383547 69126 1272727 1295236
67108864 128 1786769 2045967 1265844 1269528
67108864 256 1712783 2028069 1239074 1242208
67108864 512 1770225 2170509 1243233 1253971
67108864 1024 1748895 2107569 1236184 1255013
67108864 2048 1793233 1520185 1253480 1292460
67108864 4096 1824722 2025322 1240704 1262159
67108864 8192 1663788 1871600 1245255 1258735
67108864 16384 1668012 2101345 1219521 1246345

iozone test complete.
Excel output is below:

"Writer report"
"4" "8" "16" "32" "64" "128" "256" "512" "1024" "2048" "4096" "8192" "16384"
"33554432" 0 0 0 0 1179901 1957763 1727353 2034995 1603967 2126641 1650188 1977145 1787942
"67108864" 0 0 0 0 1383547 1786769 1712783 1770225 1748895 1793233 1824722 1663788 1668012

"Re-writer report"
"4" "8" "16" "32" "64" "128" "256" "512" "1024" "2048" "4096" "8192" "16384"
"33554432" 0 0 0 0 64467 2034826 2271494 2101127 2231453 2160447 2328070 2002877 2099042
"67108864" 0 0 0 0 69126 2045967 2028069 2170509 2107569 1520185 2025322 1871600 2101345

"Reader report"
"4" "8" "16" "32" "64" "128" "256" "512" "1024" "2048" "4096" "8192" "16384"
"33554432" 0 0 0 0 1298656 1327885 1256912 1309971 1291523 1291470 1208303 1293798 1263556
"67108864" 0 0 0 0 1272727 1265844 1239074 1243233 1236184 1253480 1240704 1245255 1219521

"Re-Reader report"
"4" "8" "16" "32" "64" "128" "256" "512" "1024" "2048" "4096" "8192" "16384"
"33554432" 0 0 0 0 1258552 1248860 1208756 1279301 1215190 1259356 1263471 1280477 1222422
"67108864" 0 0 0 0 1295236 1269528 1242208 1253971 1255013 1292460 1262159 1258735 1246345
阅读(1473) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~