User avatar
superchomp
Posts: 4
Joined: Sun May 07, 2017 4:53 am

Pi 4 as a NAS: USB3 speeds

Wed Jul 24, 2019 4:27 am

Hi there, I'm using a Pi 4 1GB as a NAS with latest Raspbian, Samba, gigabit ethernet and two USB 3 drives connected:
Share 1 - Samsung EVO 500GB with a Sabrent USB 3.0 enclosure (gets 450MB/s on my desktop)
Share 2 - 4TB Seagate 2.5" (gets 120MB/sec or more on my desktop)

I'm consistently writing files around 30MB/sec (or around 240Mbps) over gigabit ethernet from my desktop to the Pi 4.
Those are USB 2 speeds, so I'm wondering what I'm doing wrong.

Using Raspbian I've installed NTFS support, mounted the drives via SMB to Windows 10.
I was hoping I'd get at least 800Mbps or 100MB/sec.
Would I do better with EXT3?

Thanks for helping me brainstorm!

EDIT: I'm going to try the steps from this post, re, "bad speeds"

ejolson
Posts: 6334
Joined: Tue Mar 18, 2014 11:47 am

Re: Pi 4 as a NAS: USB3 speeds

Wed Jul 24, 2019 9:22 pm

superchomp wrote:
Wed Jul 24, 2019 4:27 am
Would I do better with EXT3?
Yes, a native Linux filesystem will perform better. Rather than EXT3, however, I would suggest EXT4.

andrum99
Posts: 1357
Joined: Fri Jul 20, 2012 2:41 pm

Re: Pi 4 as a NAS: USB3 speeds

Thu Jul 25, 2019 10:50 pm

I would definitely recommend not using NTFS on the Pi if you are looking for fast speeds. NTFS does work on the Pi, but as you have discovered it is not particularly fast. I get faster speeds than yours using some old laptop hard disks in external enclosures, with a power USB 3.0 hub but I use ext4. I get about 500 to 600Mbps uploading to the Pi using samba, and very nearly 1Gbps downloading from the Pi using samba.

Ext4 is the file system that is "current" on Linux, so you should use that. You can also try btrfs, but I had a bad experience with that recently so would personally not recommend it. Ext4 is the safer choice - it's simpler than btrfs.

hal58
Posts: 7
Joined: Fri Jul 24, 2015 10:18 am

Re: Pi 4 as a NAS: USB3 speeds

Tue Aug 06, 2019 10:08 pm

I have used JFS for years on my server data store. Pi's (2, 3, 3B+ and very soon 4) have been used with large (400 Ah, 24 vcd) battery supply (photovoltaicly charged) run the main network. I also use JFS on my desktops and laptops with no noticeable speed penalties. Unfortunately, the Pi boot system forces me to use ext4 for the root partition. Data on the server is accessed by 'sshfs' and I have written scripts to mount various parts of the data store on remote systems for various purposes; playing music, reviewing data, backing up workstations, etc. There is a little overhead by using sshfs, but for my purposes the gig-E wired system and 5GHz wireless is adequate.

lalakersfan29
Posts: 2
Joined: Mon Jul 08, 2019 11:34 pm

Re: Pi 4 as a NAS: USB3 speeds

Fri Aug 16, 2019 5:38 pm

andrum99 wrote:
Thu Jul 25, 2019 10:50 pm
I would definitely recommend not using NTFS on the Pi if you are looking for fast speeds. NTFS does work on the Pi, but as you have discovered it is not particularly fast. I get faster speeds than yours using some old laptop hard disks in external enclosures, with a power USB 3.0 hub but I use ext4. I get about 500 to 600Mbps uploading to the Pi using samba, and very nearly 1Gbps downloading from the Pi using samba.

Ext4 is the file system that is "current" on Linux, so you should use that. You can also try btrfs, but I had a bad experience with that recently so would personally not recommend it. Ext4 is the safer choice - it's simpler than btrfs.
Could you help me out? I have the Pi4 setup with an external hdd formatted in ext4 and samba smb shares. I mounted it as a network drive in Windows but I'm getting 4 MB/s max upload speed.

mistrpokr
Posts: 3
Joined: Sat Aug 17, 2019 5:32 am

