linux – How to test block device read/write speed

Question:

All I've seen so far on this topic is hdparm -tT and dd with a bunch of not entirely clear parameters.

What I would like to see: the dependence of read and write speeds on the size of the block and its position. Of course, the program should work from the command line without a graphical environment.

Answer:

iops is exactly what you are asking for. Returns the table BLOCK | SPEED

/dev/md0,  12.00 TB, 32 threads:
 512   B blocks:  466.5 IO/s, 233.3 KiB/s (  1.9 Mbit/s)
   1 KiB blocks:  453.2 IO/s, 453.2 KiB/s (  3.7 Mbit/s)
   2 KiB blocks:  445.0 IO/s, 890.1 KiB/s (  7.3 Mbit/s)
   4 KiB blocks:  465.0 IO/s,   1.8 MiB/s ( 15.2 Mbit/s)
   8 KiB blocks:  441.4 IO/s,   3.4 MiB/s ( 28.9 Mbit/s)
  16 KiB blocks:  444.9 IO/s,   7.0 MiB/s ( 58.3 Mbit/s)
  32 KiB blocks:  433.9 IO/s,  13.6 MiB/s (113.7 Mbit/s)
  64 KiB blocks:  444.8 IO/s,  27.8 MiB/s (233.2 Mbit/s)
 128 KiB blocks:  465.3 IO/s,  58.2 MiB/s (487.9 Mbit/s)
 256 KiB blocks:  409.0 IO/s, 102.3 MiB/s (857.8 Mbit/s)
 512 KiB blocks:  212.4 IO/s, 106.2 MiB/s (890.8 Mbit/s)
   1 MiB blocks:  142.3 IO/s, 142.3 MiB/s (  1.2 Gbit/s)
   2 MiB blocks:   67.1 IO/s, 134.2 MiB/s (  1.1 Gbit/s)
   4 MiB blocks:   40.9 IO/s, 163.7 MiB/s (  1.4 Gbit/s)
   8 MiB blocks:   21.5 IO/s, 171.6 MiB/s (  1.4 Gbit/s)
Scroll to Top