top of page
Search

Download and Install Iozone on Linux to Measure File Operations

  • vasiliyphzi
  • Aug 3, 2023
  • 14 min read


How to Download and Use Iozone for Linux Filesystem Benchmarking




If you are interested in measuring and comparing the performance of different filesystems on Linux, you may want to use a tool called Iozone. Iozone is a free and open source filesystem benchmark utility that can generate and measure various file operations, such as read, write, re-read, re-write, random read, random write, and many more. In this article, we will show you how to download, install, and use Iozone for Linux filesystem benchmarking.


What is Iozone and why use it?




Iozone is a filesystem benchmark tool that was originally developed by William Norcott and later enhanced by Don Capps and others. It is written in C and runs on many operating systems, including Linux, Windows, Mac OS X, Solaris, AIX, HP-UX, FreeBSD, NetBSD, OpenBSD, IRIX, SCO OpenServer, and more.




iozone linux download




Iozone features and benefits




Some of the features and benefits of using Iozone are:



  • It can perform a broad filesystem analysis of a vendor's computer platform.



  • It can test file I/O performance for 13 different operations.



  • It can run in single or multiple stream mode.



  • It can run in distributed fileserver mode (cluster).



  • It can use POSIX async I/O, mmap() file I/O, or normal file I/O.



  • It can generate Excel importable output for graph generation.



  • It can produce latency plots for read and write operations.



  • It can handle 64-bit compatible source and large files.



  • It can use stonewalling in throughput tests to eliminate straggler effects.



  • It can configure processor cache size and select measurements with fsync or O_SYNC.



Iozone supported operations and platforms




The following table shows the 13 file operations that Iozone can test and measure.



OperationDescription


ReadIndicates the performance of reading a file that already exists in the filesystem.


WriteIndicates the performance of writing a new file to the filesystem.


Re-readAfter reading a file, this indicates the performance of reading a file again.


Re-writeIndicates the performance of writing to an existing file.


Random ReadIndicates the performance of reading a file by reading random information from the file. i.e this is not a sequential read.


Random WriteIndicates the performance of writing to a file in various random locations. i.e this is not a sequential write.


Backward ReadIndicates the performance of reading a file backwards.


Record Re-WriteThis test measures the performance when writing and re-writing a fixed size record within a file.


Stride ReadThis test measures the performance when reading a file with a fixed distance (stride) between each read.


FwriteThis test measures the performance of writing a file using the library function fwrite().


FrewriteThis test measures the performance of re-writing a file using the library function fwrite().


FreadThis test measures the performance of reading a file using the library function fread().


FrereadThis test measures the performance of re-reading a file using the library function fread().


The following table shows the platforms that Iozone can run on.



PlatformOperating System


AlphaOSFV4, OSFV5, Tru64 Unix, Linux, FreeBSD, NetBSD, OpenBSD, Windows NT/2000/XP/2003/Vista/7/8/10.


AMD64Linux, FreeBSD, NetBSD, OpenBSD, Windows NT/2000/XP/2003/Vista/7/8/10.


ARMLinux, Android.


HPPAHP-UX 10.20, HP-UX 11.00.


IA64Linux, HP-UX 11.23.


MIPSIRIX 6.5.x.


PowerPCAIX 4.3.x, AIX 5L, Linux, Mac OS X.


SparcSolaris 2.5.1, Solaris 2.6, Solaris 7, Solaris 8, Solaris 9, Solaris 10.


X86Linux, FreeBSD, NetBSD, OpenBSD, SCO OpenServer 5.0.x, Windows NT/2000/XP/2003/Vista/7/8/10.


X86_64Linux, FreeBSD, NetBSD, OpenBSD, Windows NT/2000/XP/2003/Vista/7/8/10.


How to download and install Iozone on Linux




To use Iozone on Linux, you need to download and install it first. There are two ways to do this: from the official website or from your distribution's package manager.


Downloading Iozone from the official website




You can download Iozone from the official website at . There you will find the latest version of Iozone in various formats: source code (tar.gz), RPM packages (for Red Hat based distributions), and executable binaries (for Windows and Mac OS X).


iozone linux benchmark tool


iozone linux filesystem performance


iozone linux install guide


iozone linux command line options


iozone linux excel output


iozone linux cluster testing


iozone linux large file support


iozone linux 64 bit version


iozone linux nfs latency


iozone linux async i/o


iozone linux mmap file i/o


iozone linux single stream measurement


iozone linux multiple stream measurement


iozone linux posix pthreads


iozone linux multi-process measurement


iozone linux fsync o_sync


iozone linux aix bsdi hpux irix freebsd openbsd netbsd osfv3 osfv4 osfv5 sco openserver solaris mac os x windows


iozone linux stonewalling throughput tests


iozone linux processor cache size configurable


iozone linux read write re-read re-write read backwards read strided fread fwrite random read pread mmap aio_read aio_write operations


iozone linux ansii c source


iozone linux normal file i/o


iozone linux latest tarball download


iozone linux stable tarball download


iozone linux latest files download


iozone linux stable files download


iozone linux documentation pdf download


iozone linux documentation postscript gzip download


iozone linux documentation ms word doc download


iozone linux license download


iozone linux techspot download optimization benchmarks


iozone linux ubuntu multiverse repository download deb package


iozone linux debian package tracker download deb package


iozone linux rpm resource download rpm package


iozone linux archlinux community repository download pkg.tar.zst package


iozone linux fedora updates testing repository download rpm package


iozone linux centos extras repository download rpm package


iozone linux opensuse leap oss repository download rpm package


iozone linux gentoo packages repository download ebuild package


iozone linux alpine community repository download apk package


iozone linux slackware slackonly repository download txz package


iozone linux voidlinux repository download xbps package


If you want to download the source code of Iozone, you can choose the appropriate file for your platform. For example, if you are using a 64-bit Linux system, you can download the file iozone3_491.tar.gz. Then you can extract it with the command:


tar xvf iozone3_491.tar.gz


This will create a directory called iozone3_491 with the source code and documentation of Iozone.


Installing Iozone from source or RPM




If you downloaded the source code of Iozone, you need to compile it before you can use it. To do this, you need to have a C compiler (such as gcc) and make installed on your system. Then you can go to the iozone3_491/src/current directory and run the command:


make linux-AMD64


This will compile Iozone for a 64-bit Linux system with AMD processors. You can change the target name according to your platform. For example, if you are using a 32-bit Linux system with Intel processors, you can use linux instead of linux-AMD64. You can see the list of available targets by running make help.


After compiling Iozone, you will get an executable file called iozone in the same directory. You can copy this file to any location in your PATH (such as /usr/local/bin) or run it directly from there.


If you downloaded an RPM package of Iozone, you can install it using your package manager. For example, if you are using a Red Hat based distribution, you can use the command:


sudo rpm -ivh iozone-3_491-1.x86_64.rpm


This will install Iozone and its documentation in the /opt/iozone directory. You can then run Iozone from there or create a symbolic link to it in your PATH.


How to run Iozone tests on Linux filesystems




Once you have installed Iozone, you can use it to run various tests on your Linux filesystems. Iozone can run in three modes: automatic, custom, and throughput. In this section, we will explain how to use each mode and what parameters and options you can use.


Running Iozone in automatic mode with default values




The simplest way to use Iozone is to run it in automatic mode with default values. This means that Iozone will test all the file operations with a range of file sizes and record sizes. To do this, you just need to specify the name of the filesystem or directory that you want to test. For example, if you want to test the /home filesystem, you can run the command:


iozone -a /home


This will start Iozone in automatic mode and test the /home filesystem with file sizes from 64 KB to 512 MB and record sizes from 4 KB to 16 MB. It will also generate an Excel compatible output file called iozone_results.xls in the current directory. You can use this file to create graphs of the results.


