I want to use my RPi4 as a small home NAS. To do that, I'm trying to benchmark the maximum file transfer performance.
Workflow:
Rpi4 connected to home router with a 1 Gbit cable
computer connected to home router with a 1 Gbit cable
in order to avoid variations due to the microSD card speed itself or the USB external hard drive speed, I create a 500MB file in a RAMdisk:
sudo mkdir /mnt/ramdisk sudo mount -t tmpfs -o size=512m tmpfs /mnt/ramdisk sudo dd if=/dev/urandom of=/mnt/ramdisk/500MB bs=1M count=500 iflag=fullblock # random 500MB file
then I copy via SFTP this file from RPi's
/mnt/ramdisk/500MB
to my laptop's SSD
I get the following results:
When nothing is additionally plugged on USB ports, I get 32 MB/sec transfer
When I plug an external USB 2.5" external hard drive without its own power supply (supply from USB), without using it, still using transfer from RAMdisk, I get 15 MB/sec only!
So I had my answer ready ... the USB external hard drive takes too much power and this is the reason for the performance drop! But it seems that no: indeed the next test is a mystery:
When I plug an external USB3 external hard drive which has its own power supply (with an adapter for the HDD only) to the RPi4 (USB2 or USB3 port tested, idem), without using it but just plugged in, still using the RAMdisk, I get 15 MB/sec too!
Question: which maximum transfer speed over SFTP from RPi to computer do you get? if possible with a similar workflow from above: RPi + computer with ethernet cables, no Wifi, transfer a file from RPi (in RAMdisk) to computer (on SSD)