1

I am trying to make sense of sequential disk write performance on a spinning hard disk. I am using direct and sync io to bypass the page cache. For small block size (4KB) fio reports an iops of ~11. So this means fio is issuing 11 write system calls, each of 4k size (so total bandwidth = 11*4k = 44kb/s). But when I monitor the disk using iostat, it tells me that the disk is seeing ~60iops (w/s), with average request size of 4k (wareq-sz), for a total bandwidth of 60*4k ~ 240kb/s (wkB/s). So my questions are the following

  1. Why is my throughput so low even when doing sequential writes? (small block size should not really matter because the disk head should not move around much)

  2. Who is causing the 3x write amplification which is seen in iostat.

I am enclosing the fio jobs file as well as iostat output

jobs file

[global]
filename=/mnt/500gbhdd/fio_file
runtime=30s
ioengine=sync
time_based
direct=1 
sync=1 
rw=write
size=5G
wait_for_previous


[4k]
bs=4k

iostat output

Dávid Pásztor
  • 51,403
  • 9
  • 85
  • 116
sha
  • 614
  • 6
  • 16
  • I suspect `sync` causes your file's metadata to be updated with each `write()` operation, which will cause disk head seeks. 60 iops is typical for a 5400- or 7200-RPM spinning SATA disk in that situation – Andrew Henle Jan 15 '22 at 15:53
  • thanks, you are right. I disabled most metadata writes in ext4 and found that the performance came close to 100MB/s – sha Jan 17 '22 at 13:03

0 Answers0