Re: Pi 4 as a NAS: USB3 speeds

Sat Aug 17, 2019 6:11 am

lalakersfan29 wrote:
Fri Aug 16, 2019 5:38 pm
andrum99 wrote:
Thu Jul 25, 2019 10:50 pm
I would definitely recommend not using NTFS on the Pi if you are looking for fast speeds. NTFS does work on the Pi, but as you have discovered it is not particularly fast. I get faster speeds than yours using some old laptop hard disks in external enclosures, with a power USB 3.0 hub but I use ext4. I get about 500 to 600Mbps uploading to the Pi using samba, and very nearly 1Gbps downloading from the Pi using samba.

Ext4 is the file system that is "current" on Linux, so you should use that. You can also try btrfs, but I had a bad experience with that recently so would personally not recommend it. Ext4 is the safer choice - it's simpler than btrfs.
Could you help me out? I have the Pi4 setup with an external hdd formatted in ext4 and samba smb shares. I mounted it as a network drive in Windows but I'm getting 4 MB/s max upload speed.
Same here, with a ext4 SSD going only 4MBps on SMB/FTP. For my own case I guess there's something wrong with my LAN setup. I'm planning another try at my dorm back on campus, where the network structure is much simpler and robust... Or so I hope.
I think the bottleneck wouldn't be IO, for I benchmarked the SSD on Pi 4 and got a reading speed of at least 300MBps.

User avatar
thagrol
Posts: 4031
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Pi 4 as a NAS: USB3 speeds

Sat Aug 17, 2019 5:48 pm

mistrpokr wrote:
Sat Aug 17, 2019 6:11 am
lalakersfan29 wrote:
Fri Aug 16, 2019 5:38 pm
andrum99 wrote:
Thu Jul 25, 2019 10:50 pm
I would definitely recommend not using NTFS on the Pi if you are looking for fast speeds. NTFS does work on the Pi, but as you have discovered it is not particularly fast. I get faster speeds than yours using some old laptop hard disks in external enclosures, with a power USB 3.0 hub but I use ext4. I get about 500 to 600Mbps uploading to the Pi using samba, and very nearly 1Gbps downloading from the Pi using samba.

Ext4 is the file system that is "current" on Linux, so you should use that. You can also try btrfs, but I had a bad experience with that recently so would personally not recommend it. Ext4 is the safer choice - it's simpler than btrfs.
Could you help me out? I have the Pi4 setup with an external hdd formatted in ext4 and samba smb shares. I mounted it as a network drive in Windows but I'm getting 4 MB/s max upload speed.
Same here, with a ext4 SSD going only 4MBps on SMB/FTP. For my own case I guess there's something wrong with my LAN setup. I'm planning another try at my dorm back on campus, where the network structure is much simpler and robust... Or so I hope.
I think the bottleneck wouldn't be IO, for I benchmarked the SSD on Pi 4 and got a reading speed of at least 300MBps.
Have you read and applied this? https://www.raspberrypi.org/forums/view ... ?p=1501426
Arguing with strangers on the internet since 1993.

mistrpokr
Posts: 3
Joined: Sat Aug 17, 2019 5:32 am

Re: Pi 4 as a NAS: USB3 speeds

Sun Aug 18, 2019 8:43 am

thagrol wrote:
Sat Aug 17, 2019 5:48 pm
mistrpokr wrote:
Sat Aug 17, 2019 6:11 am
lalakersfan29 wrote:
Fri Aug 16, 2019 5:38 pm


Could you help me out? I have the Pi4 setup with an external hdd formatted in ext4 and samba smb shares. I mounted it as a network drive in Windows but I'm getting 4 MB/s max upload speed.
Same here, with a ext4 SSD going only 4MBps on SMB/FTP. For my own case I guess there's something wrong with my LAN setup. I'm planning another try at my dorm back on campus, where the network structure is much simpler and robust... Or so I hope.
I think the bottleneck wouldn't be IO, for I benchmarked the SSD on Pi 4 and got a reading speed of at least 300MBps.
Have you read and applied this? https://www.raspberrypi.org/forums/view ... ?p=1501426
Actually I think that thread was providing a fix for slow local transmissions, instead of concerning transmissions via network... Anyway I'll see if that's the fix for me.

