4.7.1. Iozone
Iozone is an open-source tool for testing file system and disk performance. It allows users to evaluate system performance by simulating various file operation workloads, including sequential read/write, random read/write, random mixed read/write, and more. It can generate detailed performance reports to help users assess the performance of hardware and file systems.
4.7.1.1. Syntax Description
iozone has a large number of option parameters. Below is the Usage output from running iozone -h:
Usage: iozone [-s filesize_kB] [-r record_size_kB] [-f [path]filename] [-h]
[-i test] [-E] [-p] [-a] [-A] [-z] [-Z] [-m] [-M] [-t children]
[-l min_number_procs] [-u max_number_procs] [-v] [-R] [-x] [-o]
[-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] [-L cacheline_size] [-K] [-g maxfilesize_kB]
[-n minfilesize_kB] [-N] [-Q] [-P start_cpu] [-e] [-c] [-b Excel.xls]
[-J milliseconds] [-X write_telemetry_filename] [-w] [-W]
[-Y read_telemetry_filename] [-y minrecsize_kB] [-q maxrecsize_kB]
[-+u] [-+m cluster_filename] [-+d] [-+x multiplier] [-+p # ]
[-+r] [-+t] [-+X] [-+Z] [-+w percent dedupable] [-+y percent_interior_dedup]
[-+C percent_dedup_within] [-+a zero_pct] [-+Q dedup granule size]
[-+M dedup+compress flag ]
4.7.1.2. Parameter Options Introduction
-a
Enables fully automatic mode. Generates a report covering all test operations, using block sizes from 4KB to 16MB and file sizes from 64KB to 512MB.
-A
This version of automatic mode provides more comprehensive testing but takes more time. The -a option automatically stops testing with block sizes below 64KB when the file size is not less than 32MB, saving significant time. In contrast, -A tells Iozone that you don't mind waiting and want small block tests even for very large files. Note: Not recommended in Iozone 3.61; use -az -i 0 -i 1 instead.
-b filename
Creates a binary output file compatible with Excel when Iozone outputs results.
-B
Use mmap() files. This creates and accesses all temporary test files via the mmap() interface. Some applications treat files as blocks of memory, calling mmap() on a file and then accessing it as if it were memory.
-c
Include close() in timing calculations. This is useful only if you suspect that close() is broken in the operating system under test. Particularly helpful for NFS version 3 testing and can help identify whether nfs3_commit is working correctly.
-C
Display the number of bytes transferred per client during throughput testing. Useful when diagnosing starvation issues in file I/O or process management in the operating system.
-d #
Microsecond delay after releasing from the barrier. During throughput tests, all threads or processes are held at a synchronization barrier before starting. Normally, they are all released simultaneously. This parameter introduces a microsecond-level delay between the release of each thread or process.
-D
Use msync(MS_ASYNC) on mmap files. This tells the operating system that all data in the mmap space should be asynchronously written to disk.
-e
Include flush operations (fsync, fflush) in timing calculations.
-E
Perform some extended tests. Available only on certain platforms. Uses the pread interface.
-f filename
Specifies the filename for the temporary file used during testing. Useful when using the unmount option. If unmounting between each test, the temporary file must reside in a mountable directory. Unmounting the current working directory is not possible because the Iozone process runs there.
-F filename filename filename …
Specifies filenames for each temporary file in throughput testing. The number of filenames should match the number of specified processes or threads.
-g #
Set the maximum file size (in KB) available in auto mode.
-G
Use msync(MS_SYNC) on mmap files. This tells the operating system that all data in the mmap space must be synchronously written to disk.
-h
Display help information.
-H #
Use asynchronous operation # from the POSIX asynchronous I/O interface. Iozone uses POSIX async I/O and bcopy to copy data from the async buffer back to the application buffer. Some versions of MSC NASTRAN perform I/O this way. Applications use this technique so that async I/O can be implemented within a library without modifying the internal program model.
-i #
Specify which 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). Test 0 must always be run first to create files for subsequent tests. Multiple tests can be specified using -i # -i # -i #.
-I
Use VxFS VX_DIRECT for all file operations. Tells the VXFS file system that all file operations should bypass the cache and go directly to disk.
-j #
Set the stride for file access to (# * block size). Stride read tests will use this stride to read blocks.
-J # (milliseconds)
Introduce a specified millisecond computational delay before each I/O operation. See -X and -Y for other parameters controlling compute delay.
-k #
Use POSIX async I/O (without bcopy) with # async operations. Iozone will use POSIX async I/O directly, without additional bcopys. Buffers used by Iozone are passed directly to the async I/O system call.
-K
Generate some random access during normal testing.
-l #
Set the lower limit on the number of processes to run. When running throughput tests, this option allows specifying the minimum number of processes or threads to start. Should be used with the -u option.
-L #
Set processor cache line size to value (in bytes). Informs Iozone of the processor cache line size, used internally to optimize test performance.
-m
Tells Iozone to use multiple internal buffers. Some applications repeatedly read into a single buffer; others use an array of buffers. This option simulates both types. Iozone defaults to reusing internal buffers; this option overrides that to use multiple buffers.
-M
Iozone will call uname() and include the string in the output file.
-n #
Set the minimum file size (in KB) for auto mode.
-N
Report results in milliseconds per operation.
-o
Write operations are synchronized directly to disk (O_SYNC). Iozone opens the file with the O_SYNC flag, forcing all writes to complete fully to disk before returning.
-O
Report results in operations per second.
-p
Purges the processor cache before each file operation. Iozone allocates an additional internal buffer aligned to the processor cache boundary and of matching size, zero-filling it before each test. This clears the processor cache, allowing observation of memory subsystem performance without cache acceleration.
-P #
Bind processes/threads to processors, starting with this CPU #. Available only on some platforms. The first subprocess or thread starts on the specified CPU; subsequent ones are assigned to the next CPU. After exceeding total CPU count, assignment wraps around.
-q #
Set the maximum block size (in KB) used in auto mode. Can also use -q #k (KB), -q #m (MB), or -q #g (GB). For minimum block size, see -y.
-Q
Create offset/latency files. Iozone generates latency vs. offset data files that can be imported into graphics software for plotting. Useful for identifying offsets with high latency (e.g., where UFS allocates its first indirect block). Can reveal impact of extent allocations in extent-based file systems.
-r #
Specify test block size in KB. Can also use -r #k (KB), -r #m (MB), or -r #g (GB).
-R
Generate Excel-compatible report. Iozone produces a standard output report compatible with Excel, which can be opened in Microsoft Excel to create performance charts. Note: 3D charts are column-oriented; you must select this when plotting, as Excel defaults to row-oriented data.
-s #
Specify test file size in KB. Can also use -s #k (KB), -s #m (MB), or -s #g (GB).
-S #
Set processor cache size to value (in KB). Informs Iozone of the processor cache size, used internally for buffer alignment and purge functionality.
-t #
Run Iozone in throughput mode. Allows specifying the number of threads or processes to use during testing.
-T
Use POSIX threads during throughput testing. Available only on platforms supporting POSIX threads.
-u #
Set the upper limit on the number of processes to run. When running throughput tests, this specifies the maximum number of processes or threads to start. Should be used with the -l option.
-U mountpoint
Unmount and remount the specified mount point between tests. Ensures the cache does not contain any previously tested files.
-v
Display Iozone version number.
-V #
Specify a pattern to be written to the temporary file and validated for accuracy in each read test.
-w
Do not delete temporary files after use. Leaves them in the file system.
-W
Lock files during read or write operations.
-x
Disable "stone-walling". Stone-walling is an internal Iozone technique used in throughput testing. All threads or processes are started and paused at a barrier. Once ready, they are all released simultaneously. The test ends as soon as any one thread/process finishes, and aggregate throughput is calculated. This ensures all threads/processes run in parallel. This flag disables stone-walling to observe the effect.
-X filename
Use this file for write telemetry information. The file contains triplets: byte offset, transfer size, compute delay in milliseconds. Useful when replicating I/O operations from a system call trace of a target application. Allows Iozone to mimic the application's I/O behavior and benchmark it. (Lines starting with # are comments.)
-y #
Set the minimum block size (in KB) used in auto mode. Can also use -y #k (KB), -y #m (MB), or -y #g (GB). For maximum block size, see -q.
-Y filename
Use this file for read telemetry information. Contains triplets: byte offset, transfer size, compute delay in milliseconds. Useful for replicating I/O behavior from an application system call trace. (Lines starting with # are comments.)
-z
Used with -a to test all possible record sizes. Normally, in full auto mode, Iozone skips small record size tests on very large files. This forces Iozone to include small record sizes in auto testing.
-Z
Enable mixed mmap I/O and file I/O.
-+m filename
Use this file to obtain client configuration for cluster testing. One line per client, with three space-delimited fields: client name, working directory path on client, and Iozone executable path on client. Requires passwordless command execution on clients (e.g., via rsh).
-+u
Enable CPU utilization mode.
-+d
Enable diagnostic mode. Every byte is verified in this mode, useful when suspecting I/O subsystem errors.
-+p percent_read
Set the percentage of threads/processes that will perform random read testing. Valid only in throughput mode and with more than one process/thread.
-+r
Enable O_RSYNC and O_SYNC for all I/O tests.
-+t
Enable network performance testing. Requires -+m.
-+A
Enable madvise. 0 = normal, 1=random, 2=sequential, 3=dontneed, 4=willneed.
For use with options that activate mmap() file I/O. See: -B
4.7.1.3. Usage Examples
Note:
The following examples assume the iozone executable is present in the current directory. X5 does not guarantee that every image includes the iozone program.
Run all Iozone tests with default values
iozone -a
Use
iozone -ito run specific test types onlyTest types are numeric values. Below are the available test types and their corresponding numbers:
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
Run write test only (i.e., write and rewrite)
iozone -a -i 0
Run both read and write test types
iozone -a -i 0 -i 1