TheRadziu
Posts: 18
Joined: Thu Jan 14, 2016 3:08 pm
Location: Poland

Slow samba transfer speed on RPi4 to a usb 3.0 drive (10,4mb/s)

Fri Jun 28, 2019 1:49 pm

I just set up fresh Rasbian on my new Raspberry Pi 4, set up USB Hard drive (EXT4) and samba shared it and I'm getting the same speeds as I did on Raspberry pi 2b, which is 10,4Mb/s, and I do believe it should be around few times higher for Rpi4 with its new hardware and ports.

I do suspect either my windows SMB settings (I remember changing some when they disabled smb protocol in one of the w10 updates) or more likely stock samba settings (all I did was hide lost+found in global settings and add 3 shares). I'm also getting same speeds when writing to the directory on microsd itself.


Any help improving smb speeds? Thanks.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26673
Joined: Sat Jul 30, 2011 7:41 pm

Re: Slow samba transfer speed on RPi4 to a usb 3.0 drive (10,4mb/s)

Fri Jun 28, 2019 1:53 pm

Probably preaching to the converted, but you do have the drive plugged in to one of the blue sockets? Those are the USB 3 ones.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

TheRadziu
Posts: 18
Joined: Thu Jan 14, 2016 3:08 pm
Location: Poland

Re: Slow samba transfer speed on RPi4 to a usb 3.0 drive (10,4mb/s)

Fri Jun 28, 2019 1:58 pm

Yes I do.

hdparm test of drive itself:

Code: Select all

 Timing cached reads:   1766 MB in  2.00 seconds = 883.26 MB/sec
 Timing buffered disk reads: 296 MB in  3.02 seconds =  98.02 MB/sec
And write speed

Code: Select all

1073741824 bytes (1.1 GB, 1.0 GiB) copied, 9.85833 s, 109 MB/s

ferofero33
Posts: 2
Joined: Sat Jun 29, 2019 1:23 pm

Re: Slow samba transfer speed on RPi4 to a usb 3.0 drive (10,4mb/s)

Sat Jun 29, 2019 1:27 pm

Same issue here with RPi4 - both samba and FTP transfers are ~10MB/s, while external drive connected using USB3 is capable ~100MB/s.
I've replaced 2months old 3B+ with 4 to get better samba speeds (USB3+GbpsLAN+faster CPU), but I'm quite dissapointed.

Any idea ?

TheRadziu
Posts: 18
Joined: Thu Jan 14, 2016 3:08 pm
Location: Poland

Re: Slow samba transfer speed on RPi4 to a usb 3.0 drive (10,4mb/s)

Sat Jun 29, 2019 3:05 pm

ferofero33 wrote:
Sat Jun 29, 2019 1:27 pm
Same issue here with RPi4 - both samba and FTP transfers are ~10MB/s, while external drive connected using USB3 is capable ~100MB/s.
I've replaced 2months old 3B+ with 4 to get better samba speeds (USB3+GbpsLAN+faster CPU), but I'm quite dissapointed.

Any idea ?
I solved my issue, kinda ashamed to admit it, but maybe it could help you out.
So, it was because PC was going through 100Mbps switch. I've noticed it when checked PC eth interface and it reported 100Mbps connection speed. Connecting both rpi and pc directly to the router improved my samba speeds from 10-12mb/s to 60Mb/s (on heavy cpu load) - 90Mb/s (on idle).

Make sure everything that is between rpi and pc is 1Gbit rated, that includes PC's ethernet (either mobo or dedicated card), router and/or switch and probably cables too.

CrunkTrunk
Posts: 2
Joined: Mon Jul 01, 2019 12:40 pm

Re: Slow samba transfer speed on RPi4 to a usb 3.0 drive (10,4mb/s)

Mon Jul 01, 2019 12:55 pm

I'm running into the same issue though my transfer speeds, from share to windows hard drive, are only ~5 MBps

I'm running RPI4 connected via eithernet to router and have a USB 3.0 NTFS drive mounted (WD 4 tb passport).

My windows computer is connected to the router via 5g wifi, this is considerably slower than a ethernet cable to router but running a cable is not an option because I'm on the second floor.

edit: After pulling a network cable from my router to my pc upstairs samba will do 50 Mbps transfers
unfortunately this isn't an option so I changed wifi channel to speed up wifi and that got me to ~8 MBps.

