Test Disk performance with IOzone

Source: Internet
Author: User
Tags posix

IOzone is a file System test baseline tool. You can test the read and write performance of file systems in different operating systems. Can be via write, re-write, read, re-read, Random read, random write, random mix, backwards read, record Rewirte, strided read, Fwrite, Frewrite, Fread, Freread, mmap, async i/0 The performance of the hard drive in different modes.
When testing, please note that the size of the test file must be larger than your memory (twice times the best memory size), or Linux will give you read and write content cache, will make the value is very inaccurate.

1 #rpm-IVH iozone-3-408.i386.rpm

Install IOzone, the latest version iozone is 3-408,:http://www.iozone.org/, you can download the source package, you can also download the compiled RPM package, as well as the use of document download.

1 #rpm-IVH iozone-3-408.i386.rpm

Note: The way can only be installed under the/opt, this would like to install under the/usr/local/, but IOzone to the location of death. Do not know whether the source installation can change the location, trouble to tell a sound ^_^

Before we introduce the specific usage, let's start with a few examples (here IOzone installed under/opt/iozone, wondering where the software is installed: RPM-QPL iozone-3-408.i386.rpm)
The simplest way to get started with the IOzone method is Auto mode

1 #/opt/iozone/bin/iozone-a

IOzone will be tested in all modes, using record blocks from 4k to 16M, test file sizes from 64k to 512M

If you want to display the test results as a chart, you can use the IOzone to place the test results in Excel

1 #/opt/iozone/bin/iozone-ra or #/opt/iozone/bin/iozone-rab Output.xls

If the memory is greater than 512MB, the test file needs to be larger; The best test file is twice times the memory. For example, memory is 1G and the test file is set to a maximum of 2G

#/opt/iozone/bin/iozone-ra-g 2g

If we only care about the Read/write performance of the file disk without having to spend time testing in other modes, we need to specify the test mode. Details will be explained in the parameter explanation

1 #/opt/iozone/bin/iozone-ra-g 2g-i 0-i 1

Finally, if we test for NFS, we will use-C, which informs IOzone to execute the close () function during the test. Using close () will reduce the impact of client-side Caching for NFS. However, if the test file is larger than memory, it is not necessary to use the parameter-C

1 #/opt/iozone/bin/iozone-rac


Definition of the test
Write: Tests the performance of writing to a new file. When a new file is written, it is not just the data in those files that needs to be stored, but also the additional information that is used to locate the location where the data is stored on the storage medium. This additional information is called "metadata". It includes directory information, allocated space, and other data that is related to the file but not the data contained in the file. Thanks to this extra information, write performance is usually lower than re-write performance.
Re-write: Tests the performance of writing to an existing file. When an existing file is written, it requires less effort because the metadata already exists. Re-write performance is typically higher than write performance.
READ: Test reads the performance of an existing file.
Re-read: Test read the performance of a recently read file. Re-read performance is higher because the operating system typically caches recently read file data. This cache can be used for reading to improve performance.
Random read: Test reads the performance of a file in the stochastic offset. Many factors may affect system performance in this case, such as: the size of the operating system cache, the number of disks, the seek delay, and others.
Random write: Tests the performance of writing a random offset in a file. Similarly, many factors can affect system performance in this case, such as: the size of the operating system cache, the number of disks, the seek delay, and others.
Random Mix: Tests the performance of reading and writing a randomly offset in a file. Similarly, many factors can affect system performance in this case, such as: the size of the operating system cache, the number of disks, the seek delay, and others. This test can only be performed in the throughput test mode. Each thread/process runs a read or write test. This distributed read/write test is based on the round robin pattern. It is best to perform this test with more than one thread/process.
Backwards read: Tests the performance of reading a file using reverse. This method of reading the file may seem ridiculous, in fact, some applications do. MSC Nastran is an example of an application that uses reverse reading of a file. The files it reads are very large (size from G to t level). Although many operating systems use some special implementations to optimize the speed of sequential read files, few operating systems notice and enhance the performance of reverse read files.
Record Rewrite: Tests write and overwrite the performance of a particular block written in a file. Something very interesting might happen to this block. If the block is small enough (smaller than the CPU data cache), the measured performance will be very high. If it is larger than the CPU data cache and smaller than the TLB, the performance of the other phase is measured. If the two are larger, but smaller than the operating system cache, the resulting performance is a phase. If it is larger than the operating system cache, it is another result.
strided read: Test skips the performance of reading a file. For example: Read 4Kbytes at 0 offset, then interval 200Kbytes, read 4Kbytes, then interval 200Kbytes, so repeat. At this point the pattern is read 4Kbytes, Interval 200Kbytes and repeat this pattern. This is another typical application behavior where applications that use data structures in a file and access specific areas of the data structure often do so.
Many operating systems do not notice this behavior or do some optimizations for this type of access. Similarly, this access behavior can lead to some interesting performance exceptions. An example of this is in a data-slice file system, where application jumps cause a particular disk to become a performance bottleneck.
Fwrite: Test Call library function Fwrite () to write the performance of the file. This is a library routine that performs cache and block write operations. The cache is within the user space. If an application wants to write a very small transport block, the caching and blocking I/O functions in the fwrite () function can enhance the performance of the application by reducing the actual operating system calls and increasing the size of the transport block when the operating system calls.
The test is to write a new file, so the metadata is written as well.
Frewrite: Test Call library function fwrite () to write the performance of the file. This is a library routine that performs cache and block write operations. The cache is within the user space. If an application wants to write a very small transport block, the caching and blocking I/O functions in the fwrite () function can enhance the performance of the application by reducing the actual operating system calls and increasing the size of the transport block when the operating system calls.
This test is written to an existing file, and the performance of the test is higher due to no metadata manipulation.
Fread: Test Call library function Fread () to read the performance of the file. This is a library routine that performs caching and blocking read operations. The cache is within the user space. If an application wants to read a very small transport block, the caching and blocking I/O functions in the fwrite () function can enhance the performance of the application by reducing the actual operating system call and increasing the size of the transport block when the operating system calls.
Freread: This test is similar to the above fread, except that the files that were read in this test have just been read recently. This results in higher performance because the operating system caches the file data.
Several special tests:
Mmap: Many operating systems support the use of Mmap () to map a file to the user address space. After mapping, the read/write to the memory will be synchronized to the file. This is handy for applications that want to use files as chunks of memory. One example is that a piece of memory will be saved as a file in the file system as well.
The semantics of the mmap file are slightly different from ordinary files. If memory storage occurs, the corresponding file I/O operation does not occur immediately. The MSYC () function call that uses the Ms_sync and Ms_async flag bits will control memory and file consistency. Calling Msync () when the Ms_sync is placed will force the contents of the memory to be written to the file and wait until the operation is complete before returning. The Ms_async, however, tells the operating system to use an asynchronous mechanism to flush memory to disk so that the application can return directly without waiting for the operation to complete.
The test is to measure the performance of I/O using the mmap () mechanism.
Async I/O: Another I/O mechanism supported by many operating systems is the POSIX standard asynchronous I/O. This program uses the POSIX standard asynchronous I/O interface to complete this test function.
For example: Aio_write (), Aio_read (), Aio_error (). This test measures the performance of the POSIX asynchronous I/O mechanism.

Parameter introduction

IOzone function is very powerful, of course, there are a lot of parameters, but we often use a few parameters
Usage:iozone [-S filesize_kb] [-R RECORD_SIZE_KB] [-f [Path]filename]
[-I. Test] [-E] [-P] [-A] [-A] [-Z] [-Z] [-M] [-M] [-T children] [-h] [-O]
[-L Min_number_procs] [-U Max_number_procs] [-V] [-R] [-X]
[-D microseconds] [-F path1 path2 ...] [-V pattern] [-j Stride]
[-T] [-c] [-B] [-d] [-G] [-I.] [-H depth] [-K depth] [-U Mount_point]
[-S cache_size] [-O] [-K] [-L line_size] [-G max_filesize_kb]
[-N min_filesize_kb] [-N] [-Q] [-P START_CPU] [-c] [-E] [-B filename]
[-j milliseconds] [-X FileName] [-y filename] [-W] [-W]
[-y min_recordsize_kb] [-Q max_recordsize_kb] [-+m filename]
[-+u] [-+d] [-+p Percent_read] [-+r] [-+t] [-+a #]


-A
Automatic mode testing. Test record block size from 4k to 16M, test files from 64k to 512M

-A
Using automatic mode Although the test is more comprehensive, but compared to spend time. The-a option will save time by stopping using less than 64k of record blocks when the file is larger than 32MB. -A notifies iozone not to save time and perform all tests. Note: Not recommended after version 3.61, replace-AA with-az

-B
Use Mmap (). This will use the mmap () interface to create and access all the temporary files for the test. Some applications tend to look at files as a piece of memory. These applications perform a mmap () call to the file and then can access that block in read-write memory to complete file I/O.

-C
Calculation time will include close () in

-C
Displays the number of bytes per client in the throughput test.

-D
Use Msync (ms_async) for mmap files. Tells the operating system that all data in the mmap space needs to be asynchronously written to disk.

-E
Test time is inclusive flush (Fsync, Fflush)

-F filename
Specify to test temporary files that will be automatically deleted after the test is completed

-f filename filename ...
Specify each temporary file name in the test, and the number of filenames should be the same as the number of processes or threads specified

-G #
To set the maximum file size in automatic mode, you can use the #k #m #g分别表示kb, MB,GB

-G
Use Msync (ms_sync) for mmap files. Tells the operating system that all data in the mmap space needs to be synchronously written to disk

-H
Show Help

-I. #
Specifies which mode test to run on. Can use the-I #-I #-I #进行多个测试
0=write/rewrite
1=read/re-read
2=random Read/random Write
3=backwards Read
4=re-write-record
5=stride-read
6=fwirte/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.
Use direct I/O for all file operations. Notifies the file system that all operations skip the cache and operate directly on disk

-J #
Sets the span of the Access file to (# * block). Stride Read Test will use this span for reading blocks

-j # (MS)
A calculation delay of a specified millisecond is generated before each I/O operation. See-X and-y get control calculation delay other parameters

-L #
Sets the minimum number of processes for the program. The minimum number of processes or threads that the user is allowed to set during the testing process. It needs to be used with the-u option.

-L #
Sets the number of units to exchange information for the processor # (bytes). Can speed up testing.

-M
IOzone will use multiple caches internally. Some programs repeatedly replicate a cache, and there is a set of multiple cache blocks. This parameter will allow the use of both modes. IOzone The default behavior is to reuse an internal cache. This option allows multiple cache blocks to be used internally.

-M
Call uname () to place the return string in the output file

-N #
Set the minimum value of the test file in automatic mode

-N
Report results are displayed in milliseconds per operation

-O
Write in a synchronous way to disk

-O
Report results are displayed in the form of operations per second

-Q #
Set the maximum value of the record block in automatic mode, you can use #k (KB), #m (MB), #g (GB). Use-y to set the minimum value

-R #
Set the record block size to #

-R
Display results using Excel

-S #
Set test File size

-S #
Setting the processor's cache size

-T #
Set the number of threads or processes for a test program

-T
Testing with POSIX pthreads

-U #
Sets the maximum number of processes or threads that need to be used with the-l parameter

-U mountpoint
Before the test begins, IOzone will mount the unmount and remount points. This will ensure that the cache in the test does not contain any files

-W
Do not delete the temporary files after the test is finished. Temporary files will be saved after the test

-W
Lock files while reading or writing files during testing

-Y #
Set minimum record block value

-Z
Use with-A for full testing

-Z
Allow mixed use of mmap I/O and file I/O

Here's a test done on my machine: Read/write test only, test file size is 4G, record block from 2k to 8m, and output test data to Excel file

[[email protected]] #/opt/iozone/bin/iozone-a-S 4g-i 0-i 1-f/tmp/testfile-y 2k-q 8m-rb output.xls iozone:performance Test of Fil        e I/O Version $Revision: 3.408 $ Compiled for the + bit mode. Build:linux Contributors:william Norcott, Don Capps, Isom Crawford, Kirby Collins Al Slater, Scott Rh INE, Mike Wisner, Ken Goss Steve landherr, Brad Smith, Mark Kelly, Dr Alain CYR, Randy Du Nlap, Mark Montague, Dan Million, Gavin Brebner, Jean-marc Zucconi, Jeff Blomberg, Benny Halevy, Dave Boon E, Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root, Fabrice Bacchella, Zhenghua Xue                 , Qin Li, Darren Sawyer.    Ben England.  Run Began:sat Sep 16:13:49-Auto Mode File size set to 4194304 KB using Minimum Record size 2 KB using Maximum Record Size 8192 KB Excel chart generation enabled Command line used:/opt/iozone/bin/iOzone-a-S 4g-i 0-i 1-f/tmp/testfile-y 2k-q 8m-rb output.xls output is in kbytes/sec time Resolution = 0.000    001 seconds.    Processor Cache size set to 1024x768 Kbytes.    Processor Cache line size set to bytes.                                                            File Stride Size set to + * record size. Random random BKWD record stride KB Reclen write rewrite rea   D reread read write read rewrite read fwrite frewrite fread freread 4194304 2 73827    29362 81404 81444) 4194304 4 69155 69602 76825) 77202 41943                                                                                   04 8 68565 69824 76052 84360       4194304 16 68075 69315 76283 80031                                                                            4194304 32 66513 67132 76137 76 763 4194304 64 72619 73450 8   3329 85359 4194304) 128 74573   75989 70115 85572) 4194304 256 72895 74590 79285) 88244 419430                                                                                   4 512 73291 73907 82552 87192                                                                                   4194304 1024 73020 74662 82190 80162                                                                                   4194304 2048 69200 69990 77603 831644194304 4096 68509 70153 74310 80600 4194304 8192 67789 69434 78875 83344

The final data is the test results, the first column on the left is the test file size, the second column is the record block size (in kilobytes), each column is the test mode (in kb/s)

Test Disk performance with IOzone

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.