Friday, January 6, 2017

Hard disk performance measured with fio

Since some times now, I collect the performance of various storages devices, using fio, the flexible Input/Ouput tester.

With FIO you can collect sequential and IOPS statistics. Sequential thoughput is what you would need if for instance extracting a large tar archive. or copying a disk image. IOPS, where I measure a mix of 70% reads, 30% write, would be what you need for an OLTP workload.

Sequential writes:

Let's try from the slowest to the fastest, using the command
fio  --size=9G --bs=64k --rw=write --direct=1 --runtime=60 --name=64kwrite --group_reporting
The ouput from this test should match the column wMB/s of the command iostat -mx 2, executed during the test. 

 

0) Mist FPGA exposed as USB 1.1 device: 244 KB/s  (well that is slow !)
lsusb
Bus 001 Device 070: ID 1c40:0537 EZPrototypes MIST Board

fio  --size=50M --bs=4k --rw=write --direct=1 --runtime=60 --name=64kwrite --group_reporting
64kwrite: (g=0): rw=write, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1

   bw (  KiB/s): min=   16, max=  504, per=100.00%, avg=309.30, stdev=152.13, samples=93
   iops        : min=    4, max=  126, avg=77.24, stdev=38.00, samples=93

  WRITE: bw=239KiB/s (244kB/s), 239KiB/s-239KiB/s (244kB/s-244kB/s), io=14.1MiB (14.7MB), run=60340-60340msec



1) SD Card Sandisk Extreme Pro : 10MB/s
dmesg | grep mmc0
[    3.019323] mmc0: new ultra high speed SDR50 SDHC card at address e624
(SDR50 indicates a 50MB/s bus speed)

64kwrite: (groupid=0, jobs=1): err= 0: pid=12583: Sat Jan  7 15:24:55 2017
  write: io=512000KB, bw=11702KB/s, iops=182, runt= 43754msec

 ...
    bw (KB  /s): min= 1280, max=13184, per=99.97%, avg=11697.93, stdev=2798.43


2) A 5400rpm disk, mounted over a USB 2.0 port: 35 MB/s
[6:0:0:0]    disk    WDC WD20 NPVZ-00WFZT0     01.0  /dev/sdb

...
64kwrite: (groupid=0, jobs=1): err= 0: pid=13635: Fri Jan  6 14:55:11 2017
  write: io=2056.1MB, bw=35035KB/s, iops=547, runt= 60120msec
...
    bw (KB  /s): min= 7168, max=61696, per=100.00%, avg=35101.89, stdev=10726.73
...

3) Same 5400rpm disk, mounted over a USB 3.0 port:  112 MB/s

64kwrite: (groupid=0, jobs=1): err= 0: pid=7877: Fri Jan 19 17:01:47 2018
  write: IOPS=1703, BW=106MiB/s (112MB/s)(6388MiB/60001msec)

4) USB 3.2 flash drive via USB 3.2 (Superspeed +) port: 235 MB/s
...
/:  Bus 002.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/10p, 10000M
    |__ Port 006: Dev 002, If 0, Class=Mass Storage, Driver=uas, 5000M


64kwrite: (groupid=0, jobs=1): err= 0: pid=155664: Wed Nov 13 11:26:51 2024
  write: IOPS=3579, BW=224MiB/s (235MB/s)(9216MiB/41192msec); 0 zone resets


 5) Samusung SSD 840 over SATA port: 360MB/s

 64kwrite: (groupid=0, jobs=1): err= 0: pid=16095: Fri Jan  6 15:17:56 2017
 write: io=9216.0MB, bw=365400KB/s, iops=5709, runt= 25827msec
...
    bw (KB  /s): min=345472, max=396160, per=99.87%, avg=364934.33, stdev=10505.38

Random Readwrites:


Using the command:
 fio  --size=2G --bs=4k --rw=randrw --rwmixread=70 --direct=1 --runtime=60 --numjobs=4 --name=4k7030test --group_reporting
The ouput from this test should match the column r/s and w/s of the command iostat -mx 2, executed during the test.

1) SD Card Sandisk Extreme Pro: 364 iops reading, 154 writing
dmesg | grep mmc0
[    3.019323] mmc0: new ultra high speed SDR50 SDHC card at address e624
(SDR50 indicates a 50MB/s bus speed)

4k7030test: (groupid=0, jobs=4): err= 0: pid=12724: Sat Jan  7 15:29:45 2017
  read : io=87488KB, bw=1457.8KB/s, iops=364, runt= 60017msec
  write: io=37108KB, bw=633130B/s, iops=154, runt= 60017msec



 2) A 5400rpm disk, over a USB 3.0 port: 37 iops reading, 15 writing
[6:0:0:0]    disk    WDC WD20 NPVZ-00WFZT0     01.0  /dev/sdb

4k7030test: (groupid=0, jobs=4): err= 0: pid=12756: Sat Jan  7 15:31:02 2017
  read : io=9044.0KB, bw=154135B/s, iops=37, runt= 60084msec

  write: io=3796.0KB, bw=64694B/s, iops=15, runt= 60084msec

3) USB 3.2 flash drive via USB 3.2 (Superspeed +) port: 9816 iops reading,  4214 writing
...
/:  Bus 002.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/10p, 10000M
    |__ Port 006: Dev 002, If 0, Class=Mass Storage, Driver=uas, 5000M

4k7030test: (groupid=0, jobs=4): err= 0: pid=155797: Wed Nov 13 11:29:49 2024
  read: IOPS=9816, BW=38.3MiB/s (40.2MB/s)(2301MiB/60001msec)
  write: IOPS=4214, BW=16.5MiB/s (17.3MB/s)(988MiB/60001msec);


4) Samusung SSD 840 over SATA port: 22484 iops reading, 9648 writing

4k7030test: (groupid=0, jobs=4): err= 0: pid=12265: Sat Jan  7 15:15:54 2017
  read : io=5269.9MB, bw=89937KB/s, iops=22484, runt= 60001msec

  write: io=2261.4MB, bw=38594KB/s, iops=9648, runt= 60001msec


A very good summ up of fio benchmarks is also available on the Thomas Krenn wiki (in german)