If you want to change the default values of the file size and record size ranges, you can use the -s and -r options. For example, if you want to test the /home filesystem with file sizes from 128 KB to 1 GB and record sizes from 8 KB to 32 MB, you can run the command:


iozone -a -s 1g -r 32k /home


Running Iozone with custom parameters and options




If you want to have more control over the parameters and options of Iozone, you can run it in custom mode. This means that you can specify which file operations, file sizes, record sizes, and other options you want to use. To do this, you need to use the -i option followed by a number that corresponds to a file operation. For example, if you want to test only read and write operations, you can use -i 0 -i 1. The following table shows the numbers and their corresponding file operations.



NumberOperation


0Write/Re-write


1Read/Re-read


2Random Read/Write


3Read Backwards


4Re-write Record


5Stride Read


6Fwrite/Re-fwrite


7Fread/Re-fread


8Random Mix


9Pwrite/Re-pwrite


10Pread/Re-pread


11Pwritev/Re-pwritev


12Preadv/Re-preadv


Mix # # # # # # # # # # # # # # # # # # # # # # # # # # Random Mix of all operations


For example, if you want to test the /home filesystem with only read, write, and random read/write operations, with file sizes of 128 MB and 256 MB, and record sizes of 4 KB and 8 KB, you can run the command:


iozone -i 0 -i 1 -i 2 -s 128m -s 256m -r 4k -r 8k /home


You can also use other options to modify the behavior of Iozone. For example, you can use the -f option to specify the name of the test file, the -t option to specify the number of threads or processes to use, the -w option to avoid deleting the test file after the test, the -c option to include close in the timing calculations, and many more. You can see the full list of options by running iozone -h.


Running Iozone in throughput mode with multiple threads or processes




If you want to measure the throughput of your filesystem with multiple threads or processes, you can use Iozone in throughput mode. This means that Iozone will run multiple instances of itself with the same parameters and aggregate the results. To do this, you need to use the -t option followed by a number that indicates how many threads or processes you want to use. For example, if you want to test the /home filesystem with 4 threads or processes, you can run the command:


iozone -t 4 /home


This will start Iozone in throughput mode and test the /home filesystem with 4 threads or processes with file sizes from 64 KB to 512 MB and record sizes from 4 KB to 16 MB. It will also generate an Excel compatible output file called iozone_results.xls in the current directory.


If you want to change the default values of the file size and record size ranges, you can use the -s and -r options as before. You can also use other options to modify the behavior of Iozone as before. For example, if you want to test the /home filesystem with 4 threads or processes, with file sizes of 128 MB and 256 MB, and record sizes of 4 KB and 8 KB, you can run the command:


iozone -t 4 -s 128m -s 256m -r 4k -r 8k /home


How to interpret and analyze Iozone results




After running Iozone tests on your Linux filesystems, you may want to interpret and analyze the results. Iozone can produce different types of output formats and graphs that can help you understand the performance of your filesystems. In this section, we will explain how to read and compare Iozone results.


Understanding the Iozone output format and graphs




Iozone can produce two types of output formats: text and Excel. The text output format is displayed on the screen or redirected to a file. The Excel output format is saved in a file called iozone_results.xls in the current directory. You can use this file to create graphs of the results using Excel or other spreadsheet applications.


The text output format consists of a header line that shows the parameters used for the test, followed by a table that shows the results for each file operation, file size, and record size. The table has columns for each file operation and rows for each file size and record size combination. The values in the table are in kilobytes per second (KB/s). For example, here is a sample text output from running iozone -a /home:



Iozone: Performance Test of File I/O Version $Revision: 3.491 $ Compiled for 64 bit mode. Build: linux-AMD64 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, Jean-Marc Zucconi, Jeff Blomberg, Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root, Fabrice Bacchella, Zhenghua Xue, Qin Li, Darren Sawyer, Vangel Bojaxhi, Ben England, Vikentsi Lapa. Run began: Tue Jun 20 14:39:24 GMT+00:00 Auto Mode File size set to 524288 KB Record Size 4 KB Record Size 8 KB Record Size 16 KB Record Size 32 KB Command line used: iozone -a /home 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 65536 4 8983 9108 12354 12365 891 909 911 910 911 9108 9108 12365 12365 65536 8 10196 10205 14397 14401 1121 1121 1121 1121 1121 10205 10205 14401 14401 ...


The Excel output format consists of a worksheet for each file operation, with a table that shows the results for each file size and record size. The table has columns for each file size and rows for each record size. The values in the table are in kilobytes per second (KB/s). For example, here is a sample Excel output from running iozone -a /home:



Iozone can also produce graphs of the results using the -g option. This option requires that you have gnuplot installed on your system. The -g option takes a parameter that indicates the maximum file size to plot. For example, if you want to plot the results for file sizes up to 256 MB, you can run the command:


iozone -a -g 256m /home


This will generate a series of PNG files in the current directory, one for each file operation. The PNG files have names like write.png, read.png, random_read.png, etc. The graphs show the throughput (in KB/s) on the y-axis and the record size (in KB) on the x-axis. The graphs have different curves for each file size tested. For example, here is a sample graph for the write operation:



Comparing Iozone results across different filesystems and configurations




One of the main purposes of using Iozone is to compare the performance of different filesystems and configurations on Linux. For example, you may want to compare how different filesystem types (such as ext4, xfs, btrfs, etc.), mount options (such as noatime, relatime, etc.), RAID levels (such as RAID0, RAID1, RAID5, etc.), disk types (such as HDD, SSD, NVMe, etc.), or encryption methods (such as LUKS, eCryptfs, etc.) affect the file I/O performance.


To do this, you need to run Iozone tests on each filesystem or configuration that you want to compare, using the same parameters and options. Then you can use the text or Excel output files to compare the results across different filesystems or configurations. You can also use the gnuplot scripts provided by Iozone to create comparison graphs of the results.


For example, if you want to compare the performance of ext4 and xfs filesystems on a single SSD disk with default mount options, you can run the following commands:



# Create ext4 and xfs partitions on /dev/sda sudo fdisk /dev/sda # Format ext4 and xfs partitions sudo mkfs.ext4 /dev/sda1 sudo mkfs.xfs /dev/sda2 # Mount ext4 and xfs partitions sudo mount /dev/sda1 /mnt/ext4 sudo mount /dev/sda2 /mnt/xfs # Run Iozone tests on ext4 and xfs partitions with automatic mode and default values iozone -a /mnt/ext4 > ext4.txt iozone -a /mnt/xfs > xfs.txt # Generate Excel output files for ext4 and xfs results iozone -R -b ext4.xls



By comparing the results and graphs, you can see how ext4 and xfs perform differently for different file operations, file sizes, and record sizes. You can also repeat the same process for other filesystems or configurations that you want to compare.


Using Iozone for troubleshooting and optimization of filesystem performance




Another purpose of using Iozone is to troubleshoot and optimize the performance of your filesystems on Linux. For example, you may want to identify and fix any bottlenecks, errors, or anomalies that affect the file I/O performance. You may also want to tune and optimize your filesystem parameters, mount options, RAID levels, disk types, or encryption methods to achieve better performance.


To do this, you need to run Iozone tests on your filesystems with different parameters and options, and monitor the results and graphs. You can also use other tools and commands, such as iostat, vmstat, top, df, du, hdparm, smartctl, etc., to collect more information about your system and disks. Then you can analyze the data and identify any issues or areas for improvement. You can also try different solutions and test them again with Iozone to see if they make any difference.


For example, if you notice that your filesystem performance is low or inconsistent for random read/write operations, you may want to check the following factors:



  • The fragmentation level of your filesystem. You can use the fsck command to check and repair your filesystem.



  • The alignment of your partitions and filesystems. You can use the fdisk or parted commands to check and align your partitions.



  • The caching behavior of your disks and controllers. You can use the hdparm command to check and modify the cache settings of your disks.



  • The encryption method of your filesystems. You can use the cryptsetup command to check and change the encryption settings of your encrypted filesystems.



