Ubuntu 20.04 上的 Samba 读写速率性能是否限制在 11MB/s 左右?

Ubuntu 20.04 上的 Samba 读写速率性能是否限制在 11MB/s 左右?

我注意到,无论我做什么,使用运行 Samba 版本 4.11.6-Ubuntu 的 Ubuntu 20.04 文件服务器(使用 Ubuntu、MacOS 10.15、Windows 10 客户端)对大约 250GB 的文件,我只能获得大约 11MB/s 的读/写性能。如果我在 Windows 上共享一个文件夹,我可以使用相同的客户端和文件大小获得超过 100MB/s 的性能。与 Windows 相比,Samba 真的那么糟糕吗?在 Ubuntu Samba 上,它的速度几乎一直慢 10 倍左右。我有一个轻负载的 1Gb/s LAN,所以 100MB/s(1B=~8b)是你所能达到的最佳速度。我在 smb.conf 中尝试了许多 conf 命令。我准备放弃,只在 Windows 上托管我的文件服务。在更改主机之前有什么最后的想法吗?



# Performance improvement tips
log level = 1
#std#socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=131072 SO_SNDBUF=131072 SO_KEEPALIVE
socket options = TCP_NODELAY SO_RCVBUF=131072 SO_SNDBUF=131072 SO_KEEPALIVE IPTOS_THROUGHPUT

#no better than buf=131072#socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=2097152 SO_SNDBUF=2097152
# this one is really slow#socket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=8192 SO_RCVBUF=8192
read raw = Yes
write raw = Yes
strict locking = No
strict allocate = Yes
allocation roundup size = 4096
server signing = No
oplocks = yes
max xmit = 65535
dead time = 15
getwd cache = yes
#min receivefile size = 32768
min receivefile size = 16384
use sendfile = true
aio read size = 16384
aio write size = 16384
#aio read size = 32768
#aio write size = 32768
use sendfile = true

# Performance specific for MacOS
min protocol = SMB2
vfs objects = fruit streams_xattr  
fruit:metadata = stream
fruit:model = MacSamba
fruit:posix_rename = yes 
fruit:veto_appledouble = no
fruit:wipe_intentionally_left_blank_rfork = yes 
fruit:delete_empty_adfiles = yes 

答案1

事实证明,网络性能下降不是由 SAMBA 引起的。这是特定服务器以太网接口上的一般网络带宽问题,由大型 IPv4 IPTABLES 规则文件引起。

相关内容