Will a RAID controller pass on flush commands when controller's cache is in write-through mode?
I did a performance test with fio, and told the OS to use sync I/O.
fio --name=random-write --rw=randwrite --bs=4k --numjobs=1 --size=4g --iodepth=1 --runtime=60 --time_based --end_fsync=1 --atomic=1 --sync=1
With RAID controller, physical drive cache = On:
write: IOPS=344, BW=1377KiB/s (1410kB/s)(80.7MiB/60001msec); 0 zone resets
With RAID controller, physical drive cache = Off:
write: IOPS=27, BW=111KiB/s (114kB/s)(6688KiB/60005msec); 0 zone resets
In another Linux host with cache on, native SATA port:
write: IOPS=25, BW=102KiB/s (104kB/s)(6108KiB/60005msec); 0 zone resets
Clearly, the odd one out is the RAID controller with drive cache on. So it seems to be ignoring the sync commands.
It's not a bullet-proof argument, but it seems unlikely that the RAID controller does the right thing, so I'll give up on that approach unless there's a better answer.