By checking and adjusting these factors, you may be able to improve your filesystem performance for random read/write operations. You can then run Iozone tests again to verify the results.


Conclusion and FAQs




In this article, we have shown you how to download, install, and use Iozone for Linux filesystem benchmarking. We have explained what Iozone is and why use it, how to run Iozone tests on Linux filesystems with different modes and options, how to interpret and analyze Iozone results with different output formats and graphs, and how to use Iozone for troubleshooting and optimization of filesystem performance.


We hope that this article has been helpful and informative for you. If you have any questions or feedback, please feel free to contact us or leave a comment below. Here are some FAQs that you may find useful:


Q: How can I run Iozone tests on multiple filesystems or directories at once?




A: You can use the -F option followed by a list of filenames or directories that you want to test. For example, if you want to test /home, /var, /tmp, /mnt/ext4, and /mnt/xfs at once, you can run the command:


iozone -a -F /home /var /tmp /mnt/ext4 /mnt/xfs


Q: How can I run Iozone tests on a distributed fileserver mode (cluster)?




A: You can use the -C option followed by a list of hostnames or IP addresses that are part of the cluster. For example, if you have a cluster of four nodes with IP addresses 192.168.0.1, 192.168.0.2, 192.168.0.3, and 192.168.0.4, you can run the command:


iozone -a -C 192.168.0.1 192.168.0.2 192.168.0.3 192.168.0.4


Q: How can I run Iozone tests on a specific file operation only?




A: You can use the -i option followed by a number that corresponds to a file operation only once. For example, if you want to test only the read operation, you can use -i 1. For example, if you want to test the /home filesystem with only the read operation, with file sizes of 128 MB and 256 MB, and record sizes of 4 KB and 8 KB, you can run the command:


iozone -i 1 -s 128m -s 256m -r 4k -r 8k /home


Q: How can I run Iozone tests with different cache settings?




A: You can use the -c, -C, -e, and -E options to modify the cache settings of Iozone. The -c option enables the use of POSIX async I/O, which bypasses the buffer cache. The -C option sets the processor cache size in kilobytes. The -e option includes flush (fsync or O_SYNC) in the timing calculations. The -E option purges the buffer cache before each test. For example, if you want to test the /home filesystem with POSIX async I/O, a processor cache size of 2048 KB, and flush included in the timing, you can run the command:


iozone -a -c -C 2048 -e /home


Q: How can I run Iozone tests with different file I/O methods?




A: You can use the -I, -j, and -J options to modify the file I/O methods of Iozone. The -I option enables direct I/O, which bypasses the buffer cache and writes directly to disk. The -j option enables mmap() file I/O, which maps a file into memory and accesses it as an array. The -J option enables asynchronous I/O using libaio, which allows multiple I/O requests to be submitted and completed without blocking. For example, if you want to test the /home filesystem with direct I/O and asynchronous I/O using libaio, you can run the command:


iozone -a -I -J /home


Q: How can I run Iozone tests with different file types?




A: You can use the -n and -N options to modify the file types of Iozone. The -n option enables no retest mode, which means that Iozone will not delete or re-create the test files between tests. This allows you to test different file types, such as compressed, encrypted, sparse, etc., by creating them beforehand. The -N option enables retest mode, which means that Iozone will delete and re-create the test files between tests. This allows you to test fresh files each time. For example, if you want to test the /home filesystem with no retest mode and compressed files, you can run the following commands:



# Create compressed files using gzip gzip /home/testfile* # Run Iozone tests with no retest mode iozone -a -n /home 44f88ac181


 
 
 

Recent Posts

See All

Comments


© 2023 by BABY LOVE. Proudly created with Wix.com

  • Facebook Grunge
  • Twitter Grunge
bottom of page