iozone是一个文件系统的benchmark工具,可以测试不同的操作系统中文件系统的读写性能。
可以测试 Read, write, re-read,re-write, read backwards,
read strided, fread, fwrite, random read, pread,
mmap, aio_read, aio_write
等等不同的模式下的硬盘的性能。
测试的时候请注意,设置的测试文件的大小一定要大过你的内存(最佳为内存的两倍大小),不然linux会给你的读写的内容进行缓存。会使数值非常不真实。
IOZONE安装包
iozone3_430.tar
IOZONE安装步骤
[root@linux156 bin]# tar -xvf iozone3_430.tar
[root@linux156 bin]# cd
/usr/linkapp/bin/iozone3_430/src/current/
[root@linux156 current]# make linux
查找:
[root@linux156 iozone3_430]# find /-name iozone
IOZONE测试命令
[root@linux156 current]# ./iozone -zx -b iozone-test.xls
-g 8g -y 64k -i 0 -i 1
说明:
-az——执行不同粒度(record
size)和测试文(file
size)的自动化测试,默认情况下record
size从4K—16M,file
size从64K—512M。
-b——指定测试后生成的excel文件。
-g——指定最大的file
size大小。(一般为内存的两倍)
-y——指定最小的record
size数值。
-i——指定测试的种类。(0代表write/rewrite,1代表read/re-read
IOZONE执行结果
[root@linux156 current]# ./iozone -zx -b
iozone-test.xls -g 8g -y 64k -i 0 -i 1
Iozone: Performance Test of File I/O
Version $Revision: 3.430 $
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: Thu May 7 16:09:36 2015
Cross over of record size disabled.
Stonewall disabled
Using maximum file size of 8388608 kilobytes.
Using Minimum Record Size 64 kB
Command line used: ./iozone -zx -b iozone-test.xls -g 8g -y 64k -i
0 -i 1
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
512
4 539459
1391933 3220553
3970896
iozone test complete.
Excel output is below:
"Writer report"
"64"
"128" "256"
"512" "1024"
"2048" "4096"
"8192" "16384"
"512"
539459
"Re-writer report"
"64"
"128" "256"
"512" "1024"
"2048" "4096"
"8192" "16384"
"512"
1391933
"Reader report"
"64"
"128" "256"
"512" "1024"
"2048" "4096"
"8192" "16384"
"512"
3220553
"Re-Reader report"
"64"
"128" "256"
"512" "1024"
"2048" "4096"
"8192" "16384"
"512"
3970896
说明:
左侧第一列:测试文件大小
左侧第二列:record size
后面几列为对应不通测试方法的测试结果(单位为kb/s)
FIO说明
FIO是测试IOPS的非常好的工具,用来对硬件进行压力测试和验证,支持13种不同的I/O引擎,包括:sync,mmap,
libaio, posixaio, SG v3, splice, null, network, syslet, guasi,
solarisaio
等等。fio
官网地址:http://freshmeat.net/projects/fio/
FIO安装包
fio-2.1.10.tar.gz
libaio-devel-0.3.107-8.fc11.s390x.rpm
FIO安装步骤
[root@linux156 bin]#rpm -ivh
libaio-devel-0.3.107-8.fc11.s390x.rpm
[root@linux156 bin]# tar -zxvf
fio-2.0.10.tar.gz
[root@linux156 bin]#cd fio-2.0.10.tar.gz
[root@linux156 bin]#cd fio-2.0.10
[root@linux156 bin]./configure
[root@linux156 bin]make
[root@linux156 bin]make install
FIO测试命令
1)sync
- Randread
[root@linux156 bin]#
fio -filename=/usr/linkapp/fio-test01
-direct=1 -rw=randread -size 5G -numjobs=8 -runtime=120
-group_reporting -name=randread_4_psync
randread_4_psync: (g=0): rw=randread,
bs=4K-4K/4K-4K/4K-4K, ioengine=sync, iodepth=1
...
fio-2.1.10
Starting 8 processes
randread_4_psync: Laying out IO file(s) (1 file(s) /
5120MB)
Jobs: 8 (f=8): [rrrrrrrr] [100.0% done] [4439KB/0KB/0KB
/s] [1109/0/0 iops] [eta 00m:00s]
randread_4_psync: (groupid=0, jobs=8): err= 0: pid=6070:
Thu May 7 17:50:02 2015
read : io=554892KB,
bw=4623.9KB/s,iops=1155,
runt=120006msec
clat (usec):
min=204, max=127599, avg=6914.62, stdev=4660.99
lat (usec): min=205, max=127599, avg=6914.96,
stdev=4660.99
clat percentiles (usec):
| 1.00th=[ 1400], 5.00th=[
2192], 10.00th=[ 2832], 20.00th=[ 3664],
| 30.00th=[ 4320], 40.00th=[ 4960], 50.00th=[ 5664], 60.00th=[
6496],
| 70.00th=[ 7648], 80.00th=[ 9280], 90.00th=[12480], 95.00th=[15680],
| 99.00th=[24192], 99.50th=[28800], 99.90th=[39680],
99.95th=[43776],
| 99.99th=[60160]
bw
(KB /s): min= 419,
max= 725, per=12.50%, avg=578.10,
stdev=50.29
lat
(usec) : 250=0.02%, 500=0.05%, 750=0.03%, 1000=0.13%
lat
(msec) : 2=3.48%, 4=21.21%, 10=58.02%, 20=14.86%,
50=2.19%
lat
(msec) : 100=0.02%, 250=0.01%
cpu
: usr=0.11%, sys=0.53%, ctx=138852, majf=0, minf=282
IO
depths :
1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%,
>=64=0.0%
submit :
0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%,
>=64=0.0%
complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%,
32=0.0%, 64=0.0%, >=64=0.0%
issued :
total=r=138723/w=0/d=0, short=r=0/w=0/d=0
latency : target=0, window=0,
percentile=100.00%, depth=1
Run status group 0 (all jobs):
READ: io=554892KB,
aggrb=4623KB/s, minb=4623KB/s, maxb=4623KB/s, mint=120006msec,
maxt=120006msec
Disk stats (read/write):
sda: ios=138530/126, merge=0/81,
ticks=956991/3887, in_queue=960887, util=100.00%
2)sync
- randwrite
[root@linux156 bin]# fio
-filename=/usr/linkapp/fio-test01 -direct=1 -rw=randwrite -size 5G
-numjobs=8 -runtime=120 -group_reporting
-name=randread_4_psync
randread_4_psync: (g=0): rw=randwrite,
bs=4K-4K/4K-4K/4K-4K, ioengine=sync, iodepth=1
...
fio-2.1.10
Starting 8 processes
Jobs: 7 (f=7): [wwEwwwww] [0.1% done] [0KB/375KB/0KB /s]
[0/93/0 iops] [eta 02d:11h:29m:59s]
randread_4_psync: (groupid=0, jobs=8): err= 0: pid=6110:
Thu May 7 17:58:33 2015
write: io=47184KB,
bw=402395B/s, iops=98, runt=120072msec
clat (msec):
min=2, max=20768, avg=43.43, stdev=591.89
lat (msec): min=2, max=20768, avg=43.43, stdev=591.89
clat percentiles (msec):
|
1.00th=[
7],
5.00th=[ 8],
10.00th=[ 8],
20.00th=[
9],
| 30.00th=[
9], 40.00th=[ 10],
50.00th=[ 10],
60.00th=[ 11],
| 70.00th=[ 11],
80.00th=[ 12],
90.00th=[ 13],
95.00th=[ 17],
| 99.00th=[ 28],
99.50th=[ 41], 99.90th=[11076],
99.95th=[12780],
| 99.99th=[16712]
bw
(KB /s):
min= 0,
max= 447, per=76.78%, avg=300.97,
stdev=166.24
lat
(msec) : 4=0.01%, 10=60.01%, 20=37.50%, 50=2.03%,
100=0.04%
lat
(msec) : 750=0.01%, >=2000=0.40%
cpu
: usr=0.05%, sys=0.05%, ctx=23716, majf=0, minf=273
IO
depths :
1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%,
>=64=0.0%
submit
: 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%,
>=64=0.0%
complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%,
32=0.0%, 64=0.0%, >=64=0.0%
issued :
total=r=0/w=11796/d=0, short=r=0/w=0/d=0
latency : target=0, window=0,
percentile=100.00%, depth=1
Run status group 0 (all jobs):
WRITE: io=47184KB, aggrb=392KB/s,
minb=392KB/s, maxb=392KB/s, mint=120072msec,
maxt=120072msec
Disk stats (read/write):
sda: ios=0/11933, merge=0/145,
ticks=0/122419, in_queue=122417, util=99.60%
3)Libaio
– randwrite
分区
[root@linux156 bin]# fio
-ioengine=libaio -bs=4k -direct=1 -thread -rw=randwrite -size=100G
-filename=/dev/sda3 -name=4kb-randwrite-test -iodepth=32
-runtime=60
4kb-randwrite-test: (g=0): rw=randwrite,
bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=32
fio-2.1.10
Starting 1 thread
Jobs: 1 (f=1): [w] [0.0% done] [0KB/12KB/0KB /s] [0/3/0
iops] [eta 05d:20h:27m:36s]
4kb-randwrite-test: (groupid=0, jobs=1): err= 0: pid=7944:
Fri May 8 13:13:20 2015
write: io=12772KB,
bw=213837B/s, iops=52, runt= 61161msec
slat (usec): min=6, max=169, avg=19.00, stdev= 7.54
clat (msec):
min=99, max=5254, avg=610.66, stdev=558.00
lat (msec): min=99, max=5254, avg=610.68, stdev=558.00
clat percentiles (msec):
| 1.00th=[
159], 5.00th=[ 219],
10.00th=[ 269], 20.00th=[
322],
| 30.00th=[ 363], 40.00th=[
404], 50.00th=[ 449], 60.00th=[
490],
| 70.00th=[ 562], 80.00th=[
734], 90.00th=[ 1090], 95.00th=[ 1582],
| 99.00th=[ 3228], 99.50th=[ 3818], 99.90th=[ 5014], 99.95th=[
5211],
| 99.99th=[ 5276]
bw
(KB /s): min=
18, max= 374, per=100.00%, avg=208.68,
stdev=72.03
lat
(msec) : 100=0.03%, 250=7.77%, 500=53.65%, 750=19.04%,
1000=7.27%
lat
(msec) : 2000=8.89%, >=2000=3.35%
cpu
: usr=0.00%, sys=0.24%, ctx=3176, majf=0, minf=5
IO
depths :
1=0.1%, 2=0.1%, 4=0.1%, 8=0.3%, 16=0.5%, 32=99.0%,
>=64=0.0%
submit :
0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%,
>=64=0.0%
complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%,
32=0.1%, 64=0.0%, >=64=0.0%
issued :
total=r=0/w=3193/d=0, short=r=0/w=0/d=0
latency : target=0, window=0,
percentile=100.00%, depth=32
Run status group 0 (all jobs):
WRITE: io=12772KB, aggrb=208KB/s,
minb=208KB/s, maxb=208KB/s, mint=61161msec,
maxt=61161msec
Disk stats (read/write):
sda: ios=178/3253, merge=346/45,
ticks=19971/1939592, in_queue=2481531, util=100.00%
You have new mail in /var/spool/mail/root
4)Libaio
– randread 目录
[root@linux156 bin]# fio -directory=/home/test
-iodepth=64 -ioengine=libaio -direct=1 -rw=randread -bs=4k -size=1G
-numjobs=4 -runtime=20 -group_reporting
-name=test-rand-read3
test-rand-read3: (g=0): rw=randread, bs=4K-4K/4K-4K/4K-4K,
ioengine=libaio, iodepth=64
...
fio-2.1.10
Starting 4 processes
test-rand-read3: Laying out IO file(s) (1 file(s) /
1024MB)
test-rand-read3: Laying out IO file(s) (1 file(s) /
1024MB)
test-rand-read3: Laying out IO file(s) (1 file(s) /
1024MB)
test-rand-read3: Laying out IO file(s) (1 file(s) /
1024MB)
Jobs: 3 (f=3): [rrrE] [6.2% done] [12547KB/0KB/0KB /s]
[3136/0/0 iops] [eta 05m:15s]
test-rand-read3: (groupid=0, jobs=4): err= 0: pid=8888:
Fri May 8 14:09:38 2015
read : io=266628KB,
bw=13277KB/s, iops=3319, runt= 20082msec
slat (usec): min=2, max=81244, avg=999.62, stdev=5142.03
clat (msec):
min=1, max=1022, avg=76.05, stdev=37.53
lat (msec): min=1, max=1022, avg=77.05, stdev=37.95
clat percentiles (msec):
| 1.00th=[
15], 5.00th=[
25], 10.00th=[ 35],
20.00th=[ 46],
| 30.00th=[ 55],
40.00th=[ 63],
50.00th=[ 72],
60.00th=[ 81],
| 70.00th=[ 90],
80.00th=[ 103], 90.00th=[ 123],
95.00th=[ 141],
| 99.00th=[ 186], 99.50th=[
210], 99.90th=[ 297], 99.95th=[
359],
| 99.99th=[ 529]
bw
(KB /s): min= 2058, max= 4160, per=24.98%,
avg=3316.90, stdev=353.39
lat
(msec) : 2=0.01%, 4=0.02%, 10=0.50%, 20=2.11%, 50=22.50%
lat
(msec) : 100=52.85%, 250=21.81%, 500=0.19%, 750=0.01%,
1000=0.01%
lat
(msec) : 2000=0.01%
cpu
:
usr=0.21%, sys=0.86%, ctx=5912, majf=0, minf=374
IO
depths :
1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.2%,
>=64=99.6%
submit :
0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%,
>=64=0.0%
complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%,
32=0.0%, 64=0.1%, >=64=0.0%
issued :
total=r=66657/w=0/d=0, short=r=0/w=0/d=0
latency : target=0, window=0,
percentile=100.00%, depth=64
Run status group 0 (all jobs):
READ: io=266628KB,
aggrb=13276KB/s, minb=13276KB/s, maxb=13276KB/s, mint=20082msec,
maxt=20082msec
Disk stats (read/write):
sda: ios=66633/6, merge=18/3,
ticks=3196241/872, in_queue=3198791, util=99.61%
附录说明
1)配置参数说明
filename=/dev/sdb1
测试文件名称,通常选择需要测试的盘的data目录。
direct=1
测试过程绕过机器自带的buffer。使测试结果更真实。
rw=randwrite
测试随机写的I/O
rw=randrw
测试随机写和读的I/O
bs=16k
单次io的块文件大小为16k
bsrange=512-2048
同上,提定数据块的大小范围
size=5g
本次的测试文件大小为5g,以每次4k的io进行测试。
numjobs=30
本次的测试线程为30.
runtime=1000
测试时间为1000秒,如果不写则一直将5g文件分4k每次写完为止。
ioengine=psync
io引擎使用pync方式
rwmixwrite=30
在混合读写的模式下,写占30%
group_reporting
关于显示结果的,汇总每个进程的信息。
此外
lockmem=1g
只使用1g内存进行测试。
zero_buffers
用0初始化系统buffer。
nrfiles=8
每个进程生成文件的数量。
read
顺序读
write
顺序写
rw,readwrite
顺序混合读写
randwrite
随机写
randread
随机读
randrw
随机混合读写
2)测试结果说明
io总的输入输出量
bw:带宽
KB/s
iops:每秒钟的IO数
runt:总运行时间
lat
(msec):延迟(毫秒)
msec:
毫秒
usec:
微秒
加载中,请稍候......