NFS and sync writes - is it possible to change the policy?

Hi all,

a friend of mine runs a TN CE (25.04.2.5) and connected a couple of digital VCRs. These devices are old - outdated Linux kernel, outdated everything.

Before he ran TN CORE and we used SMB mounts as guest which are discouraged, nowadays. So when moving to TN CE we changed all SMB shares to proper authentication and ACLs. Seems like these boxes cannot do that.

So we changed to NFS mounts. maproot=root - it’s all contained in a single dataset, not a security problem inside an isolated home network. Works. So far so good.

No when he uses time shift, i.e. starts recording a show, then decides to watch it while still recording but, say, 10 minutes later, sometimes the playback stutters.
We do not have any of this when playing back shows that are already recorded entirely and just read from the pool.

Video storage pool is HDDs. RAIDZ2, so not the fastest, anyway.

I know about synchronous writes, of course, so that’s probably what is causing the playback problem while a recording is active.

What I am not sure about and now we finally arrived at my questions …

  1. Is this inherent to the NFS protocol or is this something the client can control in any way? Mount option? These are not VMs or databases, just TV shows, so some slack, data safety wise, is OK. If the client does have control over this, we will just try what that old Linux system supports in /etc/fstab.

  2. I looked at the options available at the ZFS layer - sync only knows

  • standard
  • always
  • disabled

I was a bit surprised there is no “metadata” option like with primarycache.

  1. Can anyone explain this? I fiddled with the sync setting while a recording was in progress. I have no idea :man_shrugging:

Thanks and kind regards,
Patrick

In my experience most modern linux clients will mount NFS shares async unless specifically told otherwise.

TrueNAS has the sync options at the dataset level as you mention so Standard will respect the client, Always will sync everything and Disabled will sync nothing.

Based on your chart it would appear that the client is requesting sync writes hence when you change from Standard to Disabled write performance increases.

2 Likes

If you zoom in I suppose you’ll see that sync=standard (i.e. sync) maintains a constant write load, using precious IOPS, while sync=disabled allows ZFS to use RAM cache more liberally and write in short bursts at maximal pool speed—which is probably a better use of resources.

So go with sync=disabled.

My Vu+ records on its own internal HDD. The NAS is for long term storage of selected (and edited) recordings only. Throwing a CoW file system at daily recordings which will, at best, be played once and then deleted looks like awful overkill.