EDIT:
Right I think I got the fix, if it qualifies one...
I connected Pi and my PC directly to a network switch (I would assume a router is gonna do the same) via cable, and ran a samba test again. The result is amazing: 40MB/s. So I would say, apparently the problem we're encountering here is all about network infrastructures.

User avatar
thagrol
Posts: 4031
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Pi 4 as a NAS: USB3 speeds

Sun Aug 18, 2019 10:26 am

mistrpokr wrote:
Sun Aug 18, 2019 8:43 am

Actually I think that thread was providing a fix for slow local transmissions, instead of concerning transmissions via network... Anyway I'll see if that's the fix for me.
Don't discount it. Network transmission speeds aren't solely dependent on the network capabilities. Data has to be read from the HDD before it can be sent over the network so a slow HDD and high CPU load can affect transfer speeds.
EDIT:
Right I think I got the fix, if it qualifies one...
I connected Pi and my PC directly to a network switch (I would assume a router is gonna do the same) via cable, and ran a samba test again. The result is amazing: 40MB/s. So I would say, apparently the problem we're encountering here is all about network infrastructures.
Certainly sounds likely but that's assuming you made no other changes between that test and the previous ones.
Arguing with strangers on the internet since 1993.

mistrpokr
Posts: 3
Joined: Sat Aug 17, 2019 5:32 am

Re: Pi 4 as a NAS: USB3 speeds

Mon Aug 19, 2019 7:11 am

thagrol wrote:
Sun Aug 18, 2019 10:26 am
mistrpokr wrote:
Sun Aug 18, 2019 8:43 am

Actually I think that thread was providing a fix for slow local transmissions, instead of concerning transmissions via network... Anyway I'll see if that's the fix for me.
Don't discount it. Network transmission speeds aren't solely dependent on the network capabilities. Data has to be read from the HDD before it can be sent over the network so a slow HDD and high CPU load can affect transfer speeds.
EDIT:
Right I think I got the fix, if it qualifies one...
I connected Pi and my PC directly to a network switch (I would assume a router is gonna do the same) via cable, and ran a samba test again. The result is amazing: 40MB/s. So I would say, apparently the problem we're encountering here is all about network infrastructures.
Certainly sounds likely but that's assuming you made no other changes between that test and the previous ones.
Ah yes. I didn't try the method provided by that thread when I ran the test with cable connection. Since the result of that test was promising and I decided to build the whole storage system again from scratch(to eliminate a few weird problems I created on the first setup), I have the chance to try and see if the SSD can potentially get a better performance on the new setup.

tinkoo
Posts: 1
Joined: Wed Mar 04, 2020 8:39 pm

Re: Pi 4 as a NAS: USB3 speeds

Wed Mar 04, 2020 8:42 pm

how do you get 30MB/sec (or around 240Mbps) , Lan or WLan ?

My macbook using gigabit Wlan to connect samba on pi, pi connected to gigabit ethernet,

I only get 10MB/sec.

K4BlOs
Posts: 3
Joined: Sat Mar 21, 2020 10:10 am

Re: Pi 4 as a NAS: USB3 speeds

Mon Apr 06, 2020 6:33 pm

Hi,
I have speed issue when copying files from RPI 4 4GB through LAN 1GBs network. Copy from PC->RPI is good about 70-80 MB/sec but copy frop RPI->PC is really bad it is only 300-500 KB/sec.
My equipment
Hardware:
- Raspberry Pi 4 with 4GB RAM
- 2x HDD 3,5" Western Digital Red 3TB (connected on USB 3.0) and ext4
- 2x SATA cabel ID 152d:0578 JMicron Technology Corp. / JMicron USA Technology Corp. JMS567 SATA 6Gb/s bridge
https://a.aliexpress.com/_BT1STb
- each HDD is powered with external 12V/2A power supply connected to SATA JMicron cable and external 5V power supply
- SD card SanDisk Extreme 32GB

Software:
- Raspbian Buster 2020-02-13
- Openmediavault 5.3.9-1 (Usul)
- HDD's are in raid 1 (mirror) md0 and ext4
- samba

