iozone使用简介

iozone(www.iozone.org)是一个文件系统的benchmark工具,可以测试不同的操作系统中文件系统的读写性能。
可以测试 Read, write, re-read,re-write, read backwards, read strided, fread, fwrite, random read, pread,
mmap, aio_read, aio_write 等等不同的模式下的硬盘的性能。

命令详情

-a Auto mode
-A Auto2 mode
-b Filename Create Excel worksheet file
-B Use mmap() files
-c Include close in the timing calculations
-C Show bytes transferred by each child in throughput testing
-d # Microsecond delay out of barrier
-D Use msync(MS_ASYNC) on mmap files
-e Include flush (fsync,fflush) in the timing calculations
-E Run extension tests
-f filename to use
-F filenames for each process/thread in throughput test
-g # Set maximum file size (in kBytes) for auto mode (or #m or #g)
-G Use msync(MS_SYNC) on mmap files
-h help
-H # Use POSIX async I/O with # async operations
-i # 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)
-I Use VxFS VX_DIRECT, O_DIRECT,or O_DIRECTIO for all file operations
-j # Set stride of file accesses to (# * record size)
-J # milliseconds of compute cycle before each I/O operation
-k # Use POSIX async I/O (no bcopy) with # async operations
-K Create jitter in the access pattern for readers
-l # Lower limit on number of processes to run
-L # Set processor cache line size to value (in bytes)
-m Use multiple buffers
-M Report uname -a output
-n # Set minimum file size (in kBytes) for auto mode (or #m or #g)
-N Report results in microseconds per operation
-o Writes are synch (O_SYNC)
-O Give results in ops/sec.
-p Purge on
-P # Bind processes/threads to processors, starting with this cpu
-q # Set maximum record size (in kBytes) for auto mode (or #m or #g)
-Q Create offset/latency files
-r # record size in Kb
or -r #k … size in kB
or -r #m … size in MB
or -r #g … size in GB
-R Generate Excel report
-s # file size in Kb
or -s #k … size in kB
or -s #m … size in MB
or -s #g … size in GB
-S # Set processor cache size to value (in kBytes)
-t # Number of threads or processes to use in throughput test
-T Use POSIX pthreads for throughput tests
-u # Upper limit on number of processes to run
-U Mount point to remount between tests
-v version information
-V # Verify data pattern write/read
-w Do not unlink temporary file
-W Lock file when reading or writing
-x Turn off stone-walling
-X filename Write telemetry file. Contains lines with (offset reclen compute_time) in ascii
-y # Set minimum record size (in kBytes) for auto mode (or #m or #g)
-Y filename Read telemetry file. Contains lines with (offset reclen compute_time) in ascii
-z Used in conjunction with -a to test all possible record sizes
-Z Enable mixing of mmap I/O and file I/O
-+b #,# burst size (KB),sleep between burst (mili-second)
-+E Use existing non-Iozone file for read-only testing
-+F Truncate file before write in thread_mix_test
-+J Include think time (-j #) in throughput calculation
-+K Sony special. Manual control of test 8.
-+m Cluster_filename Enable Cluster testing
-+d File I/O diagnostic mode. (To troubleshoot a broken file I/O subsystem)
-+u Enable CPU utilization output (Experimental)
-+x # Multiplier to use for incrementing file and record sizes
-+p # Percentage of mix to be reads
-+r Enable O_RSYNC|O_SYNC for all testing.
-+t Enable network performance test. Requires -+m
-+n No retests selected.
-+k Use constant aggregate data set size.
-+q Delay in seconds between tests.
-+l Enable record locking mode.
-+L Enable record locking mode, with shared file.
-+B Sequential mixed workload.
-+D Enable O_DSYNC mode.
-+A # Enable madvise. 0 = normal, 1=random, 2=sequential
3=dontneed, 4=willneed
-+N Do not truncate existing files on sequential writes.
-+S # Dedup-able data is limited to sharing within each numerically
identified file set.
-+W # Add this value to the child thread ID, so that additional files
can be added while maintaining the proper dedupability with previously
existing files that are within the same seed group (-+S).
-+V Enable shared file. No locking.
-+X Enable short circuit mode for filesystem testing ONLY
ALL Results are NOT valid in this mode.
-+Z Enable old data set compatibility mode. WARNING… Published
hacks may invalidate these results and generate bogus, high
values for results.
-+w ## Percent of dedup-able data in buffers.
-+y ## Percent of dedup-able within & across files in buffers.
-+C ## Percent of dedup-able within & not across files in buffers.
-+a ## Percent of data that is compressible.
-+Q ## Dedup granule size.
-+H Hostname Hostname of the PIT server.
-+P Service Service of the PIT server.
-+z Enable latency histogram logging.
-+M Enable Dedup+compress option. (Experimental).
-+R enable iozone to take filenames from a file.

命令使用举例

测试命令如下:
iozone -Rab [results file name] -i 0 -i 1 -+u -f [path to directory on NAS device under test] -q 64k -n 32M -g 1G -z

我对这条命令解释下:
-R 产生execl格式的输出日志;
-a 在希望的文件系统上测试,不过只有-a的话会进行全面测试,要花费很长时间,最好用-i指定测试范围
-b 将产生二进制的execl的日志文件名
[results file name] 测试结果存放路径 ,如 D:\t 其中t是execl文件名

-i # 用来指定测试内容.
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
测试格式为-i #,比如测试写:-i 0,测试读和写:-i 0 -i 1。

-+u 挂载点
-f 指定测试文件
-q 指定最大文件块大小(这里的 -q 64k 包括了4K,8K,16K,32K,64K)
-r 指测试的文件块大小(与-q有别,-r 64k只进行64k的测试)
-s 测试的文件大小
-n 指定最小测试文件大小
-g 指定最大测试文件大小
-C 显示每个节点的吞吐量
-c 测试包括文件的关闭时间

使用这条测试命令测试NAS后,我对下边产生的Execl文件中的一段表进行下解释,很简单的:
iozone使用简介
在Execl文件中的这段表,它说明了这个表单是关于write的测试结果,左侧一列是测试文件大小(Kbytes),最上边一行是记录大小,中间数据是测试的传输速度。举例说明,比如表中的“5300”,意思是测试文件大小为32M,以记录大小为4K来进行传输,它的传输速度为5300 Kbytes/s,最好使用Execl中的画图工具,画出图表会更加直观。

在Android下使用IOZone

IOZone工具通过Windows的adb工具安装到Android:
1、在Pc上安装ADB环境(网上有安装方法,安装后需要将adb.exe的路径保存到系统环境变量下),或者直接安装PC端的“应用宝”;
2、将iozone的工具放到手机的目录下,如"/sdcard/",方式如下:
iozone使用简介
以上命令就是把位于E盘根目录下的iometer工具复制到手机的/sdcard/目录下。
其中,adb push是推送命令,iozone文件在E盘根目录下,/sdcard/为手机端的目录。
可能出现的异常:
A、adb工具没有安装好,会提示找不到adb的现象;
B、iozone文件找不到,请确保当前操作路径下有该文件;
C、/sdcard/目录不存在,如果手机不存在该路径,请尝试用/storage/sdcard0/
3、输入adb shell命令,切到手机的iozone工具是在目录;
iozone使用简介
4、使用iozone工具,Android设备必须root过,否则执行会出现权限不足,如下:
iozone使用简介
5、在已经root过的Android平台下,执行"su"命令,切到root权限:
iozone使用简介
切换成功后,会显示一个#
6、可以使用iozone工具了,如下所示:
iozone使用简介

相关文章:

  • 2021-10-12
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2021-12-15
  • 2021-12-31
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案