Anyone have any other suggestions I can try to increase speed? was really hoping to get more throughput

christopholous
Posts: 14
Joined: Sat Jul 06, 2019 1:51 am

Re: Slow samba transfer speed on RPi4 to a usb 3.0 drive (10,4mb/s)

Sat Jul 06, 2019 1:59 am

Hi,

I have had success at getting between 70-90 MB/s transfer speeds on a 2.5" 5200 rpm drive, for large files. With peak speeds at over 100MB/s using a samba server.

Make sure your CPU isn't throttling. Mine transfers files at around 59C. Buy some heat sinks if you haven't. If you are using the case that came with the RPI, throw it away. You can get ones with fans that allow lots of air flow for $10 on Amazon.
Last edited by christopholous on Sat Jul 06, 2019 7:28 pm, edited 1 time in total.
Your mother is so fat, the recursive function computing her mass causes a stack overflow.

christopholous
Posts: 14
Joined: Sat Jul 06, 2019 1:51 am

Re: Slow samba transfer speed on RPi4 to a usb 3.0 drive (10,4mb/s)

Sat Jul 06, 2019 5:10 pm

Hi, I wanted to add one more thing.

I formatted my drives as NTFS and got 30MBps transfer speeds :shock: :shock:

Put the drives back to ext3 and I"m getting 90MBps (for large files) 8-)

So I guess the survey says, avoid using NTFS if you want fast transfers and use ext3 instead.

Edit:

I switched from ext3 to ext4 and now I'm consistently getting 112MB/s transfers of large files!!! woohoooo

So to revise what I said before: avoid using NTFS if you want fast transfers and use ext4 instead.
Last edited by christopholous on Sat Jul 06, 2019 10:53 pm, edited 1 time in total.
Your mother is so fat, the recursive function computing her mass causes a stack overflow.

CrunkTrunk
Posts: 2
Joined: Mon Jul 01, 2019 12:40 pm

Re: Slow samba transfer speed on RPi4 to a usb 3.0 drive (10,4mb/s)

Sat Jul 06, 2019 5:14 pm

Thanks for the suggestions,

I will try
-formatting my hard drive to EXT4 and see if there is a performance difference.
- use a poe hat with fan to counter thermal throttling.

Cheers!

User avatar
DougieLawson
Posts: 39169
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Slow samba transfer speed on RPi4 to a usb 3.0 drive (10,4mb/s)

Sat Jul 06, 2019 5:34 pm

christopholous wrote:
Sat Jul 06, 2019 5:10 pm
Hi, I wanted to add one more thing.

I formatted my drives as NTFS and got 30MBps transfer speeds :shock: :shock:

Put the drives back to ext3 and I"m getting 90MBps (for large files) 8-)

So I guess the survey says, avoid using NTFS if you want fast transfers and use ext3 instead.
That's the difference between a Linux native filesystem kernel driver (ext4) and an alien filesystem driver (ntfs). It really is doing three times the work for each file block read from the drive.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

christopholous
Posts: 14
Joined: Sat Jul 06, 2019 1:51 am

Re: Slow samba transfer speed on RPi4 to a usb 3.0 drive (10,4mb/s)

Sat Jul 06, 2019 10:54 pm

Aaand I switched from ext3 to ext4, now I'm saturating the gigabit connection. Getting 112MB/s transferring large files. :)
Your mother is so fat, the recursive function computing her mass causes a stack overflow.

AmigaGamer
Posts: 94
Joined: Sat Feb 01, 2014 9:02 pm

Re: Slow samba transfer speed on RPi4 to a usb 3.0 drive (10,4mb/s)

Sun Jul 07, 2019 2:36 pm

Another thing that can really affect the performance is the way you mount the Samba filesystems.

on my desktop PC running Buster i can only get about 40-50mb/s if the filesystem is mounted in at user level (gvfs-fuse)
e.g. through File managers or comand line

Code: Select all

gio mount smb://user@server/share
however if i mount via fstab or a traditional mount line i get a full gigabit transfer rates with a lower cpu overhead , e.g "

Code: Select all

sudo mount -t cifs -o ro username=USER,uid=$(id -u),gid=$(id -g) //server/share /home/pi/SAMBAshare"

mechwarrior
Posts: 5
Joined: Sat Mar 14, 2015 8:53 am

Re: Slow samba transfer speed on RPi4 to a usb 3.0 drive (10,4mb/s)

