Score:0

Will a RAID controller pass on flush commands when controller's cache is in write-through mode?

in flag

When the controller's battery-backed write cache is disabled, but the drive's write caches are enabled, will the controller pass on the flush commands from the OS to the drives (all physical drives in RAID0 or RAID1 virtual drives)?

The reason I ask is that the performance is much better with the drive caches enabled. It's even much better than with drive caches off and controller's cache on. If it is able to flush the caches on demand, then there shouldn't (in theory) be any filesystem corruption on power loss, with modern OSes and filesystems. [I realise there's a real risk of bugs, but power cuts are extremely rare where I am, so it may be worth the risk if it at least works on paper.]

If the answer is that it depends on the controller: I'm using MegaRaid 9280. Single disk RAID0s. Or is there any way to test this reliably?

Score:1
in flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.