I was having what seems like similar problems:
- finder was very slow to open folders on mounted SMB shares
- mounted SMB shares would sometimes disappear randomly
- after selecting a shared folder within the MacOS's "Connect to Server..." dialog, the folder, then its contents, would each take a long time to appear.
I have made two changes that have dramatically improved things. With these changes, my folders open immediately, and I am getting sustained line speed file transfers to/from my Synology NAS and my iMac 2020 running the latest Mojave update.
While your "mileage may very", for what its worth, here they are:
First issue: my Mac could not reliably determine the address of the Synology server, given its server DNS name, whether it was based on Bonjour (ended in .local), or was DNS based, (was an AD domain, e.g. nas.example.com). Thus changes A) and B) below... (This was despite SMB1, aka NetBIOS over TCP, being disabled on my MacOS Mojave installation, go figure...).
A) On the Synology, check its "Enable Local Master Browser" setting:
I sort directories on the server, as my
DS1621+ is a beast, given my current network is limited to 1 Gbps links. Also, the "Local" in Master Browser, means: local to the LAN's subnet. Given the NETBIOS browsing was based on broadcasts, multiple subnets gets nasty fast... and is an advanced topic.
The above comes with are two
major caveats:
A1) The NAS
MUST NOT be an Active Directory Domain Controller. Why? Samba cannot be both an AD DC, and Master Browser / authoritative WINS server, at the same time.
A2) When you have multiple samba servers, only ONE of the should be a Local Master Browser. Otherwise, they might hold constant elections in an effort to defeat each other, to become The one and only Local Master Browser.
B) Determine that NAS's IPv4 address, and
make it the WINS server for your SMB client workstations. You can use a DHCPv4 option, or manually configure them on your Windows and MacOS boxes. There is also a setting for linux samba installations, etc.
Here is the Synology DSM setting, as an example:
Second major issue, despite my MacOS's network service order, having my wired ethernet connection higher than my WiFi network... the MacOS would frequently choose to route its SMB traffic over my WiFi network, rather than my clean ethernet wires. Hence I updated my MacOS SMB client settings.
C) Update your MacOS client's SMB settings as follows. The first two entries were defaults on my Mojave install. But the third option was added to never use the WiFi when there was a choice.
Edit your MacOS
/etc/nsmb.conf
file as follows:
Code:
# /etc/nsmb.conf
[default]
# Limit negotiation to SMB2/3 only. NOTE: SMBv1 has broken security, and is a slow pig. Just disable it!
# 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. NO, really disable SMBv1, along with NetBIOS over TCP, its transport.
port445=no_netbios
# The above are shipped as MacOS defaults.
# https://gist.github.com/jbfriedrich/49b186473486ac72c4fe194af01288be
# Prefer lower latency wired ethernet, over higher
# latency WiFi ethernet. Despite WiFi advertising
# higher speeds.
mc_prefer_wired=yes
Note: the MacOS's
man nsmb.conf
Terminal command is your friend. It's well written, and seems complete.
As a point of interest... all network file sharing protocols are very sensitive to both latency and reliable packet delivery. It is of particular importance during session setup (mounting the share), directory listings (whether ls command, or Finder window), or session teardown (i.e. un-mounting).
One last point.... The discovery of that file sharing server's address, is always important. Frequently there is legacy methods, brittle, even broken, implementations, and obscure configuration details. They all conspire to get users tearing their hair out.