存储/文件系统测试工具 - Iozone

上一篇 / 下一篇  2007-10-10 00:32:32 / 个人分类:存储测试工具

h3y0AKF{-}1v1H0Overview

)X[)M8Vtm.f0

YbU5Tr9rQ S Q `4}T0IOzone is a filesystem benchmark tool. The benchmark generates and measures a variety of file operations. Iozone has been ported to many machines and runs under many operating systems.  This document will cover the many different types of operations that are tested as well as coverage of all of the command line options. 51Testing软件测试网%_&`J2t;j

du?#w0U:]+V4v(B6m0Features

qa-jU6j/r u2Q0
51Testing软件测试网 m4]a7zA5qu

ANSII ‘C’ source.51Testing软件测试网ap'^9h;h4K}]k
POSIX async I/O.51Testing软件测试网RFHK1j(V|
Mmap() file I/O.
^,wV:n_&`I'Y0Normal file I/O.51Testing软件测试网l W/| xY!Ha O [
Single stream measurement.
@Wx5j1rT$V0Multiple stream measurement.51Testing软件测试网*HS;J`%o'j
POSIX pthreads.
z)G)Dv${4j4U'B4K,K0Multi-process measurement.51Testing软件测试网Z3H s1T [ u
Excel importable output for graph generation.51Testing软件测试网P!fK)oQb/p4nP
I/O Latency data for plots.51Testing软件测试网e3cM B.`
64-bit compatible source.
Gii(\O1S:t0Large file compatible.
.BYp d&Z$q&n.J1T0Stonewalling in throughput tests to eliminate straggler effects.51Testing软件测试网Rp:e&Vm.O
Processor cache size configurable.51Testing软件测试网s.Y'VJ0Y:w
Selectable measurements with fsync, O_SYNC.
/fdf9X|q8T0Options targeted for testing over NFS.51Testing软件测试网,u$c_W%I:Q8~1@1t)XF

51Testing软件测试网m3h$XXv.UrI z.]O*Y

Definitions of the tests51Testing软件测试网t%N+xA9Q

51Testing软件测试网"oOL+Y gi+W6@ j bh

The benchmark tests file I/O performance for the following operations.
*{{jl0h/` }#{"i0Read, write, re-read, re-write, read backwards, read strided, fread, fwrite, random read/write, pread/pwrite variants, aio_read, aio_write, mmap.51Testing软件测试网 g:n n%L#Nv.C6wI

#|~?fR,VK K0Write:  This test measures the performance of writing a new file. When a new file is written not only does the data need to be stored but also the overhead information for keeping track of where the data is located on the storage media. This overhead is called the “metadata” It consists of the directory information, the space allocation and any other data associated with a file that is not part of the data contained in the file.  It is normal for the initial write performance to be lower than the performance of re-writing a file due to this overhead information.

