Slow file transfers to RPi5 over scp or rsync

  • Hi!

    A few days ago I replaced my trusty RPi4b LibreELEC device, with a RPi5. Basically I pulled the cables from the back of the rpi4, and plugged them into the rpi5 (except the power lead, I use the new official rpi5 brick for the new device). All devices are connected with ethernet cables to my router, and my PC is set up to have passwordless ssh access.

    With the old I used to transfer files to it using scp and rsync. This went at around 80-90MB/s, which was fine. With the new rpi5, I found that transfers are capped at around ~23MB/s, much slower:

    Bash
    [~] $ # the old rpi4:
    [~] $ scp -r -P 666 ~/largefile [email protected]:"/storage/"
    largefile                                                         100%  781MB  91.2MB/s   00:08
    [~] $ # the new rpi5:
    [~] $ scp -r -P 666 ~/largefile [email protected]:"/storage/"
    largefile                                                         100%  781MB  24.2MB/s   00:32    

    After hours searching the internet, posting on other forums, and (I'm ashamed to say) even asking an AI chatbot, I found that if I manually limit the bandwidth, using the -l switch of the scp command, the speed goes up:

    After some testing the sweet spot seems to be around 100MB/s (819200 kbps). Higher than that, and the speed absolutely tanks (and apparently, setting no limit is equivalent to a much higher limit).

    So, that sort of solves the problem I guess, I can manually specify the bandwidth limit when running scp. But... unfortunately rsync does not have a working bandwidth limit. It supports a --bwlimit option, but that only works to lower the speed below the ~23MB/s, it will not help to increase it. If I use other (system level) methods to make sure rsync can not send more 100MB/s over the network, it does work, but these methods are cumbersome and not workable as standard method.

    Does anyone have any suggestions to fix this? I'm not exactly sure what the problem is, it seems to me that my PC is sending out data to the RPi5 much faster than it can handle. Do the pi's negotiate the speed somehow when a connection is established? Is there any setting in LibreELEC to make sure the RPi5 tells my PC not to push out the data too fast? With the -l flag on scp, it shows the RPi5 can handle receiving data at ~100MB/s, but if I go over just a little bit, it chokes on it spectacularly. Maybe there are settings that make it handle the data-overload better?

    I have added the old RPi4 back to the network (next to the new RPi5) and it still behaves completely normal, with fast transfers over both rsync and scp without any explicit bandwidth limiting.

    Thanks!