Oooooh.... Interesting turn!
The Samba guys noticed that the disk subsystem was very slow and offered options to set.
Right... It's fine adapting smbd to a slow disk... But is it really slow?
So, let test the disk subsystem!
LE11 RPi 4 system
/dev/sda2 on /var/media/content type ntfs3 (rw,relatime,uid=0,gid=0,fmask=37777600133,iocharset=utf8)
kodiplayer:~ # hdparm -Ttv /dev/sda2
/dev/sda2:
multcount = 0 (off)
readonly = 0 (off)
readahead = 256 (on)
geometry = 4769073/64/32, sectors = 9767061504, start = 411648
Timing cached reads: 2030 MB in 2.00 seconds = 1016.80 MB/sec
Timing buffered disk reads: 162 MB in 3.01 seconds = 53.83 MB/sec
Display More
That is indeed quite poor! This is a new 5TB WD 2.5" USB 3 external HDD, one NTFS partition mounted using ntfs3, connected to one of the USB 3 sockets of the Pi 4.
Just for perspective gathering, I've done a perf test on another Linux box of mine, with a much older 1 TB WD 2.5" USB 3 external HDD, one NTFS partition mounted using ntfs3g, so quite similar:
Reference system
/dev/sdb1 on /mnt/Blue-1TB type fuseblk (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
13 nico@rastaman:~$ sudo hdparm -Ttv /dev/sdb1
[sudo] password for nico:
/dev/sdb1:
multcount = 0 (off)
readonly = 0 (off)
readahead = 256 (on)
geometry = 121597/255/63, sectors = 1953458174, start = 2
Timing cached reads: 22072 MB in 1.99 seconds = 11092.93 MB/sec
Timing buffered disk reads: 324 MB in 3.01 seconds = 107.58 MB/sec
Display More
So, that's read speed.
Let's take a look at writing and reading on the actual file system:
LE11 RPi 4 system
kodiplayer:/var/media/content # sync && echo 3 > /proc/sys/vm/drop_caches && dd if=/dev/zero of=testfile bs=128k count=16k && ls -lah testfile && dd if=testfile of=/dev/null bs=128k
&& rm testfile
16384+0 records in
16384+0 records out
2147483648 bytes (2.0GB) copied, 186.714454 seconds, 11.0MB/s
-rw-r--r-- 1 root root 2.0G Feb 24 10:24 testfile
16384+0 records in
16384+0 records out
2147483648 bytes (2.0GB) copied, 274.038229 seconds, 7.5MB/s
Reference system
root@rastaman:/mnt/Blue-1TB# sync && echo 3 > /proc/sys/vm/drop_caches && dd if=/dev/zero of=testfile bs=128k count=16k && ls -lah testfile && dd if=testfile of=/dev/null bs=128k && rm testfile
16384+0 records in
16384+0 records out
2147483648 bytes (2.1 GB, 2.0 GiB) copied, 27.9964 s, 76.7 MB/s
-rwxrwxrwx 1 nico root 2.0G Feb 24 10:21 testfile
16384+0 records in
16384+0 records out
2147483648 bytes (2.1 GB, 2.0 GiB) copied, 42.7862 s, 50.2 MB/s
Well... That's not glorious for the LE11 RPi 4!
Remember that this is a H/W rev. 1.5 RPi 4 (running nightly-20220219-ae4b7da)
. I have a carbon copy system in production elsewhere, but with H/W Rev. 1.2 (running LE11 nightly-20220120-f7f2fd5, I'm a bit scared of upgrading it, it works):
LibreELEC:/var/media/Media # sync && echo 3 > /proc/sys/vm/drop_caches && dd if=/dev/zero of=testfile bs=128k count=16k && ls -lah testfile && dd if=testfile of=/dev/null bs=128k &&
rm testfile
16384+0 records in
16384+0 records out
2147483648 bytes (2.0GB) copied, 17.060671 seconds, 120.0MB/s
-rw-r--r-- 1 root root 2.0G Feb 24 10:36 testfile
16384+0 records in
16384+0 records out
2147483648 bytes (2.0GB) copied, 0.748839 seconds, 2.7GB/s
A striking difference!
I'm probably going to upgrade the production system to the same LE11 nightly build as the problematic system. I'm not too thrilled, but it will help knowing if it's a software issue...
So, maybe not a Samba issue, but a disk I/O performance issue...