iozone介绍:
iozone(www.iozone.org)是一个文件系统的benchmark工具,可以测试不同的操作系统中文件系统的读写性能。
可以测试 Read, write, re-read,re-write, read backwards, read strided, fread, fwrite, random read, pread,
mmap, aio_read, aio_write 等等不同的模式下的硬盘的性能。
测试的时候请注意,设置的测试文件的大小一定要大过你的内存(最佳为内存的两倍大小),不然linux会给你的读写的内容进行缓存。会使数值非常不真实.
-R 产生execl格式的输出日志。
-b 将产生二进制的execl的日志文件名。
-s 测试的文件大小。
-q 指定最大文件块大小(这里的 -q 64k 包括了4K,8K,16K,32K,64K)
-r 指测试的文件块大小(与-q有别,-r 64k只进行64k的测试)
-a 在希望的文件系统上测试,不过只有-a的话会进行全面测试,要花费很长时间,最好用-i指定测试范围。
-g 指定最大测试文件大小。 内存2倍
-n 指定最小测试文件大小。
-f 指定测试文件的名字,完成后会自动删除(这个文件必须指定在你要测试的那个硬盘中)
-C 显示每个节点的吞吐量。
-c 测试包括文件的关闭时间
-i Test 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/Re-preadv)
mount -o oldalloc,data=writeback,barrier=0,delalloc /dev/sda1 /smbshare
echo 512 > /sys/block/sda/bdi/read_ahead_kb
iozone -Rab /smbshare/iozone_result_5.xls -i 0 -i 1 -f /smbshare/test -n 32M -g 32768M -r 64k
root@localhost:~# iozone -Rab result.xls -i 0 -i 1 -ff -n 32M -g 8G -r 64k
Iozone: Performance Test of File I/O
Version $Revision: 3.429 $
Compiled for 64 bit mode.
Build: linux
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, Gavin Brebner,
Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy, Dave Boone,
Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root,
Fabrice Bacchella, Zhenghua Xue, Qin Li, Darren Sawyer,
Vangel Bojaxhi, Ben England, Vikentsi Lapa.
Run began: Sun Jan 28 16:35:38 2018
Excel chart generation enabled
Auto Mode
Using minimum file size of 32768 kilobytes.
Using maximum file size of 8388608 kilobytes.
Record Size 64 kB
Command line used: iozone -Rab result.xls -i 0 -i 1 -ff -n 32M -g 8G -r 64k
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
32768 64 555107 1338180 2797807 1848594
65536 64 574681 1423582 3353936 2655419
131072 64 594045 1511647 3986632 2772248
262144 64 598673 1550615 3989218 2975128
524288 64 601571 1581791 4214264 2976420
1048576 64 603374 1575990 4298040 3135480
2097152 64 602160 1528101 4314896 3055411
4194304 64 94928 92062 4232797 3028750
8388608 64 58680 59060 4149015 3010132
iozone test complete.
Excel output is below:
"Writer report"
"64"
"32768" 555107
"65536" 574681
"131072" 594045
"262144" 598673
"524288" 601571
"1048576" 603374
"2097152" 602160
"4194304" 94928
"8388608" 58680
"Re-writer report"
"64"
"32768" 1338180
"65536" 1423582
"131072" 1511647
"262144" 1550615
"524288" 1581791
"1048576" 1575990
"2097152" 1528101
"4194304" 92062
"8388608" 59060
"Reader report"
"64"
"32768" 2797807
"65536" 3353936
"131072" 3986632
"262144" 3989218
"524288" 4214264
"1048576" 4298040
"2097152" 4314896
"4194304" 4232797
"8388608" 4149015
"Re-Reader report"
"64"
"32768" 1848594
"65536" 2655419
"131072" 2772248
"262144" 2975128
"524288" 2976420
"1048576" 3135480
"2097152" 3055411
"4194304" 3028750
"8388608" 3010132