How To Measure Disk Performance?
- Bernhard Kauer
- Status quo
- June 27, 2023
How to measure disk performance?
The random access performance of a hard disk is dictated by the rotational speed which seldom changed. Thus, throughput was - for quite a long time - the only relevant performance indicator. On Linux a simple 𝒅𝒅
with 𝒊𝒇𝒍𝒂𝒈=𝒅𝒊𝒓𝒆𝒄𝒕
is usually sufficient to measure it.
With the switch to SSDs this changed as they really shine at random access patterns. Furthermore, they can often read blocks faster from flash than data travels to the application. Thus, multiple small requests have to be in-flight to reach the maximum performance of the system.
With the advent of the PCI-based SSDs this problem got even worse. These disks are so fast - or the OS overhead is so large - that a single CPU cannot handle the load anymore. The maximum throughput can only be achieved when executing multiple jobs on different CPU cores.
As utilizing a single read operation is insufficient to benchmark a disk nowadays, one relies on 𝒊𝒐_𝒖𝒓𝒊𝒏𝒈
or 𝒍𝒊𝒃𝒂𝒊𝒐
to submit multiple requests to the Linux kernel without blocking the current thread.
A benchmark can be implemented within a few hundred lines of code but utilizing an existing tool like 𝒇𝒊𝒐
leads to nearly the same results.