我有一台 QNAP TS-251+,带有两个 SSD,组成 RAID 1 和千兆以太网。该服务器设置为域控制器。从 Windows 到服务器的批量传输速度达到约 80 MB/s,但创建许多较小的文件(例如 200 个文件,每个文件 60 KB)开始时速度很快,但很快(创建 100 个文件左右后)就变成每秒 1 个文件的速度。
我确信这不是网络本身的问题,因为批量传输工作正常。我认为磁盘也很快,因为 a) QNAP 中的基准测试显示它们的性能约为 300 MB/s;b) 我上传了一个包含 200 个文件的 zip 文件,每个文件大小为 60 KB,并通过 SSH 控制台直接在服务器上解压它们,速度与预期一样快。
所以问题似乎出在 SMB/Samba 的某个地方。我尝试了在论坛上找到的各种选项,但无济于事。在我看来,可疑的是每隔/var/log/log.nmbd
几秒钟就会出现这些行:
[2022/04/16 22:28:14.315882, 0] ../../source3/nmbd/nmbd.c:960(main)
nmbd version 4.13.17 started.
Copyright Andrew Tridgell and the Samba Team 1992-2020
[2022/04/16 22:28:14.317618, 0] ../../source3/param/loadparm.c:2816(check_ad_dc_required_mods)
vfs objects specified without required AD DC module: dfs_samba4
[2022/04/16 22:28:14.318498, 0] ../../source3/nmbd/nmbd.c:975(main)
server role = 'active directory domain controller' not compatible with running nmbd standalone.
You should start 'samba' instead, and it will control starting the internal nbt server
这很奇怪,因为我认为 QNAP 前端会启动正确的程序。然而,通过停止 SMB/etc/init.d/smb.sh stop
然后在命令行上启动 Samba/mnt/ext/opt/samba/sbin/samba -i
也不起作用,只是产生了一长串关于 DNS 记录已经存在的错误。
这是[global]
我的部分/etc/config/smb.conf
:
[global]
passdb backend = smbpasswd
workgroup = XXX
server string=NAS Server
encrypt passwords = Yes
username level = 0
map to guest = Never
max log size = 10
name resolve order = host bcast
socket options = TCP_NODELAY SO_KEEPALIVE
os level = 20
preferred master = yes
dns proxy = No
smb passwd file=/etc/config/smbpasswd
username map = /etc/config/smbusers
guest account = guest
directory mask = 0777
create mask = 0777
oplocks = yes
locking = yes
disable spoolss = yes
load printers = no
veto files = /.AppleDB/.AppleDouble/.AppleDesktop/:2eDS_Store/Network Trash Folder/Temporary Items/TheVolumeSettingsFolder/.@__thumb/.@__desc/:2e*/.@__qini/.Qsync/.@upload_cache/.qsync/.qsync_sn/.@qsys/.streams/.digest/
delete veto files = yes
map archive = no
map system = no
map hidden = no
map read only = no
deadtime = 10
restrict anonymous = 2
server role = active directory domain controller
use sendfile = yes
unix extensions = no
store dos attributes = yes
client ntlmv2 auth = yes
dos filetime resolution = no
follow symlinks = yes
wide links = yes
force unknown acl user = yes
template homedir = /share/homes/DOMAIN=%D/%U
inherit acls = yes
domain logons = no
min receivefile size = 256
case sensitive = auto
domain master = auto
local master = no
enhance acl v1 = yes
remove everyone = yes
conn log = no
kernel oplocks = no
min protocol = LANMAN1
smb2 leases = yes
durable handles = yes
kernel share modes = no
posix locking = no
printcap cache time = 0
acl allow execute always = yes
server signing = auto
streams_depot:delete_lost = yes
streams_depot:check_valid = no
fruit:nfs_aces = no
fruit:veto_appledouble = no
winbind expand groups = 1
winbind scan trusted domains = yes
printcap name = /dev/null
printing = bsd
show add printer wizard = no
kerberos method = secrets only
client ipc min protocol = CORE
invalid users = guest
server schannel = yes
winbind max clients = 2000
winbind max domain connections = 2
server kernel smbd support = no
realm = xxx.local
netbios name = XXX-SERVER
idmap_ldb:use rfc2307 = yes
ntp signd socket directory = /usr/local/samba/var/lib/ntp_signd
private dir = /share/CE_CACHEDEV1_DATA/.samba_target/private
lock directory = /share/CE_CACHEDEV1_DATA/.samba_target
state directory = /share/CE_CACHEDEV1_DATA/.samba_target/state
cache directory = /share/CE_CACHEDEV1_DATA/.samba_target/cache
dns forwarder = 127.0.1.1
winbind enum groups = Yes
winbind enum users = Yes
password server = XXX-SERVER.xxx.local
rpc server dynamic port range = 1024-1300
wins support = yes
aio read size = 1
aio write size = 0
vfs objects = shadow_copy2 widelinks acl_xattr catia fruit qnap_macea streams_depot aio_pthread
dns interfaces = lo eth0
我不知道该去哪里找了。有人能给点建议吗?任何帮助都非常感谢。
更新:甚至从 Windows 资源管理器进行删除操作也非常慢,例如每秒 1 次。网络回收站已关闭。