0

Raspberry 4 - NAS, slow copying over the network

I have problem with copying backup speed over network, currently only 30MB/s. How can I confirm that this is the maximum data backup speed?

I tested backup up on my two a new disks: HDD (Seagate Barracuda Pro) and SSD (ADATA SU650) I have an updated Raspberry 4B, the latest kernel, the disk controller supports UASP, the uas driver is loaded. Writing is very fast on other operating systems (Windows, Arch) below 140MB/s.

My network speed is: 1Gbps

root@raspberrypi:~# lsusb -t
/: 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

======================

root@raspberrypi:~# dmesg | grep usb
[ 0.129240] usbcore: registered new interface driver usbfs
[ 0.129323] usbcore: registered new interface driver hub
[ 0.129454] usbcore: registered new device driver usb
[ 0.129762] usb_phy_generic phy: phy supply vcc not found, using dummy regulator
[ 1.122647] usbcore: registered new interface driver r8152
[ 1.122738] usbcore: registered new interface driver lan78xx
[ 1.122810] usbcore: registered new interface driver smsc95xx
[ 1.126818] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.04
[ 1.126855] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.126888] usb usb1: Product: xHCI Host Controller
[ 1.126915] usb usb1: Manufacturer: Linux 5.4.59-v7l+ xhci-hcd
[ 1.126942] usb usb1: SerialNumber: 0000:01:00.0
[ 1.128796] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.04
[ 1.128833] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.128865] usb usb2: Product: xHCI Host Controller
[ 1.128892] usb usb2: Manufacturer: Linux 5.4.59-v7l+ xhci-hcd
[ 1.128918] usb usb2: SerialNumber: 0000:01:00.0
[ 1.131769] usbcore: registered new interface driver uas
[ 1.131897] usbcore: registered new interface driver usb-storage
[ 1.141902] usbcore: registered new interface driver usbhid
[ 1.141928] usbhid: USB HID core driver
[ 1.501573] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[ 1.684241] usb 1-1: New USB device found, idVendor=2109, idProduct=3431, bcdDevice= 4.21
[ 1.684285] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 1.684316] usb 1-1: Product: USB2.0 Hub
[ 4.562486] usb 2-2: new SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[ 4.593532] usb 2-2: New USB device found, idVendor=152d, idProduct=0578, bcdDevice= 4.14
[ 4.593552] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.593568] usb 2-2: Product: USB to ATA/ATAPI Bridge
[ 4.593584] usb 2-2: Manufacturer: JMicron
[ 4.593598] usb 2-2: SerialNumber: 0123456789ABCDEF
[ 4.661026] usbcore: registered new interface driver brcmfmac

======================

root@raspberrypi:~# hdparm -tT /dev/sda
/dev/sda:
Timing cached reads: 1626 MB in 2.00 seconds = **813.30 MB/sec**
Timing buffered disk reads: 540 MB in 3.01 seconds = **179.70 MB/sec**

When I copy file locally I have 71.17MB/s from SD to HDD or SSD but over network I have only 30MB/s.

##COPY FILE LOCALLY
user@raspberrypi:/tmp# dd if=/dev/urandom of=500M bs=10M count=50
50+0 records in
50+0 records out
524288000 bytes (524 MB, 500 MiB) copied, 26.8808 s, 19.5 MB/s
user@raspberrypi:/tmp# rsync -avh --progress 500M /mnt/hdd1/
sending incremental file list
500M
524.29M 100% **71.17MB/s** 0:00:07 (xfr#1, to-chk=0/1)

sent 524.42M bytes received 35 bytes 69.92M bytes/sec
total size is 524.29M speedup is 1.0

##COPY OVER NETWORK
[user@xyz tmp]# dd if=/dev/urandom of=500M bs=10M count=50
50+0 records in
50+0 records out
524288000 bytes (524 MB, 500 MiB) copied, 3.24353 s, 162 MB/s
[user@xyz tmp]# rsync -avh --progress 500M user@raspberry:/mnt/hdd1/
user@raspberry's password:
sending incremental file list
500M
524.29M 100% **36.52MB/s** 0:00:13 (xfr#1, to-chk=0/1)

sent 524.42M bytes received 35 bytes 25.58M bytes/sec
total size is 524.29M speedup is 1.00
  • Are disks formatted NTFS? – Michael Harvey Aug 30 at 11:52
  • no, I formatted my disk only ext4 or btrfs. – tombomlom Aug 30 at 13:04
  • I presume you have read this, particularly about 'quirks'? – Michael Harvey Aug 30 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.