Call Andrew Thomson today to find out more:
+44 (0) 800 852 7671

Read Testing

Sequential read performance can be tested trivially with multiple runs of dd copying a large file into /dev/null, varying the block size and other parameters to get the best performance. dd itself puts a minimal load on the system, as does the code behind /dev/null, ensuring that throughput figures accurately reflect the capabilities of the storage and associated system configuration.

dd if=/raid/hugefile of=/dev/null bs=64M iflag=direct

Note the use of iflag=direct, this bypasses kernel caching and substantially increases performance.

Write Testing

When testing write performance, it is most common to copy from /dev/zero to the storage array, since this device provides a convenient source of data e.g.:

dd if=/dev/zero of=/raid/hugefile bs=64M oflag=direct

This is fine for arrays of hard drives, where /dev/zero is much faster than the disks themselves, but can become an issue as overall storage performance increases. With larger arrays of SSDs, as in our PacketRAID recorder, the time taken to zero each memory block before it is written is significant, and reduces dd‘s throughput markedly. This makes it difficult to be confident that the storage is optimally tuned, or to accurately measure its speed.

Custom Device

To address this issue, we decided that the best approach would be to develop a new Linux device – /dev/phony – that worked in a similar way to /dev/null, but for reads. It turned out to be surprisingly simple, and we are grateful to Valerie Henson for permission to base our work on her example device driver code. Now, whenever a read request is received, it is immediately satisfied without any actual data being copied.

As expected, testing /dev/phony with dd and /dev/null yields spectacular results, since no data is actually being copied:

# dd if=/dev/phony of=/dev/null bs=2047M count=1000000
1000000+0 records in
1000000+0 records out
2146435072000000 bytes (2.1 PB) copied, 0.291501 s, 7.4 PB/s

This confirms our earlier assumption that dd itself is lightweight and does not impact performance when used for testing.

Call Andrew Thomson today to find out more:
+44 (0) 800 852 7671
Call Andrew Thomson today to find out more:
+44 (0) 800 852 7671