Drive's internal cache: should it be disabled?

Status
Not open for further replies.

Ivan Malich

Cadet
Joined
Aug 2, 2016
Messages
1
Hi.
Noob's question I suppose, but I've found no answer searching this forum, so ...
From my previous RAID-controllers experience I have strong belief that drive's internal write cache should always be disabled . I've used at least mid-range controllers with protected write cache before, not that cheapest ones with no battery or flash-based cache protection, so disabling drive's internal cache had no visible impact on array performance.
From what I've already read about FreeNAS (especially those threads about ESXi iSCSI storages, ZIL & SLOG, zpools with sync write policy set to 'always') I suppose that disabling drive's cache would have no impact on write performance of SLOG-on-SSD-equipped FreeNAS volumes with sync writes.
1) Am I right saying that?
2) AFAIU, drive's internal cache should be disabled in FreeNAS to achieve data integrity just as in any other storage system equipped with reliable write cache. That's right?
 

HoneyBadger

actually does care
Administrator
Moderator
iXsystems
Joined
Feb 6, 2014
Messages
5,112
Bitaemo Ivan.

The ZFS file system that FreeNAS uses is different from other RAID controllers in that it is able to manage the drive's cache, including enforcing flushing it to platter, directly. When ZFS queues up data to be sent to a drive, it sends it to the drive, then follows it up with a command to flush any cached writes. Once the disk replies back that the flush was successful, ZFS will then consider the blocks as safely written from its own transaction group.

(This is also why it's important to not use a RAID card with ZFS, as RAID cards with protected cache will very often, if not always, mess with a SCSI "SYNCHRONIZE CACHE" command.)

SLOG works at a higher level - this lets ZFS reply back to the remote host (eg: ESXi host) that ZFS took the data from it and has it safely stored on the SLOG - but it doesn't force ESXi to wait for the individual disk. Think of it as a nighttime drop box for a bank. Your money is not in the vault yet, but it's inside the bank, where they are protecting it with their walls/cameras/guards until they can move it to the vault.

Short answer: Leave write cache enabled. Performance will suffer otherwise, even if you have an SLOG device.
 
Status
Not open for further replies.
Top