SMB Performance on MacOS

ObiTobi

Patron
Joined
Jul 12, 2013
Messages
316
Very interesting. I don't have this parameter "strict sync = no" in my config and have full network performance between my Windows and Mac Clients and my NAS Box.
But my LR catalog and my RAW pictures are stored on local ssd (catalog) and HDD (RAW Pictures) because its always much faster than Network.

I see you have changed delayed_ack=0 in sysctrl. But what about

Code:
cat /etc/nsmb.conf.org
[default]
signing_required = no


and there are many differences between your and my smb4.conf - global section. OK my NAS is a member in Windows 2008r2 domain, but there is much more.

Code:
[global]
        dns proxy = No
        aio max threads = 100
        max log size = 51200
        allocation roundup size = 0
        load printers = No
        printing = bsd
        disable spoolss = Yes
        dos filemode = Yes
        kernel change notify = No
        directory name cache size = 0
        nsupdate command = /usr/local/bin/samba-nsupdate -g
        unix charset = UTF-8
        log level = 0
        obey pam restrictions = False
        enable web service discovery = True
        server min protocol = SMB2_02
        unix extensions = No
        restrict anonymous = 2
        server string = My NAS
        fruit:nfs_aces = No
        bind interfaces only = Yes
        netbios name = mynas001
        netbios aliases = mynas001
        server role = member server
        kerberos method = secrets and keytab
        workgroup = RJAP
        realm = RJAP.DE
        security = ADS
        local master = No
        domain master = No
        preferred master = No
        winbind cache time = 7200
        winbind max domain connections = 20
        winbind status fifo = Yes
        client ldap sasl wrapping = sign
        template shell = /bin/sh
        template homedir = /mnt/zpool01/home/%U
        ads dns update = No
        allow trusted domains = No
        winbind enum users = Yes
        winbind enum groups = Yes
        winbind use default domain = Yes
        winbind nss info = rfc2307
        idmap config RJAP: backend = rid
        idmap config RJAP: range = 20000-90000000
        idmap config *: backend = tdb
        idmap config *: range = 90000001-100000000
        socket options =  TCP_NODELAY SO_RCVBUF=1048576 SO_SNDBUF=1048576 IPTOS_LOWDELAY IPTOS_THROUGHPUT
        write cache size =  1024000
        aio read size =  1
        aio write size =  1
        aio write behind =  yes
        read raw =  yes
        use sendfile =  no
        kernel oplocks =  yes
        oplocks =  yes
        level2 oplocks =  yes
        blocking locks =  yes
        veto oplock files =  /*.doc/*.DOC/*.docx/*.DOCX/*.docm/*.DOCM/*.dotm/*.DOTM/*.xltm/*.XLTM/*.xltx/*.XLTX/*.xlsx/*.XLSX/*.xlsm/*.XLSM/*.xlsb/*.XLSB/*.xls/*.XLS/*.ppt/*.PPT/*.pst/*.PST/*.mdb/*.MDB/*.ldb/*.LDB/*.vsd/*.VSD/*.mpp/*.MPP/*.qbw/*.QBW/*.qbb/*.QBB/*.qbI/*.qbl/*.dxf/*.DXF/*.dwg/*.DWG/*.cdr/*.CDR/*.bak/*.BAK/*.ord/*.xlo/*.igs/*.ipt/*.ipj/*.slp/*.stp/*.opt/*.xli/*.stl/*.cur/*.sjb/*.log/*.LOG/*.sbs/*.iam/*.idv/*.pcbdoc/*.PcbDoc/*.PCBDOC/*.dbf/*.DBF/*.cdx/*.CDX/*.mrimg/*.MRIMG/*.tmp/*.TMP/*.imd5/*.IMD5
 
Last edited:

TravisT

Patron
Joined
May 29, 2011
Messages
297
The strict sync parameter was mentioned many times as beneficial for Mac clients using SMB, but I can’t explain why off the cuff. That was one of the last things I changed before restarting the service and restoring performance to acceptable levels, so I thought that was it, but I’m thinking now that was coincidence.

I think I tried turning signing off on the client side, but from what I remember it doesn’t display the same on Catalina as it used to on previous builds. The command seems to take, but that’s it. I don’t recall making the change on the server side, but I’ll. Heck that out.
 

TravisT

Patron
Joined
May 29, 2011
Messages
297
Ok, I just checked the /etc/nsmb.conf.org file, but it doesn't exist on my box. I do have a /etc/nsmb.conf file, but everything is commented out. I'm not sure if not having this file is normal or if I would need to add it to turn off the "signing_required" parameter.

Some notable differences (as you pointed out):
aio max threads = 2 (I don't recall changing this, but it appears that the default is 100)
obviously several parameters are AD specific, which are not in my smb4.conf file.

I also checked the referenced /usr/local/etc/smb4_share.conf reference and see a couple things of note:
vfs objects = catia fruit streams_xattr shadow_copy_zfs ixnas (I think these are all ok, based on recommendations)
aio write size = 0 (man page says this forces sync writes always, does this contradict 'strict sync = no?' man page indicates it wouldn't, but not sure why this is necessary or recommended for Mac clients.)

Would you post your /usr/local/etc/smb4_share.conf for reference?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Last edited:

TravisT

Patron
Joined
May 29, 2011
Messages
297
Are there any explanations on the differences in the default values (based on the SMB defaults) and my values that would correlate to performance degradation? Should I normalize everything and start the performance testing from scratch? I have a new pool that I will be setting up shortly that I'd love to have this worked out prior to.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Are there any explanations on the differences in the default values (based on the SMB defaults) and my values that would correlate to performance degradation? Should I normalize everything and start the performance testing from scratch? I have a new pool that I will be setting up shortly that I'd love to have this worked out prior to.
fsync() causes a zil commit unless sync is disabled at the dataset level. This will always have some performance implication, but exact details will vary from system to system. I think the general discussion regarding ZIL, sync, etc apply in this case. Whether disabling fsync() through "strict sync = no" is an acceptable performance hack / worth whatever implied risk is involved is something you will have to determine on your own.
 

TravisT

Patron
Joined
May 29, 2011
Messages
297
fsync() causes a zil commit unless sync is disabled at the dataset level. This will always have some performance implication, but exact details will vary from system to system. I think the general discussion regarding ZIL, sync, etc apply in this case. Whether disabling fsync() through "strict sync = no" is an acceptable performance hack / worth whatever implied risk is involved is something you will have to determine on your own.

Well at this point it doesn't seem that that was necessarily the "fix" in my case. I removed "strict sync = no" from the dataset in question (without restarting SMB) and I had extremely slow transfer rates as I have in the past (~10 Mb/s). I then restarted the SMB service (with "strict sync = no" removed) and it resumed normal transfer rates of ~100Mb/s read/write.

Unless the 'strict sync = no' option was causing my degradation in performance over time, from this test it seems that it was also not a contributor in the effects either. I'm going to leave this option removed from this particular dataset and will test over the next few hours and see if my transfer speed degrades again. Will report back if (when) it does...
 

TravisT

Patron
Joined
May 29, 2011
Messages
297
Confirmed, reduced performance is back. It seems that it only happens after my Mac sleeps, however the only known fix action is restarting the SMB service on FreeNAS. Again, restarting the service restored SMB performance on this share from my Mac.
 
Top