NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

jdfoxmicro's avatar
Aug 24, 2020

BTRFS, Sync Writes, and performance

Hello,

 

Prior to OS 6, with the ext4/LVM file system, the ReadyNAS had a simple option to disable write caching (in System/Performance of RAIDiator 4.2.31, for example).  When you did that, you could see, next to each physical disk, an indicator that the write cache was "OFF". Any write with the FUA flag, or any sync command, sent by an application connecting to an iSCSI LUN presumably had no effect, as all writes were committed to the disk anyway.  And all writes made by an application which allowed for it to be cached for speed (that is, with no FUA flag), were committed as well.  Regardless, the system performed just fine.

 

With OS 6, there is no option to control the disk cache or any caching the OS might do in its kernel RAM.  When you create an iSCSI LUN, however, there is the option to "Sync Writes".  Since it is configurable per LUN, each of which is a file on the NAS's volume, it appears this refers to the fsync command of BTRFS (the file system now used in OS 6), which is sort of a hybrid of the full cache sync (flush) and a single FUA write, in that BTRFS only flushes cached file data related to the current transaction. This setting is "Allowed" by default, meaning, I presume, that it will call fsync only when an application sends FUA or sync.

 

The other options are "Forced", presumably meaning it will follow every write with fsync, and "Disabled", meaning it will never call fsync even if an application sends FUA or sync.

 

The thing is, with any setting other than "Disabled", the system performs unbelievably slowly.  I've tested it with all kinds of scenarios, and it's a simple fact.  This means there is no way to ensure writes are committed on demand from an application, let alone at all times, and still achieve acceptable performance, which ReadyNAS devices prior to OS 6 were apparently able to do.

 

The developers of BTRFS have long tried to make the fsync command less expensive, but reality is, it still is. What is NETGEAR doing to address this? How can we have a NAS that can commit all writes to the platter so we can use this for critical data and protect against corruption in the event of an abnormal shut down?

 

And can anyone confirm that ReadyNAS devices prior to OS 6 really did disable the write cache?  Or did it only disable it in the disks, but still cache writes in its system RAM?  Either way, users and administrators who still have these in production should know, so we know what preventive measures we should take to protect our data.

 

Jeffrey Fox

 

2 Replies

  • I have an older ReadyNas Ultra 6 that is still running 4.2.28 I believe and the write caching won't affect any write caching built-in on the drives (which on today's drives are typically using nvram to essentially have a micro ssd for the cache in case of a power outage).  But I believe it does change how the ram is used as I think I recall the write speed changing in my speed tests when evauluating the unit.

    • StephenB's avatar
      StephenB
      Guru

      SamirD wrote:

      I have an older ReadyNas Ultra 6 that is still running 4.2.28 I believe and the write caching won't affect any write caching built-in on the drives (which on today's drives are typically using nvram to essentially have a micro ssd for the cache in case of a power outage).  But I believe it does change how the ram is used as I think I recall the write speed changing in my speed tests when evauluating the unit.


      My Pro-6 is still on 4.2.31, and that is my impression also. 

       

      This is easy to check on OS-6, as smartctl will tell you.

      # smartctl -x /dev/sda | grep -i cache
      Write cache is:   Enabled
      Wt Cache Reorder: Enabled
      #

      But the older version of smartctl on OS 4 systems does not.

      PRO:~# smartctl -x /dev/sda | grep -i cache
      PRO:~#

       

      To the main question:  I don't use iSCSI, but my understanding is that the performance issue you are seeing isn't unique to ReadyNAS (or BTRFS).  I've seen similar posts on FreeNAS using ZFS.  

       

      It's possible that using metadata tiering would help.  Or I guess leave it disabled, and make sure the NAS is UPS protected.

       

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More