Rsync idel

  • Good Morning,
    I have a Raspberry4 with 2 USB3 hard drives (Ext4).
    The performance is fine. Now I have configured Rsnapshot.
    After the start, however, 3 Rnsapshot processes only come in for about 5 seconds every 1-2 minutes (htop).
    After that the rsync-processes are idelThus, only 25GB were transferred in 8h.The whole system is idle.
    CPU utilization is 11% and memory consumption is 200MB.
    I have no idea where to look here, or what the problem is?!?


    Does somebody has any idea?

  • So I´ve found the problem by myself, but I can´t understand it.
    The 2 USB3-Disk are installed over an USB 3.0 HUB for voltage reasons.
    If I install the HDs direct on the Raspberry rsync works fine.
    Why has rsync such problems? The other processes also work with the hub!

    • Offizieller Beitrag

    USB is fickle. Avoid if possible!!!


    When you connect directly perhaps UASP in the USB interface work correctly. When you connect via a USB hub it might not work, and cause degraded performance.


    A powered UASP USB 3 case might be better than a USB hub.


    I only use UASP USB 3 cases directly to my RPi4. Either 2.5" SATA SSD in a UASP USB 3 case or a powered dual 3.5" UASP USB 3 box. Performance is OK, but not amazing using rsync.


    Depending on settings rsync may do a lot more than just copying files. For instance with default settings it first copies the file to a temp file, then afterwards moves the file to the right place and right name. This means a lot of extra I/O, especially if you have a lot of small files. Also sometimes rsync does crc checks and so on. And if you don't have noatime on the filesystem rsync may access a lot of files and cause extra I/O even if no files need copying.


    (Use --inplace to avoid creating a temp file. But that may increase fragmentation and also disables writing of partial files if only a small part of a file has changed.)

  • Hi Adoby,


    thanks for this information!
    The use of --inplace seems to double the speed :-), which of course is not enough.
    I did a lot of tests (with no hub, ...)
    It is strange that with an active USB2-Hub the speed is okay (thus for USB2 stop).
    If I use rdiff-backup, it also works well on the USB3 hub


    So your assessment that USB is moody, I can agree.


    Also elsewhere you will find USB Linux issue: https://github.com/ayufan-rock64/linux-build/issues/112


    I would like to use rsync, but in my config it seems that I have no chance and had to invest in an more expensiv UASP-Hub without knowing if this fix my problem :(

    • Offizieller Beitrag

    Don't use a hub. Connect the HDD to the NAS with the least amount of stuff between. Just one UASP USB interface. I suspect that every time you add one more layer you add more latency and slow things down.


    The whole point of using rsync is that backups/snapshots after the very first will only have to handle changes. If you want to backup 12TB using rsync you need to transfer 12TB only the first time. After that rsync only need to check for changes since last backup and only need do what is needed to update the backup to match those changes. Transfer new/modified files. Delete files. This update can be many thousands times faster than doing a new full backup.


    For instance if I want to update a snapshot of a 12 TB HDD, rsync only has to hardlink the old unchanged files and copy over the changes. That may take seconds or minutes. But the first transfer might take hours or even days, depending on what is between the two HDDs.


    To save a LOT of time, the two HDDs may be in the same PC the first time, both connected to the same computer using only SATA cables. Then the first transfer is really FAST.


    After that the two HDDs might be separated far between each other using SATA interfaces, network interfaces, switches, routers and perhaps even USB/SATA bridges and USB hubs. Possibly even encryption and decryption software and a VPN internet connection. And then the transfer speed will be much, much slower.


    But thanks to rsync only changes need to be transferred. So it may only take minutes, or even seconds, to create a new full snapshot backup copy of the 12TB HDD at the destination.


    This is how I use rsync!


    I typically only use rsync to create updated and timestamped full snapshots of my 16 or 12 TB NASes in minutes over a GbE network. I use cron and scripts that handle rsync to automatically create/update the timestamped snapshot copies, and it even purges old snapshots for me.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!