測試磁碟 I/O 的工具

測試磁碟 I/O 的工具有 dd, hdparm , Iometer 或是 Fio 的 Disk I/O 來測試儲存裝置的速度.

使用上述四種測試 Disk I/O 工具,環境為一顆 SSD (Micron RealSSD P400e 200Gb SATA III 2.5) 硬碟,連接埠為 SATA 2.0 Intel® I/O Controller Hub 10 (ICH10) ,SATA 2.0 速度上限為
SATA 2.0 Generation 2( 3 Gbit/s) – (20% overhead – 每八個位元的資料串上用十位元來加以編碼) 2.4 Gbit/s = 300 MByte/s

3Gbx0.8=2.4Gb
2.4Gb/8=300MByte (1byte=8bits)

  • ddhttp://benjr.tw/458
    測試硬碟讀(READ)速度

    #sync; time `dd if=/dev/sdb of=/dev/null bs=1M count=2048`
    
    2048+0 records in
    2048+0 records out
    2147483648 bytes (2.1 GB) copied, 8.28568 s, 259 MB/s
    
    real    0m8.288s
    user    0m0.007s
    sys     0m1.960s
    
  • hdparmhttp://benjr.tw/450
    #dparm -t /dev/sdb
    
    /dev/sdb:
     Timing buffered disk reads: 770 MB in  3.00 seconds = 256.53 MB/sec
    
  • FioFio – Flexible I/O Tester
    #fio --filename=/dev/sdb --direct=1 --rw=randrw --ioengine=libaio --bs=4k --rwmixread=100 --iodepth=16 --numjobs=16 --runtime=60 --
    
    group_reporting --name=4ktest
    
    512ktest: (g=0): rw=randrw, bs=512K-512K/512K-512K/512K-512K, ioengine=libaio, iodepth=16
    ...
    512ktest: (g=0): rw=randrw, bs=512K-512K/512K-512K/512K-512K, ioengine=libaio, iodepth=16
    fio-2.1.3
    Starting 16 processes
    Jobs: 16 (f=16): [rrrrrrrrrrrrrrrr] [100.0% done] [262.0MB/0KB/0KB /s] [524/0/0 iops] [eta 00m:00s]
    512ktest: (groupid=0, jobs=16): err= 0: pid=20128: Wed May 14 14:46:47 2014
      read : io=16371MB, bw=278087KB/s, iops=543, runt= 60281msec
        slat (usec): min=19, max=441961, avg=24841.99, stdev=91484.27
        clat (msec): min=5, max=966, avg=445.56, stdev=137.67
         lat (msec): min=5, max=1336, avg=470.40, stdev=165.62
        clat percentiles (msec):
         |  1.00th=[   66],  5.00th=[  338], 10.00th=[  379], 20.00th=[  400],
         | 30.00th=[  412], 40.00th=[  420], 50.00th=[  433], 60.00th=[  441],
         | 70.00th=[  453], 80.00th=[  465], 90.00th=[  502], 95.00th=[  816],
         | 99.00th=[  873], 99.50th=[  889], 99.90th=[  930], 99.95th=[  938],
         | 99.99th=[  955]
        bw (KB  /s): min= 1633, max=32443, per=6.57%, avg=18283.40, stdev=7191.12
        lat (msec) : 10=0.01%, 20=0.02%, 100=3.84%, 250=0.67%, 500=85.21%
        lat (msec) : 750=2.74%, 1000=7.51%
      cpu          : usr=0.01%, sys=0.14%, ctx=5258, majf=0, minf=471
      IO depths    : 1=0.1%, 2=0.1%, 4=0.2%, 8=0.4%, 16=99.3%, 32=0.0%, >=64=0.0%
         submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
         complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.1%, 32=0.0%, 64=0.0%, >=64=0.0%
         issued    : total=r=32741/w=0/d=0, short=r=0/w=0/d=0
    
    Run status group 0 (all jobs):
       READ: io=16371MB, aggrb=278087KB/s, minb=278087KB/s, maxb=278087KB/s, mint=60281msec, maxt=60281msec
    
    Disk stats (read/write):
      sdb: ios=32687/0, merge=0/0, ticks=8082564/0, in_queue=8096520, util=99.92%
    
  • Iometerhttp://benjr.tw/370
    iometer_ssd01

結果整理

  • dd : 259 MB/sec
  • haparm : 256.53 MB/sec
  • Fio : 262 MB/sec
  • Iometer :189.43 MB/sec

??奇怪 Iometer 設定不管怎麼調整都到不了 250MB/sec 以上.

Tomshardware 有針對 micron p400e 這顆硬碟做測試.大概可以跑到 400多MBs 以上.(我需要換一台好一點的 Server 了)

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *