Infrastructure at your Service

David Hueber

Using IOzone for Linux disk performance analysis

Who never had to measure the disk performances on a system?

Speaking about Linux performance monitoring includes a significant part of disk performances. If you are facing applications or databases running slower than expected or than on other environments, you may take a look on the I/O performances.
This posting aims to provide an introduction to a pretty interesting tool: IOzone.

Under Linux environments, there are plenty of tools to perform I/O tests, stretching from the simplest and most common ones (i.e.: iostat) to more evolved (complicated?) ones. You may already have heard about bonnie++ or Flexible I/O, which is presented on Yann Neuhaus’ blog (see here). Even Oracle provides its own tool Orion (see Gregory Steulet’s blog) to evaluate disk performances.

IOZone overview

IOzone (www.iozone.org) is an open source solution for file system benchmark. It was originally developed by William Norcott and has been enhanced by Don Capps. In 2007, IOzone has been rewarded the Inforworld BOSSIE award (http://www.infoworld.com/infoworld-bossie-awards-755) of the best file I/O tool. IOzone presents the advantage to be available for almost all main platforms such as Linux, AIX, Solaris, BSD, MacOSX, and also Windows through Cygwin.

Basically IOzone runs the following tests on a file, which is then split in smaller slices:

  • ID 0 : Read – indicates the performance of reading a file that already exists in the filesystem.
  • ID 1 : Write – indicates the performance of writing a new file to the filesystem.
  • ID 2 : Re-read – after reading a file, this indicates the performance of reading a file again.
  • ID 3 : Re-write – indicates the performance of writing to an existing file.
  • ID 4 : Random Read – indicates the performance of reading a file by reading random information from the file – i. e. this is not a sequential.
  • ID 5 : Read.
  • ID 6 : Random Write – indicates the performance of writing to a file in various random locations. i.e this is not a sequential write.
  • ID 7 : Backward Read.
  • ID 8 : Record Re-Write.
  • ID 9 : Stride Read.
  • ID 10 : Fread.
  • ID 11 : Fwrite.
  • ID 12 : Freread.
  • ID 13 : Frewrite

The complete description of each test can be found in the IOzone documentation. Note that in case of databases benchmarking the tests, 0 to 6 are particularly interesting.

IOzone Installation

IOzone can be installed as follows:

[[email protected] tmp]# wget http://www.iozone.org/src/current/iozone-3-398.i386.rpm
--2012-03-15 10:15:42--  http://www.iozone.org/src/current/iozone-3-398.i386.rpmResolving www.iozone.org... 208.45.140.198Connecting to www.iozone.org|208.45.140.198|:80... connected.HTTP request sent, awaiting response... 200 OKLength: 755116 (737K) [application/x-rpm]Saving to: `iozone-3-398.i386.rpm'
100%[==================================================================>] 755,116      278K/s   in 2.7s    
2012-03-15 10:15:45 (278 KB/s) - `iozone-3-398.i386.rpm' saved [755116/755116]

[[email protected] tmp]# ls io*iozone-3-398.i386.rpm
[[email protected] tmp]# rpm -ivh iozone-3-398.i386.rpm
Preparing...          ########################################### [100%]
1:iozone              ########################################### [100%]
[[email protected] tmp]# whereis iozoneiozone
/opt/iozone/bin/iozone

Basic usage

Once installed, IOzone can be started in automatic mode simply using the command: iozone -a

However, several options are available through iozone -h or in the documentation. We are going to present the most useful ones.

  • Specify the file system to test:

iozone /xxx/yyy     —–>    iozone /u01

  • Specify the size of the file used for the tests:

iozone -s #k|#m|#g    —–>   iozone -s 10g /u01

  • Specify the size of the record used by IOzone

iozone -r #k|#m|#g    —–>   iozone -s 10g -r 8k /u01

The record is the slices in which the file will be divided during the tests. In case of an Oracle database benchmarking, the record size should be set to the db_block_size (or the tablespace block size, if it applies).

  • Specify the tests to run

iozone -i test_id           —–>   iozone -i 0 -i 1 -s 10g -r 8k /u01

  • Specify the min and max number of thread to use: -l (lower) -u (upper)

iozone -l # -u #           —–>   iozone -i 0 -i 1 -l 1 -u 10 -s 10g -r 8k /u01

IOzone output

By default, IOzone prints its output in a text format on the standard output:


standard_output

In addition, its results can be sent to an Excel or LibreOffice Calc File using:

iozone -R -b file.xls iozone -R -b file.ods

Once the results are generated, some graphs can be generated using Calc or Excel.
Below is an example meant to mesure the throughput (KB/s) for each type of test, with different level of parallelization going from 2 to 10:

[[email protected] current]# ./iozone -R -b /u01/oradata/bench_u01_test.xls -r 8k -s 100m -l 2 -u 10

Excel_output

And here is a graph generated by these results:

iozone_graph

Enjoy! 😀

7 Comments

  • tim carroll says:

    I wish someone would demonstrate how they generated the graphs – seems to be a well-kept secret

  • yuyu says:

    Tim,
    I totally agree with you, I am far far far away to be an Excel (or Calc) expert, and I don’t know how to properly graph these results !! A step by step would be nice as I presume it’s ony a few click with the correct options.

    Except that, great post !

  • dojo says:

    How to use IOZONE for chechking deduplication, I can see -+w ,-+y options but there is not proper doc.Can you plz tell

  • toms says:

    After importing the output file (generated using -Rb flag) in excel, it doesn’t show any graphs. Nobody has clearly stated how to do this. 🙁 Everybody just shares example graphs. Can someone please explain the steps in doing this? Otherwise, this awesome tool wont’ be of any use to me.

  • Scott says:

    @toms and others:
    — create your output:
    iozone -Rab output.xls /u01

    — scp off to desptop, or to location you can open output.xls in excel

    — open output.xls in excel

    — highlight one section, ex., Writer Report

    — hit F11

    Boom!

  • Catherine Bundy says:

    I can’t seem to get iozone to do a random read/write test. If I run the command:
    ./iozone.exe -R -s 512m -i 2 -t 1 -F tmp1
    I get:
    $ ./iozone.exe -R -s 512m -i 2 -t 1 -F tmp1
    Iozone: Performance Test of File I/O
    Version $Revision: 3.263 $
    Compiled for 32 bit mode.
    Build: Windows

    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.

    Run began: Thu Nov 13 13:59:49 2014

    Excel chart generation enabled
    File size set to 524288 KB
    Command line used: /ceb/iozone -R -s 512m -i 2 -t 1 -F tmp1
    Output is in Kbytes/sec
    Time Resolution = 0.000000 seconds.
    Processor cache size set to 1024 Kbytes.
    Processor cache line size set to 32 bytes.
    File stride size set to 17 * record size.
    Throughput test with 1 process
    Each process writes a 524288 Kbyte file in 4 Kbyte records
    tmp1.DUMMY.0: No such file or directory

    Anyone have any ideas?

    Thanks

  • Jay M says:

    After selecting your data range (i.e. all your boxes), using “3-D line” chart type is perhaps a good option to give you a graph like that shown.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

David Hueber
David Hueber

Chief Executive Officer (CEO), Principal Consultant