0

I have setted up samba server for NAS in my raspberry pi 4.
The external disk is USB 3.0 and is working fine.
sudo hdparm -t /dev/sda shows speed around 120 MBytes/s
nperf also shows link of around 970 Mbits/s
but samba gives read speed of only around 40-45 MBytes/s, write speed is even worse
Downloading large file from Nginx http server hosted in pi, also gives speed around 40-50 MBytes/s
I am connected via a gigabit ethernet.

So does anyone have any guesses to why am i not able to hit that 100 MBytes/s of speed in Samba and http

My main system on which i ran these test have SSD installed in it, so that is not the bottle neck here.

PS: PI-4 is running latest verison of Raspbian OS and my main system is on dual boot of windows10 and ubuntu19, tested on both.

  • Samba speed will be slow if disk is formatted NTFS. Prefer ext4. Also please state type of disk (e.g. portable 2.5" USB, or SATA disk in enclosure or SATA disk connected by adapter). – Michael Harvey Oct 06 '19 at 08:00
  • @MichaelHarvey Drive is portable 2.5" USB.
    and why does format have anything to do with the speed,
    besides i tested the drive ( NTFS formatted) with dd as well and read speed was still around 120MBytes/s
    – user204682 Oct 06 '19 at 09:11
  • 1
    Even with ntfs-3g installed (you have that?) the speed will be lower than a native Linux file system because ntfs file system driver is run in user space and not the kernel, so high CPU usage. NTFS is proprietary Microsoft filesystem. See here, here, here, and (especially) here – Michael Harvey Oct 06 '19 at 09:55
  • I've closed this as a duplicate since ntfs is recognized as a significant problem, and TBH I'm not seeing real evidence of "slow" here, just that it does not match a "fastest" criteria which, generally speaking, no model of Pi would. Put another way, unless you have a reference demonstrating the same setup should be faster, there's no reason to believe it should be. Note that hardware/protocol maximums are just that: maximums, not averages, etc. – goldilocks Oct 06 '19 at 13:05
  • i don't think NTFS is a problem here as i already told i tested the drive using hdparm and dd, both shows speed around 120MBytes/s which i guess i should get. As network speed is also beyond saturation.So my question is what is being saturated here. CPU usage during transfer also doesn't hit saturation as i tested it in htop and neither RAM does. So according to my guess these are not hardware issues this is something to do with the software configuration.

    PS : Yes I have ntfs-3g installed, but I haven't tried using ext4 as i need to make a backup of the drive,first. Will update if it works

    – user204682 Oct 06 '19 at 14:56
  • "a "fastest" criteria which, generally speaking, no model of Pi would." - I have a Raspberry Pi 4b, with a USB3 portable type 2.5 inch hard drive (WD elements 2TB), formatted ext4, and shared using Samba on my LAN, and I can see file transfer rates between 90 and 100 MB/sec in either direction. The Rpi 4 differs from earlier models by having USB3 ports and gigabit ethernet. – Michael Harvey Oct 06 '19 at 15:15
  • I have noted that I get best speeds (c. 100 MB/sec) to/from the Pi4 Samba share (from a Windows machine) if I first stop (on the Pi) transmission-daemon and Plex Media Server, both of which use folders on the shared drive. If these are running, transfer rate drops to around 80-90 MB/sec. – Michael Harvey Oct 06 '19 at 15:43

0 Answers0