Do you have a dedicated SLOG in your system? If not my guess is this will be slowing you down.
Strict sync means that samba obeys requests from client to flush. It’s the default for a reason.
Ah ok. I presumed it would force a client writing asynchronously to essentially sync all its writes. My bad.
It’s just a home NAS, a lot of ram is not used, so I didn’t use dedicated SLOG.
RAM is relevant to (lack of need for) L2ARC, not so much for SLOG.
Yeah only needed to enhance sync write performance.
Just commented out all MacOS connected settings and add the following line, the end is speed increased from 60MB/s to 70MB/s even 80MB/s sometimes.
aio max threads = 1000 # default is 100
I am confused now, do these fruit settings means nothing for macOS Sonoma 14.5?
OK I think my problem has been resolved. I can get about 100MB/s speed on MacOS client connected to wifi router which is connected to 2.5Gbps NIC NAS.
Also the problem of long time (2 minutes or more) to preview big directory of pictures (50k) MacOS Finder is gone too. Need to put some settings on both the server and the client. Hereby is the full settings of Samba server:
cat /usr/local/etc/smb4.conf
[global]
unix charset = UTF-8
workgroup = WORKGROUP
realm = yo.home
netbios name = Ro0b
interfaces = 192.168.31.20/24 re0 127.0.0.1
bind interfaces only = yes
hosts allow = 192.168.31.0/24
# recommended fruit config for MacOS
vfs objects = catia fruit streams_xattr
fruit:metadata = stream
fruit:model = MacSamba
fruit:zero_file_id = no
fruit:veto_appledouble = no
fruit:nfs_aces = no
fruit:wipe_intentionally_left_blank_rfork = yes
fruit:delete_empty_adfiles = yes
fruit:encoding = native
fruit:aapl = yes
readdir_attr:aapl_rsize = no
readdir_attr:aapl_finder_info = no
readdir_attr:aapl_max_access = no
# performance tunning reference
# https://hilltopsw.com/blog/faster-samba-smb-cifs-share-performance/
# https://fy.blackhats.net.au/blog/2021-03-22-time-machine-on-samba-with-zfs/
# https://serverfault.com/questions/999920/very-slow-smb-speeds-on-macos
# https://gist.github.com/fschiettecatte/02d61e3d36c5f8d36bd45586fc5d0dc7
# https://www.samba.org/~ab/output/htmldocs/Samba3-HOWTO/speed.html
# The following three lines can be put into /etc/nsmb.conf of MacOS client
#
## signing_required = no
## protocol_vers_map=6
## port445=no_netbios
#
# strict allocate = no
# strict sync = yes
# read raw = yes
# write raw = yes
# strict locking = Auto
# socket options = TCP_NODELAY IPTOS_LOWDELAY
# min receivefile size = 32768
use sendfile = Yes
# aio max threads = 1000
# aio read size = 1
# aio write size = 1
# Linux supports only kernel oplocks
# kernel oplocks = yes
# printing = cups
# printcap name = cups
# load printers = yes
# cups options = raw
#[timemachine_a]
#comment = Time Machine
#fruit:time machine = yes
#fruit:time machine max size = 1050G
#path = /var/data/backup/timemachine_a
#browseable = yes
#write list = timemachine
#create mask = 0600
#directory mask = 0700
## NOTE: Changing these will require a new initial backup cycle if you already have an existing
## timemachine share.
#case sensitive = true
#default case = lower
#preserve case = no
#short preserve case = no
[data]
path = /data
public = no
writable = yes
printable = no
guest ok = no
veto files = /._*/.DS_Store/
delete veto files = yes
valid users = hey
And settings on MacOS client:
cat /etc/nsmb.conf
[default]
# Use NTFS streams if supported
streams=yes
# Soft mount by default
soft=yes
# Disable signing due to macOS bug
signing_required=no
# Disable directory caching
dir_cache_off=yes
dir_cache_async_cnt=0
dir_cache_max_cnt=0
dir_cache_max=0
dir_cache_min=0
# Lock negotiation to SMB2/3 only
# Require SMB2/3
# 7 == 0111 SMB 1/2/3 should be enabled
# 6 == 0110 SMB 2/3 should be enabled
# 4 == 0100 SMB 3 should be enabled
protocol_vers_map=6
# No SMB1, so we disable NetBIOS
# How to disable SMB 1 or NetBIOS in macOS
# https://support.apple.com/en-us/HT211927
# https://support.apple.com/en-us/102050
port445=no_netbios
validate_neg_off=yes
# Turn off notifications
notify_off=yes
# SMB Multichannel behavior
# https://support.apple.com/en-us/102010
mc_on=no
mc_prefer_wired=yes
unix extensions = no
veto files=/._*/.DS_Store/
Thanks all for your help, it’s a so nice community though I use FreeBSD 14.3 instead of TrueNAS. Thanks again.
Unless you’ve removed our vfs objects configuration this parameter has no impact at all on share (we don’t use the builtin in samba aio). If you have removed our VFS objects I’d maybe carefully test before storing important data on the share.
I am removing the resolution flag because the referenced post contains unsupported configuration changes to the SMB server that may adversely affect server stability and data integrity.
You can do whatever you want with your server, but I do not think the samba changes are appropriate to present to other users as a solution to performance problems.