Hard drive benchmark suite (iozone, bonnie++)

更新時間: 2018-07-27

 

目錄


bonnie++

 

安裝:

apt-get install bonnie++

OPTS:

-d dir                 the directory to use for the tests

-u user               user-id to use

-s  N:chunk         test file 的 size (它會保儲在 testdir 內, 名叫 "Bonnie.<pid>") [megabytes(default=RAM X 2)][:chunk-size(default: 8192)]

-n  format           the number of files for the file creation test (N X 1024 <= measured in multiples of 1024 files)

                 format: number:max:min:num-directories:chunk-size ( 0 if not specified )

 

-p           number  of processes to simultaneously

-x           number of test runs.

-b           no write buffering.  fsync() after every write.

 

If a test completes in less than 500ms then the output will be displayed as "++++"

Example:

bonnie -u tim -d /data/test

output:

Using uid:1001, gid:1001.
Writing a byte at a time...done
Writing intelligently...done
Rewriting...done
Reading a byte at a time...done
Reading intelligently...done
start 'em...done...done...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...done.
Create files in random order...done.
Stat files in random order...done.
Delete files in random order...done.
......... RESULT .........

在 /data/test 內有 file

Bonnie.19501

Result:

Version  1.96       ------Sequential Output------ --Sequential Input- --Random-
Concurrency   1     -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
server          16G  1197  96 73291   7 54020   5  5953  89 153569   8 150.9   4
Latency             15278us    3692ms    1753ms   32608us     159ms    8508ms
Version  1.96       ------Sequential Create------ --------Random Create--------
server              -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16 19486  15 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++
Latency              9924us     336us    1174us     447us      10us    1182us
... cvs result  ...

report tools

- bon_csv2html (由於 txt 的 result 不好看, 所以這 cmd 都幾重要)
- bon_csv2txt

i.e.

echo "RESULTS" | bon_csv2html > report.html

 

 

 


iozone

 

Homepage: http://www.iozone.org/

 * ANSII ‘C’ source

 * 支援 Window 平台

 * 在 debian 的 repository 上它是 non-free 的

安裝後有以下工具:

/opt/iozone/bin/iozone
/opt/iozone/bin/pit_server
/opt/iozone/bin/Generate_Graphs
/opt/iozone/bin/gengnuplot.sh

應用1:

-a                # Used to select full automatic mode.

                   #  record sizes of 4k to 16M for file sizes of 64k to 512M.

-A                # This version of automatic mode provides more coverage but consumes a bunch of time.

-R                # Generate Excel report. Iozone will generate an Excel compatible report to standard out.  (space delimited)

-b filename   #  create a binary file format file in Excel compatible

-g N             # Set maximum file size (in Kbytes) for auto mode.

-n N             # Set minimum file size (in Kbytes) for auto mode.

-O               # Give results in operations per second.

# report 不要 save 在用 device 上

iozone -a -Rb /root/result.wks

應用2:

./iozone -l 5 -u 5 -r 1m -s 100m -F /home/f1 /home/f2 /home/f3 /home/f4 /home/f5 > /tmp/report.txt

  • -u     # up limit (how many process)
  • -l       # Set the lower limit on number of processes to run.
  • -F      # temporary filename   <--- 如果是有 5 個 process,  那要有 5 個 tmp file
  • -s      # size of the file that needs to be tested ( Unit: k | m | g )
  • -r      # record size

IOzone benchmarks a file system by breaking up a file of a given size into records.

IOzone to execute all tests over a file of 100MB, Read/Write operations are split into records of 1MB.

It means that 100 operations are done over records of 1MB to achieve the tests.

The first number is the size of the file. The second is the record length.

 

應用3:

-i #          Used to specify which tests 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/Repreadv

應用4:

-I             # Use DIRECT I/O for all file operations.

               # Tells the filesystem that all operations are to bypass the buffer cache and go directly to disk.

-o            # Writes are synchronously written to disk. (O_SYNC).

-H N        # Use POSIX async I/O with N async operations.

               # Iozone will use POSIX async I/O with a bcopy from the async buffers back into the applications buffer.

-k N         # Use POSIX async I/O (no bcopy) with # async operations.

Compile

cd /usr/src/

wget http://www.iozone.org/src/current/iozone3_482.tar

tar -xf iozone3_482.tar

cd iozone3_482/src/current

make linux-AMD64              # 不同平台用不用 parameter

cp iozone /usr/sbin


 

 

Creative Commons license icon Creative Commons license icon