So, I'm trying to setup a Samba share on my R Pi 4 for my home network. I'd really like it it be Samba because at lease 1 Win10 machine is involved.
The setup is as follows:
- External USB 3 HDD is attached to the R Pi and auto-mounted via
/etc/fstab
. - Samba server is set up to use this disk as a share: https://pastebin.com/uYWW70Ez
I have both devices on a 1Gbps Ethernet network, still transfer speeds are:
- Upload to Samba share: ~32MB/s
- Download from Samba share: ~19MB/s (it actually starts with ~60MB/s, but then heavily drops and fluctuates randomly between 9MB/s and 24MB/s)
During Samba upload/download R Pi CPU is no more than 50% loaded; and there's spenty of memory as well.
I'm pretty sure it's not HDD (although it being NTFS-formatted). dd
tests tell it can perform a lot faster at the R Pi:
$ sudo dd if=/dev/sda of=/dev/null bs=16M count=100 status=progress iflag=direct
...
1677721600 bytes (1.7 GB, 1.6 GiB) copied, 18.5466 s, 90.5 MB/s
$ sudo dd if=/dev/zero of=/mnt/usb_hdd/blob bs=16M count=100 status=progress oflag=direct
...
1677721600 bytes (1.7 GB, 1.6 GiB) copied, 22.2178 s, 75.5 MB/s
$ sudo dd if=/mnt/usb_hdd/blob of=/dev/null bs=16M count=100 status=progress
...
1677721600 bytes (1.7 GB, 1.6 GiB) copied, 23.3002 s, 72.0 MB/s
This is also not a network: write/read to/from a Samba share backed up by a RAM-disk are >100MB/s.
On the other hand, I've discovered Pi's internal SD card being terribly slow which correlates with a terrible Samba upload speed to HDD:
$ sudo dd if=/dev/zero of=~/blob bs=16M count=100 status=progress oflag=direct
...
1677721600 bytes (1.7 GB, 1.6 GiB) copied, 90.1067 s, 18.6 MB/s
$ sudo dd if=~/blob of=/dev/null bs=16M count=100 status=progress
...
1677721600 bytes (1.7 GB, 1.6 GiB) copied, 36.7608 s, 45.6 MB/s
So what the hell is going on here?? And how do I improve my precious Samba setup speed?