agus.aon
Posts: 3
Joined: Mon Aug 19, 2019 10:24 pm

Fast reading, very slow writing - rpi 4, samba, external USB 3.0 HDD

Tue Aug 20, 2019 1:10 pm

Hey guys, so I'm trying to set up my new raspberry pi 4 with an external hdd usb 3.0 with samba in raspbian. The thing is it's giving me great speeds for reading, but really slow and unreliable write speeds.

Speeds: https://imgur.com/a/E59rMhs

Things I've tried so far:

* It's connected to gigabit ethernet
* It's connected to USB 3.0
* It's not the UAS issue, already tried that
* I've tried using some parameters in samba but didn't change anything (even more made it slightly worse) socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
* It's not the alpha rpi firmware, I have not installed that
* Tried noatime in fstab, no changes
* It's not an issue with the external HDD, it's running at full speed (or near, about 60MB/s) copying files within raspbian

One thing I've found strange, was that writing on my sd card is slow, gets me around 8-9MB/s, which is the same speed I'm seeing when writing via samba AND it's the same speed I'm seeing when writing from the HDD to the sd card WITHIN raspbian.

So I'm running out of things to try. Has anyone gone through something similar?

User avatar
mikronauts
Posts: 2724
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Fast reading, very slow writing - rpi 4, samba, external USB 3.0 HDD

Tue Aug 20, 2019 1:51 pm

Ext4 or ntfs?

Ntfs is known to be slow on a Pi.

agus.aon wrote:
Tue Aug 20, 2019 1:10 pm
Hey guys, so I'm trying to set up my new raspberry pi 4 with an external hdd usb 3.0 with samba in raspbian. The thing is it's giving me great speeds for reading, but really slow and unreliable write speeds.

Speeds: https://imgur.com/a/E59rMhs

Things I've tried so far:

* It's connected to gigabit ethernet
* It's connected to USB 3.0
* It's not the UAS issue, already tried that
* I've tried using some parameters in samba but didn't change anything (even more made it slightly worse) socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
* It's not the alpha rpi firmware, I have not installed that
* Tried noatime in fstab, no changes
* It's not an issue with the external HDD, it's running at full speed (or near, about 60MB/s) copying files within raspbian

One thing I've found strange, was that writing on my sd card is slow, gets me around 8-9MB/s, which is the same speed I'm seeing when writing via samba AND it's the same speed I'm seeing when writing from the HDD to the sd card WITHIN raspbian.

So I'm running out of things to try. Has anyone gone through something similar?
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

agus.aon
Posts: 3
Joined: Mon Aug 19, 2019 10:24 pm

Re: Fast reading, very slow writing - rpi 4, samba, external USB 3.0 HDD

Tue Aug 20, 2019 10:49 pm

I forgot to mention it’s ext4
mikronauts wrote:
Tue Aug 20, 2019 1:51 pm
Ext4 or ntfs?

Ntfs is known to be slow on a Pi.

agus.aon wrote:
Tue Aug 20, 2019 1:10 pm
Hey guys, so I'm trying to set up my new raspberry pi 4 with an external hdd usb 3.0 with samba in raspbian. The thing is it's giving me great speeds for reading, but really slow and unreliable write speeds.

Speeds: https://imgur.com/a/E59rMhs

Things I've tried so far:

* It's connected to gigabit ethernet
* It's connected to USB 3.0
* It's not the UAS issue, already tried that
* I've tried using some parameters in samba but didn't change anything (even more made it slightly worse) socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
* It's not the alpha rpi firmware, I have not installed that
* Tried noatime in fstab, no changes
* It's not an issue with the external HDD, it's running at full speed (or near, about 60MB/s) copying files within raspbian

One thing I've found strange, was that writing on my sd card is slow, gets me around 8-9MB/s, which is the same speed I'm seeing when writing via samba AND it's the same speed I'm seeing when writing from the HDD to the sd card WITHIN raspbian.

So I'm running out of things to try. Has anyone gone through something similar?

agus.aon
Posts: 3
Joined: Mon Aug 19, 2019 10:24 pm

Re: Fast reading, very slow writing - rpi 4, samba, external USB 3.0 HDD

Fri Aug 23, 2019 1:33 am

So I finally found my issue. The thing is, I was trying to copy files from my laptop through WiFi. It was 5Ghz ac wifi, so I thought it should be really fast (and it should). My laptop (Surface Laptop 2) doesn't have a great wifi chip, but I thought it shouldn't make much of a difference since I'm less than 4 meters away from the router in lane of sight.

What ended up being the issue? Well the wifi channel. I only have a few more 5ghz wifi hotspots nearby but on channel 153, something like that, and only one on channel 56 and I was running on channel 56. As soon as I changed my channel and put my laptop really near the router everything started working better. Nevertheless, it's not reliable enough, and I should totally change to ethernet as soon as possible.

Thank you all!

Return to “Networking and servers”