t}(hmMT0

De4^9v@:G"p0Re-write:This test measures the performance of writing a file that already exists. When a file is written that already exists the work required is less as the metadata already exists. It is normal for the rewrite performance to be higher than the performance of writing a new file.

V2t3`&H\051Testing软件测试网+lZ#G4g6L(l

Read:This test measures the performance of reading an existing file.51Testing软件测试网2w#nxY!~8\

+Y z {Wn/f0Re-Read:This test measures the performance of reading a file that was recently read. It is normal for the performance to be higher as the operating system generally maintains a cache of the data for files that were recently read. This cache can be used to satisfy reads and improves the performance.

T}x:l9BY051Testing软件测试网'L+K!t-vj

Random Read:This test measures the performance of reading a file with accesses being made to random locations within the file. The performance of  a system under this type of activity can be impacted by several factors such as: Size of operating system’s cache, number of disks, seek latencies, and others.

3~ Ln XEb+}vG051Testing软件测试网#Iw'm4o#\C;j

Random Write:This test measures the performance of writing a file with accesses being made to random locations within the file. Again the performance of a system under this type of activity can be impacted by several factors such as: Size of operating system’s cache, number of disks, seek latencies, and others.51Testing软件测试网f,c&e`3a&e.W$I

y%eX2Y3p[Qm0Random Mix:This test measures the performance of reading and writing a file with accesses being made to random locations within the file. Again the performance of a system under this type of activity can be impacted by several factors such as: Size of operating system’s cache, number of disks, seek latencies, and others. This test is only available in throughput mode. Each thread/process runs either the read or the write test. The distribution of read/write is done on a round robin basis. More than one thread/process is required for proper operation.

j ^!{jD-V2^0

@$r6` n s1gj/{O"zH0Backwards Read:This test measures the performance of reading a file backwards. This may seem like a strange way to read a file but in fact there are applications that do this.  MSC Nastran is an example of an application that reads its files backwards. With MSC Nastran, these files are very large (Gbytes to Tbytes in size).  Although many operating systems have special features that enable them to read a file forward more rapidly, there are very few operating systems that detect and enhance the performance of reading a file backwards.

3{6w)P0@3wEh5W0x051Testing软件测试网Y }?*A"D A"aw

Record Rewrite:This test measures the performance of writing and re-writing a particular spot within a file.  This hot spot can have very interesting behavīors. If the size of the spot is small enough to fit in the CPU data cache then the performance is very high. If the size of the spot is bigger than the CPU data cache but still fits in the TLB then one gets a different level of performance. If the size of the spot is larger than the CPU data cache and larger than the TLB but still fits in the operating system cache then one gets another level of performance, and if the size of the spot is bigger than the operating system cache then one gets yet another level of performance.51Testing软件测试网iXfg.e

51Testing软件测试网ujE+zHA

Strided Read:  This test measures the performance of reading a file with a strided access behavīor. An example would be:  Read at offset zero for a length of 4 Kbytes, then seek 200 Kbytes, and then read for a length of 4 Kbytes, then seek 200 Kbytes and so on. Here the pattern is to read 4 Kbytes and then Seek 200 Kbytes and repeat the pattern. This again is a typical application behavīor for applications that have data structures contained within a file and is accessing a particular region of the data structure.Most operating systems do not detect this behavīor or implement any techniques to enhance the performance under this type of access behavīor. This access behavīor can also sometimes produce interesting performance anomalies. An example would be if the application’s stride causes a particular disk, in a striped file system, to become the bottleneck.51Testing软件测试网c)p f,L6vH:JF4U9qD

51Testing软件测试网AE9Z(R.}b!G1|

Fwrite:This test measures the performance of writing a file using the library function fwrite(). This is a library routine that performs buffered write operations. The buffer is within the user’s address space. If an application were to write in very small size transfers then the buffered & blocked I/O functionality of fwrite() can enhance the performance of the application by reducing the number of actual operating system calls and increasing the size of the transfers when operating system calls are made. This test is writing a new file so again the overhead of the metadata is included in the measurement.

|\9OPF051Testing软件测试网 D8R6R}1fUcL:N

Frewrite:This test measures the performance of writing a file using the library function fwrite(). This is a library routine that performs buffered & blocked  write operations. The buffer is within the user’s address space. If an application were to write in very small size transfers then the buffered & blocked I/O functionality of fwrite() can enhance the performance of the application by reducing the number of actual operating system calls and increasing the size of the transfers when operating system calls are made.  This test is writing to an existing file so the performance should be higher as there are no metadata operations required.

pl]5\L a0

Ud~8R emp0Fread:This test measures the performance of reading a file using the library function fread(). This is a library routine that performs buffered & blocked read operations. The buffer is within the user’s address space. If an application were to read in very small size transfers then the buffered & blocked I/O functionality of fread() can enhance the performance of the application by reducing the number of actual operating system calls and increasing the size of the transfers when operating system calls are made.51Testing软件测试网$?a xf$[ r[Bk

2e+v!jF\;C$x"[_w'K0Freread:This test is the same as fread above except that in this test the file that is being read was read in the recent past. This should result in higher performance as the operating system is likely to have the file data in cache.51Testing软件测试网n/Dqy%L?9k

3Wt;J4l/v*O'|0Specialized tests:

6W.DADZ+Pvt(L0

K(RY(e L W0~l0z|0Mmap:  Many operating systems support the use of mmap() to map a file into a user’s address space.  Once this mapping is in place then stores to this location in memory will result in the data being stored going to a file. This is handy if an application wishes to treat files as chunks of memory. An example would be to have an array in memory that is also being maintained as a file in the files system.51Testing软件测试网;o)S+v3P}*W
The semantics of mmap files is somewhat different than normal files. If a store to the memory location is done then no actual file I/O may occur immediately. The use of the msyc() with the flags MS_SYNC, and MS_ASYNC control the coherency of the memory and the file. A call to msync() with MS_SYNC will force the contents of memory to the file and wait for it to be on storage before returning to the application. A call to msync() with the flag MS_ASYNC tells the operating system to flush the memory out to storage using an asynchronous mechanism so that the application may return into execution without waiting for the data to be written to storage.This test measures the performance of using the mmap() mechanism for performing I/O.51Testing软件测试网6m4\"Gyr/|

u,d {W]'`rld,R0O0Async I/O:Another mechanism that is supported by many operating systems for performing I/O is POSIX async I/O.  The application uses the POSIX standard async I/O interfaces to accomplish this. Example: aio_write(), aio_read(), aio_error(). This test measures the performance of the POSIX async I/O mechanism.

W.B {E:AZQ ^N^0

'GCG8Qa0JlJ,|4E(U"a0Examples of running Iozone:51Testing软件测试网Ge+q/|[

51Testing软件测试网R"NqG{L A)|D~ H

The simplest way to get started is to try the automatic mode.
0knAT4p R7t9^$~ U(y0  Iozone –a

#D7M"L%A%MD051Testing软件测试网 y]%dD6x1_

If you wish to generate graphs then you may wish to turn on Excel mode.51Testing软件测试网^)c3ivo5T;o
  Iozone –Ra  ( Output can be imported using space and tab delimited)
)Q3NvVV)W(c0       Or51Testing软件测试网-l W,| O{,F
  Iozone –Rab output.wks  ( Output file “output.wks” is a binary format spreadsheet)51Testing软件测试网 Dj+WIy+H'v

51Testing软件测试网 N8O&^8x AB"kIvnmv

If you have more than 512 Mbytes of memory then you need to increase the maximum file size to a larger value. For example if your system has 1 Gbyte of memory then you would want to try something like:
\ }"U)hno_T0  Iozone –Ra –g 2G

(O:ZYn._051Testing软件测试网7xV xu!K

If you only care about read/write and do not wish to spend the time to perform all of the tests, then you may wish to limit the testing like:
/\j{.]JL/yZ-n*T0  Iozone –Ra –g 2G –i 0 –i 151Testing软件测试网9y?8P+wT-Z7[LS!n

51Testing软件测试网+L7f ENJ8G

If you are running Iozone over NFS on an NFS client then you may wish to use:
F@%A(h0y+F)`` B0  Iozone –Rac 51Testing软件测试网3T,at3G*ta;q%y*@ W6H
 
6T_ Le`CC;m&u0This tells Iozone to include the close() in the measurement. This may be needed if the client is running NFS version 3. Including the close() helps to reduce the client side cache effects of NFS version 3. If you use a file size that is larger than the amount of memory in the client then the ‘c’ flag is not needed.

:ES'~p"U(skY0

+k*a%` ?B&SE0Scenario:51Testing软件测试网P\|C_(z

2\ ]YJo&ta Q5m(w^0While computers are typically purchased with an application in mind it is also likely that over time the application mix will change. Many vendors have enhanced their operating systems to perform well for some frequently used applications. Although this accelerates the I/O for those few applications it is also likely that the system may not perform well for other applications that were not targeted by the operating system. An example of this type of enhancement is: Database. Many operating systems have tested and tuned the filesystem so it works well with databases. While the database users are happy, the other users may not be so happy as the entire system may be giving all of the system resources to the database users at the expense of all other users.  As time rolls on the system administrator may decide that a few more office automation tasks could be shifted to this machine. The load may now shift from a random reader application (database) to a sequential reader. The users may discover that the machine is very slow when running this new application and become dissatisfied with the decision to purchase this platform. By using Iozone to get a broad filesystem performance coverage the buyer is much more likely to see any hot or cold spots and pick a platform and operating system that is more well balanced.

g2g(A V3gD051Testing软件测试网 ivO&I5qrp

Download and Detail Help Information

`bR V{_-j1W0

\IpJZ [ }0Official Site:http://www.iozone.org/
0c }(P&fg;D;s[4[+C051Testing软件测试网!i qG5Eg u


TAG: 存储系统测试 文件系统测试 iozone 存储测试工具

 

评分:0

我来说两句

Open Toolbar