If a SLOG is only to be used in sync writes like NFS, why is mine using one (ZFS)?

iroc409

[H]ard|Gawd
Joined
Jun 17, 2006
Messages
1,385
A while back on a whim and a spare couple of SSDs I decided to add a mirror log device setup to my ZFS array. The array is 4 disks in a mirror/stripe, now with two old 128Gb SanDisk SATA drives in a mirror. I only added them out of curiosity and at some point I need to set up NFS.

Everything I've read says the SLOG won't be touched unless you're doing sync writes, which is only for NFS and databases, etc. I haven't had significant writing to the server until a recent bird outing with my camera. I copied the files to the server over 1GbE from a UHS-II card and USB3 card reader from an OpenSuSE desktop to the FreeBSD server. The software I was using (Rapid Photo Downloader) was reporting around 50-60MB/s writing. I've had this pool hit line speed with SMB, so I know it wasn't being taxed. It was writing about 2800 NEF files of around 25MB each.

The whole time it was using the log mirror. I checked via iostat and could see the SSD activity lights on the front of the server going like crazy.

Now I'm rebuilding my server. I have a couple 860 EVO's sitting here doing nothing, and thought I'd replace the antique SanDisk's since they are probably fairly slow. Then I started reading how I need power-protection drives for SLOG, and figured well I'll just take them out of the pool entirely. BUT, I can't help think how much the pool was using those SSDs while I was writing a relatively slow write.

So what's going on? Could Rapid Photo Downloader be forcing sync writes over the network? Everything I've read said this shouldn't use the SLOG at all and it's nearly a waste of time on a home server.
 
The default ZFS sync setting means that the writing application can decide whether it wants sync or not. Mostly SMB defaults to unsync and NFS to sync. You can force a wanted setting on a filesystem with sync=always or disabled.

Sync is quite mandatory for transactional databases and VM storage. For a simple NFS/SMB fileserver it is not essentially needed as ZFS itself remain always valid. Only in the rare case of small files that are already in the cache, you see a difference as in such a case a file write from slog is done on next reboot so no dataloss. In the past sync on a diskbased fileserver was avoided due the massive performance degration (10% of unsync value). With a pool from fast plp SSDs or a disk pool with an Optane Slog the security advantage may be worth the performance degration so sync is more and more a decent setting even for a filer.
 
So is the most reasonable explanation that the application was requesting a sync write over SMB? I haven't done much of any tuning on the system so sync behavior should be default. Could the client SMB configuration request a sync write under the application?
 
I am the author of Rapid Photo Downloader. It uses standard Python library calls to copy and rename files.

File copy: https://bazaar.launchpad.net/~dlynch3/rapid/zeromq_pyqt/view/head:/raphodo/copyfiles.py
Rename: https://bazaar.launchpad.net/~dlynch3/rapid/zeromq_pyqt/view/head:/raphodo/renameandmovefile.py

You will note in the code there are no sync calls. What Python does under the hood will depend on the Python version.

Well, there it is straight from the source. Thank you Damon for signing up and answering that question! 😀

So, it's not the code, and I don't know Python but I have my doubts that would be doing it--but then I don't know Python so I have no idea. Interesting.
 
Simply set ZFS sync=disabled for that filesystem.
It is then disabled does not matter of client wishes.
 
Back
Top