RPI4 SMB server, slow transfer

Anyone have advice on how to speed up my SMB configuration?
I have a usb3 hard drive connected to my RPI4, I enabled the cmdline.txt quirk for the USB hard drive.
transfer speeds seem to range between 1.2 and 3.8 MB/s to both the SDcard and the Hard drive.
The speed ranges when I try various smb.conf settings. 1.2 is at minimalist configuration.
3.8 MB/s is when I provide a config I found on the net.

[global]
server multi channel support = yes
server role = auto
server min protocol = SMB3_11
workgroup = WORKGROUP
logging = systemd
log level = 1 auth:5 winbind:5
max log size = 1000
guest account = nobody
load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes
show add printer wizard = no
disable netbios = yes
dns proxy = no
deadtime = 1800
invalid users = root
##smb encrypt = off
security = user
##socket options = TCP_NODELAY IPTOS_LOWDELAY IPTOS_THROUGHPUT SO_RCVBUF=131072$
##socket options = TCP_NODELAY IPTOS_LOWDELAY
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
min receivefile size = 16384
use sendfile = yes
write cache size = 262144
strict locking = no
aio read size = 16384
aio write size = 16384
ntlm auth = yes
workgroup = WORKGROUP
server string = %h server
log file = /var/log/samba/log.%m
syslog only = no
syslog = 0

panic action = /usr/share/samba/panic-action %d

security = user
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = Enter\snew\s\spassword:* %n\n Retype\snew\s\spassword$
pam password change = yes
map to guest = bad user

Hi,

many thanks for your request. It might not 100% fitting but maybe you can have a look to this community tutorial

https://dietpi.com/forum/t/slow-samba-transfers-odroid-xu4-fix/4071/1

Hi !

Thanks for the tip, I switched my smb.conf to the one used by openmediavault that people report has high throughput in smb ith RPI4. It includes the socket options from the thread you recommended.

I now get 3.3 MB/s to the SDcard and 5.2 MB/s to the usb3 drive. the wired eth0 connection reports speed as 1000mb.

Any suggestions from here?

[global]
workgroup = HOME
server string = %h server
dns proxy = no
log level = 0
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
syslog only = yes
panic action = /usr/share/samba/panic-action %d
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = no
unix password sync = no
passwd program = /usr/bin/passwd %u
passwd chat = Enter\snew\s\spassword:* %n\n Retype\snew\s\spassword:* %n\n password\supdated\ssuccessfully .
pam password change = yes
socket options = TCP_NODELAY IPTOS_LOWDELAY
guest account = nobody
load printers = no
disable spoolss = yes
printing = bsd
printcap name = /dev/null
unix extensions = yes
wide links = no
create mask = 0777
directory mask = 0777
use sendfile = yes
aio read size = 16384
aio write size = 16384
null passwords = no
local master = yes
time server = no
wins support = no

hmm I searched the web and did find quite some messages about slow samba performance. However there did not seems to be the one and only solution. Most of the time same recommendation are given but it did not fix it for everybody.

Just an update, It did seem to be the RPI4, I moved the SD card to a new pi4 and got fullspeed with SMB.

Thanks!

to bad that it seems your board. Can you share your final smb.conf file. I would like to have a check in my RPi4 to see how it behave. :wink: