Extremely slow transfer speed using Samba 4.9.5

Creating a bug report/issue

Required Information

  • DietPi version | cat /boot/dietpi/.version

G_DIETPI_VERSION_CORE=8
G_DIETPI_VERSION_SUB=17
G_DIETPI_VERSION_RC=2
G_GITBRANCH=‘master’
G_GITOWNER=‘MichaIng’
G_LIVE_PATCH_STATUS[0]=‘applied’
G_LIVE_PATCH_STATUS[1]=‘not applied’

  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN

buster 0

  • Kernel version | uname -a

Linux DietPi 5.10.103-v8+ #1529 SMP PREEMPT Tue Mar 8 12:26:46 GMT 2022 aarch64 GNU/Linux

  • Architecture | dpkg --print-architecture

arm64

  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)

RPi 4 Model B (aarch64)

  • Power supply used | (EG: 5V 1A RAVpower)

Stock Raspberry 4 Power Plug

  • SD card used | (EG: SanDisk ultra)

32GB Netac V10 A1

Additional Information (if applicable)

  • Software title | (EG: Nextcloud)

Samba Version 4.9.5-Debian (/usr/sbin/samba -V output)

  • Was the software title installed freshly or updated/migrated?

Migrated from previously installed releases.

  • Can this issue be replicated on a fresh installation of DietPi?

Not Tested / Not sure

← If you sent a “dietpi-bugreport”, please paste the ID here →

  • Bug report ID | echo $G_HW_UUID

Steps to reproduce

Expected behaviour

Actual behaviour

Extra details

Any file transfer using Samba is stuck at less than 500Kb/sec, with occasional transfer errors. files are being transferred from an external SSD drive using an USB3 Enclosure. The drive is formatted as Ext4.

Using any other transfer protocol, such as SFTP, I can easily reach ~50MB/sec data transfer (the DietPi is connected using ethernet to a gigabit wireless N router, I’ve tested both windows 11 and Mac Os 13.4 as clients with the same results) .

I’ve tested the solutions suggested here:

and… a bunch of other places, honestly.

Given the amount of results I get from Google regarding “Raspberry PI 4 Samba Slow” It looks like it seems that for one reason or another the Raspberry Pi 4 really doesn’t like something very specific regarding the Samba Protocol. According to this thread, the actual transfer speeds should be way higher, around ~100MB/sec on real world workloads.

Before I call it quits and just keep using SFTP, I’d love to know if anyone has some specific suggestion regarding this issue.
Here’s my /etc/samba/smb.conf:

[global]

	workgroup = WORKGROUP
	server string = %h server
	dns proxy = no
	log file = /var/log/samba/log.%m
	max log size = 1000
	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:* %n\n *password\supdated\ssuccessfully* .
	pam password change = yes
	map to guest = bad user

	load printers = no
	printcap name = /dev/null
	disable spoolss = yes
	read raw = Yes
	write raw = Yes
	socket options = TCP_NODELAY IPTOS_LOWDELAY
	min receivefile size = 16384
	use sendfile = true
	aio read size = 16384
	aio write size = 16384

[dietpi]
	comment = DietPi Share
	path = /mnt/sda1/dietpi
	browseable = yes
	create mask = 0664
	directory mask = 0775
	valid users = dietpi

Thank you,

Oh, I almost forgot:
UFW is inactive and there’s no firewalling, NATing nor masquerading going on. Just dumb file transfer over SMB using static ip resolution.

Other machines using Samba, such as a WD Ex 2 Ultra NAS on the same network have no issues transferring files. And, by the way, I’ve also tested literally connecting both my Desktop machine with a gigabit controller and the RPi4 using static ip on both sides and the problem was still there.

For what it’s worth, I am not using the following.

I have

writeable = yes
max connections = 12

under [dietpi]
Do you see something weird with top and htop when you transfer? High CPU? High wait? High Hardware or Software Interrupts?

Spent a few days testing various options. No dice. No weird CPU/Interrupt/Traffic Spikes either. I guess I’m gonna wait until a new dietpi release comes out to check if anything improves.

DietPi is not an own operating system. It’s a set of bash script and usually existing configuration will not change during an update. DietPi is using Debian as base. Means, software title like Samba are installed from Debian package source. We don’t have any influence on these packages.

1 Like