测量使用bufferedIO(默认)的throughput
$ sudo hdparm -t /dev/sda1 /dev/sda1: Timing buffered disk reads: 344 MB in 3.00 seconds = 114.55 MB/sec测量使用directIO的throughput
$ sudo hdparm -t --direct /dev/sda1 /dev/sda1: Timing O_DIRECT disk reads: 572 MB in 3.01 seconds = 190.08 MB/sec
iozone - benchmark filesystem
使用directio (-I), 一共1m个record (-s 1m), 每个record 大小为4kB (-r 4k), 分64个线程来读(-t 64), 使用POSIX pthread (-T). benchmark的类型由-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
/localfs$ iozone -I -s 1m -r 4k -i 0 -i 2 -t 64 -T Iozone: Performance Test of File I/O Version $Revision: 3.308 $ Compiled for 64 bit mode. Build: linux 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, Gavin Brebner, Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy, Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root. Run began: Wed Apr 20 18:07:37 2011 O_DIRECT feature enabled File size set to 1024 KB Record Size 4 KB Command line used: iozone -I -s 1m -r 4k -i 0 -i 2 -t 64 -T 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. Throughput test with 64 threads Each thread writes a 1024 Kbyte file in 4 Kbyte records Children see throughput for 64 initial writers = 69712.78 KB/sec Parent sees throughput for 64 initial writers = 53411.80 KB/sec Min throughput per thread = 929.10 KB/sec Max throughput per thread = 1169.92 KB/sec Avg throughput per thread = 1089.26 KB/sec Min xfer = 820.00 KB Children see throughput for 64 rewriters = 68695.96 KB/sec Parent sees throughput for 64 rewriters = 67008.63 KB/sec Min throughput per thread = 844.21 KB/sec Max throughput per thread = 1173.81 KB/sec Avg throughput per thread = 1073.37 KB/sec Min xfer = 744.00 KB Children see throughput for 64 random readers = 79020.74 KB/sec Parent sees throughput for 64 random readers = 78204.49 KB/sec Min throughput per thread = 1117.41 KB/sec Max throughput per thread = 1314.01 KB/sec Avg throughput per thread = 1234.70 KB/sec Min xfer = 872.00 KB Children see throughput for 64 random writers = 44820.63 KB/sec Parent sees throughput for 64 random writers = 38207.94 KB/sec Min throughput per thread = 647.45 KB/sec Max throughput per thread = 748.67 KB/sec Avg throughput per thread = 700.32 KB/sec Min xfer = 888.00 KB iozone test complete.