Zend certified PHP/Magento developer

Extremely slow file transfers on QNAP TS-251+

I have a QNAP TS-251+ with two SSDs in a RAID 1 and Gigabit Ethernet. The server is set up to act as a domain controller. Bulk transfers from Windows to the server reach some 80 MB/s, but creating many smallish files (like 200 files with 60 KB each) starts fast, but quickly (after 100 files or so) crawls to something like 1 file per second.

I’m sure it’s not the network itself, since bulk transfers work OK. I think the disks are fast as well, since a) the benchmark in QNAP shows they perform at about 300 MB/s and b) I’ve uploaded a zip file with 200 files, each 60 KB in size and unzipped them directly on the server via an SSH console and it was as fast as expected.

So the problem seems to be somewhere in SMB/Samba. I’ve toyed around with various options I found in forums, but to no avail. What looks fishy to my eye is that in /var/log/log.nmbd every couple of seconds these lines appear:

[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

This is strange, since I would assume that the QNAP frontend would start the right program. Nevertheless, stopping SMB via /etc/init.d/smb.sh stop and then starting Samba on the command line with /mnt/ext/opt/samba/sbin/samba -i didn’t work either but just produced a long list of errors about DNS records already existing.

This is the [global] section of my /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

I don’t know where to look anymore. Does anybody have some advice? Any help greatly appreciated.

Update: Even delete operations from Windows Explorer are very slow, like 1 per second. Networks recycle bin has been switched off.