Scott Stansbury shared the results of his research on the problem of slow Snow Leopard SMB browsing and file sharing. He looked at various edits to the /etc/nsmb.conf and /etc/smb.conf files, some that we've reported before on the Snow Leopard Tips and Reports page, and some that he figured out himself. The tips reported here helped with slow browsing (this previous report sums it up), but he fixed slow file connection times by editing /etc/nsmb.conf to stop NetBIOS queries, using the line port445=no_netbios. Stansbury's report:
Not sure if folks are still having the slow connect/ slow browsing issues with smb/cifs shares in Snow Leopard, but I resolved the issue for my situation and thought I would share the results.
Initial confusion was around /etc/nsmb.conf and /etc/smb.conf. I had been running Wireshark and noticing that the Mac was issuing broadcast NetBIOS queries, timing out on them, and then connecting, producing the delay that many see. There is no NetBIOS or WINS server in my environment. Removing "bcast" and "wins" from the name resolve order section of /etc/smb.conf produced no change in behavior, but connecting with the command line client smbclient ( smbclient //SERVER/Users Administrator/passwd ) was lightning fast.
Turns out that /etc/smb.conf is only used for the bundled Samba, and that Finder's Go> Connect to Server uses /etc/nsmb.conf.
Running the "sudo sysctl -w net.inet.tcp.delayed_ack=0" command and adding the "notify_off=yes" line to /etc/nsmb.conf helped the browsing issue, but I still had slow connect times. WireShark still showed NBNS queries. According to the nsmb.conf man page, "how to use SMB TCP/UDP ports" can be one of:
- normal (default) Attempt to connect via port 445. If that is unsuccessful, try to connect via NetBIOS.
- netbios_only Do not attempt to connect via port 445.
- no_netbios Attempt to connect via port 445. If that is unsuccessful, do not try to connect via Net-BIOS.
Even though "normal" is the default, it doesn't seem as if that is actually the behavior I experienced. I added line "port445=no_netbios" and the server name /ip address mapping to /etc/nsmb.conf and no more NBNS queries and an instantaneous connection!
Not sure if this is all moot with Lion now out (I haven't upgraded yet...) but thought that it may help some...
If you've tried this approach
Rob Calhoun found success with the procedure in "Fixing slow SMB file sharing by turning off NetBIOS queries," but he recommends editing a different nsmb.conf file than the one suggested:
I just tried this hint.
Following the man page, I created and edited ~/Library/Preferences/nsmb.conf rather than /etc/nsmb.conf . This is safer than working in /etc and I'm the only user anyway. It works! But, with no notifications, it seemed like there is a bit of a delay before files created on Windows appear. I tried just disabling NetBIOS; that seems to be sufficient. My nsmb.conf reads in its entirety:
Thanks for continuing to discuss this issue. It's been ridiculous waiting 3-5 seconds to list each directory on two machines a meter apart.
If you've tried this approach
For more on this topic, see Snow Leopard File Sharing Tips and Reports.