Commands:
pi@RPI-Server:~ $ sudo nano /boot/cmdline.txt
usb-storage.quirks=152d:0578:u console=serial0,115200 console=tty1 root=PARTUUID=ea7d04d6-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles

pi@RPI-Server:~ $ lsusb
Bus 002 Device 003: ID 152d:0578 JMicron Technology Corp. / JMicron USA Technology Corp. JMS567 SATA 6Gb/s bridge
Bus 002 Device 002: ID 152d:0578 JMicron Technology Corp. / JMicron USA Technology Corp. JMS567 SATA 6Gb/s bridge
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

pi@RPI-Server:~ $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 2,7T 0 disk
`-sda1 8:1 0 2,7T 0 part
`-md0 9:0 0 2,7T 0 raid1 /srv/dev-disk-by-label-Data
sdb 8:16 0 2,7T 0 disk
`-sdb1 8:17 0 2,7T 0 part
`-md0 9:0 0 2,7T 0 raid1 /srv/dev-disk-by-label-Data
mmcblk0 179:0 0 29,7G 0 disk
|-mmcblk0p1 179:1 0 256M 0 part /boot
`-mmcblk0p2 179:2 0 29,5G 0 part /

pi@RPI-Server:~ $ sudo rpi-eeprom-update
BCM2711 detected
BOOTLOADER: up-to-date
CURRENT: Út zář 10 10:41:50 UTC 2019 (1568112110)
LATEST: Út zář 10 10:41:50 UTC 2019 (1568112110)
FW DIR: /lib/firmware/raspberrypi/bootloader/critical
VL805: up-to-date
CURRENT: 00013701
LATEST: 00013701

pi@RPI-Server:~ $ sudo hdparm -tT /dev/sda
/dev/sda:
Timing cached reads: 2 MB in 5.39 seconds = 380.02 kB/sec
Timing buffered disk reads: 2 MB in 4.72 seconds = 434.14 kB/sec

pi@RPI-Server:~ $ sudo hdparm -tT /dev/sdb
/dev/sdb:
Timing cached reads: 1432 MB in 2.00 seconds = 715.86 MB/sec
Timing buffered disk reads: 18 MB in 4.35 seconds = 4.14 MB/sec

What I try:
- Many options in /etc/samba/smb.conf but not working
- I was try reflashing vl805 by this https://www.raspberrypi.org/forums/view ... 7#p1490468
not working
- only add quirsk to cmdline quite worked for write speed but read speed is totaly bad.
- when I connect HDD´s to USB2.0 write speed drop down to ca 10-11MB/sec (from ca 70MB/sec in USB3.0) and read speed increased to ca 10-11MB/sec (from 300-500 KB/sec in USB3.0)


I´m at the end of my powers :( Is here someone who can help me?
"sorry for my english :? "

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

Re: Pi 4 as a NAS: USB3 speeds

Mon Apr 06, 2020 10:00 pm

"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!"

K4BlOs
Posts: 3
Joined: Sat Mar 21, 2020 10:10 am

Re: Pi 4 as a NAS: USB3 speeds

Tue Apr 07, 2020 5:39 am

I look to your solution, but when I delete quirks from cmdline.txt raspberry disconnected randomly hdd's, raid aray is broken etc.. with quirks I have stabile connected hdd's and everything works well except for the speed of hdd read

cpc464
Posts: 238
Joined: Tue Jul 08, 2014 5:10 pm
Contact: Website

Re: Pi 4 as a NAS: USB3 speeds

Wed Apr 08, 2020 10:07 am

I too did some extensive testing with the Pi4 as a NAS. Speeds achieved were:

reading - well over 100 MB/s, saturates gigabit network

writing - about 70 MB/s. Still very good.

http://unixetc.co.uk/2019/07/07/raspber ... rld-tests/

I would recommend XFS for the file system. It achieved faster speeds that EXT* and seems to be the industry standard in NAS applications.
Unix engineer since 1989

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

Re: Pi 4 as a NAS: USB3 speeds

Wed Apr 08, 2020 9:11 pm

...so that explains the file system used on my off-the-shelf commercial NAS.

might try implementing it on newer projects....
"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!"

Return to “Networking and servers”