sudo sysctl -w net.inet.tcp.delayed_ack=0
Password:
net.inet.tcp.delayed_ack: 3 -> 0
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
-参考
On MacOS 10.13.x I was getting terrible network transfer speeds from my Mac laptop to the network share being served by another mac. We were only getting 10MB/s which was not even enough to stream videos at 720p but yet on the iMac this external RAID array was attached to we were getting 200MB/s+ and could stream 2160p30 (4k) videos no problem.
Server serving the network share:
MacOS High Sierra (10.13.6), External 24TB RAID array in RAID 10.
Client access the network share (SLOW):
MacOS High Sierra 10.13.4 (also happens in 10.13.5)
The fix:
Make the change temporary (without rebooting):
Open a terminal
sudo sysctl -w net.inet.tcp.delayed_ack=0
1
sudo sysctl -w net.inet.tcp.delayed_ack=0
Close and re-open Finder and see if the problem goes away. Also close and re-open your throughput testing app (in my case BlackMagic Disk Speed Test app) before testing again (required!). This setting for me was set to 3, changing it to 0 fixed it and then changing back to 3 caused it to drop back down to 10MB/s, confirming the resolution.
To make the change permanent (requires reboot):
Create/edit the file /etc/sysctl.conf
sudo vim /etc/sysctl.conf
1
sudo vim /etc/sysctl.conf
Add this line to the configuration file:
net.inet.tcp.delayed_ack=0
1
net.inet.tcp.delayed_ack=0
Save and close file (type “:wq” without quotes, then hit enter)
reboot computer
Open finder and your problem should be resolved.
If it is not, try the guide that shows how to enable vfs_fruit module for Samba, I believe this is only useful if the server hosting the share is NOT a Mac as it enables better Mac compatibility for Samba. You can also try installing Samba instead of the MacOS implementation of SMB.
The Mac laptop that was struggling I had tried multiple known fixes before this:
Disabling SMB Signing (smb_signing) and it did show it as disabled in the terminal but had no impact for me. I disabled on both server and client and reconnected the share and restarted all services.
Changing connection from SMB to AFP, reconnected share, no impact
The final change, disabling Delayed TCP ack, fixed it.
It's a common complaint that in recent versions of Mac OS 10.x, browsing Windows-hosted SMB shares is incredibly slow. Not every solution works, but here are 3 simple fixes that completely solved the issue for me (Using Windows Server 2012 & 2012R2 with Mac OS X 10.9 & 10.10).
3 Steps total
Step 1: Disable writing .DS_Store files to network shares
On the Mac, open up Terminal and enter the following command:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
Step 2: Make sure NetBIOS over TCP/IP is enabled on the file server's network adapter
Adapter Properties -> IPv4 properties -> Advanced -> WINS tab -> Enable NetBIOS over TCP/IP
Make sure this setting is enabled.
Step 3: Use Powershell to edit the server's SMB configuration.
On the Windows server, open Powershell as an administrator and run:
get-smbserverconfiguration
Look for the values for smb2creditsmin and smb2creditsmax. On my server, the defaults were 128 and 2048 respectively. To change these settings, run
set-smbserverconfiguration -smb2creditsmin 512 -smb2creditsmax 8192
and respond Y to the confirmation prompt.
Following these three steps instantly fixed the issue for me and others, and my Macs are now browsing the file shares just as fast as their Windows counterparts.