Sun Oct 27, 2019 12:19 pm

hi guys, even with an ext4 formatted drive connected through usb3 to pi4b, gigabit connection to router, then gigabit connection to pc, I still cannot breach 10mb/s tranfers speeds on samba share. I have raspbian buster loaded (waiting for osmc) .

kitlee
Posts: 3
Joined: Thu Jul 23, 2020 4:54 pm

Re: Slow samba transfer speed on RPi4 to a usb 3.0 drive (10,4mb/s)

Thu Jul 23, 2020 5:13 pm

Sorry to dig up this old thread, but i have the same situation and have not found a solution here or in other threads.

Overview
1. Have a Raspberry Pi4 4GB
2. Pi connected directly to router, router is gigabit LAN capable, the cable used is gigabit capable, tested on separate device
3. Pi connected to Seagate USB3 External HDD, plugged into either of the blue USB ports in the Pi, external HDD tested to be working at USB3 speeds on separate device (100MB/s when it was formatted to NTFS and plugged into a windows device)
4. Samba setup on Pi
5. Max transfer speed, from my PC to the Pi over Samba is 10MB/s (large video files, from an M2 SSD)

The speeds did not change after trying the following solutions: -
1. Reformatted the external HDD to ext4, hoping that the problem was NTFS overhead
2. Tried different cable combinations from LAN to USB3
3. Tried fresh image of Raspbian and Ubunty Server with latest updates before setting up drive mounts or Samba

Really need some help here, can't seem to figure it out, i know this should not be the max capability of the Pi 4 given the performance i have seen from other users

lsusb -t

Code: Select all

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
    |__ Port 2: Dev 2, If 0, Class=Mass Storage, Driver=uas, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 3: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 4: Dev 4, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 4: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M


ethtool eth0

Code: Select all

Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
                                             1000baseT/Full
        Link partner advertised pause frame use: Symmetric Receive-only
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: gs
        Wake-on: d
        SecureOn password: 00:00:00:00:00:00
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: yes

LTolledo
Posts: 3476
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Slow samba transfer speed on RPi4 to a usb 3.0 drive (10,4mb/s)

Thu Jul 23, 2020 10:56 pm

attach image of file transfer graph from your w$ to RPi4B

fore reference I attach mine.
w10 to RPi4B-4G samba share file transfer.jpg
w10 to RPi4B-4G samba share file transfer.jpg (17.17 KiB) Viewed 544 times
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

kitlee
Posts: 3
Joined: Thu Jul 23, 2020 4:54 pm

Re: Slow samba transfer speed on RPi4 to a usb 3.0 drive (10,4mb/s)

Fri Jul 24, 2020 4:33 am

Transfer screenshot below.

Image


Samba Config

Code: Select all

[pi]
path = /media/pi/Seagate3TB
writeable = yes
create mask = 0777
directory mask = 0777
public = no  

Fstab

Code: Select all

UUID=c1eb2700-2c4b-40d2-9617-dbe54ec2e3c5 /media/pi/Seagate3TB ext4 auto,nofail,noatime,users,rw 0 0

pidd
Posts: 612
Joined: Fri May 29, 2020 8:29 pm
Location: Birkenhead, Wirral, UK
Contact: Website

Re: Slow samba transfer speed on RPi4 to a usb 3.0 drive (10,4mb/s)

Fri Jul 24, 2020 4:46 am

Not really a fair comparison, a 17KiB file is not going to saturate anything.

LTolledo
Posts: 3476
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Slow samba transfer speed on RPi4 to a usb 3.0 drive (10,4mb/s)

Fri Jul 24, 2020 5:16 am

the file copy on my graph is a 5.4GB mkv file.
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

kitlee
Posts: 3
Joined: Thu Jul 23, 2020 4:54 pm

Re: Slow samba transfer speed on RPi4 to a usb 3.0 drive (10,4mb/s)

Fri Jul 24, 2020 5:51 am

Uh, some help guys?

From what i've checked all the hardware points in the chain seem to indicate that its running to spec, be it USB3, or gigabit.

I now think that it might be a software issue, would any of the settings to mount or format my drive affect this result? Are there drivers for the ethernet that i should update?

I have already run apt update and apt full-upgrade after a fresh image.

EDIT - also tried the USB quirks from the sticky, and no dice viewtopic.php?f=28&t=245931&start=125

Return to “Beginners”