LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   rsync really slow (https://www.linuxquestions.org/questions/linux-software-2/rsync-really-slow-4175736087/)

danabooth 04-16-2024 08:37 AM

rsync really slow
 
I looked around for answers, and I did find a lot of folks bitchin about the speed of rsync, but no real solutions. We have a fileserver, not very big, current usage is ~1.7TB. I made a new fileserver using Debian 12 running Samba .. I mounted the old fileserver in /mnt and cifs, and let rsync copy the files over, it took three days. Now you'd think that after that, I could run rsync and since pretty much everything is here, it would take a few minutes, but it takes about four hours. The command is:

rsync -rqu --size-only --delete --log-file=<file> <src> <dest>

I've really not used rsync much in the past outside of small cron jobs at home, can anyone shed light on what I'm doing wrong, or is rsync just that slow?

As a side note, I also back up that same (old) file server with my windows work computer using robocopy.exe to an external usb spinner, and the backup takes about 7-10 minutes every hour, there's just not that much going on on that particular server.

business_kid 04-16-2024 09:24 AM

Rsync is slow, as it's encrypting and decrypting. It's only as fast as the slowest cpu. It takes me just over 5 minutes 10 seconds to copy 1GB (=1024́³) between two boxes here. The slower one is a RazPi 4, 4core A-72 Cortex @1.8 GHz. I've seen it take longer if the thing isn't idle.

That 1GB file was constructed with 'dd if=/dev/random...' so it wasn't a zero string. For your 1.7TB =1700GB disk,, that calculates to a copying time of 527,000 seconds, = 146 hours = 6 days, 2 hours and twenty something minutes. I can hardly think of a slower way to do it.

You'd employ your time much better mounting the disk locally and copying over. Or set up an ftp server, NFS mount, or something that didn't involve heavy lifting on a light cpu.

pan64 04-16-2024 09:26 AM

rsync is initially designed to copy files from a remote location over some network. It loses almost all its power if you want to make a local copy (single host, mounted filesystems), it will work as a single copy command. So the question is: how long does it take to copy those files using cp (or any other command)? Additionally cifs is a relatively slow filesystem, you ought to use something faster. rsync does not need a locally mounted drive, it can directly access the remote host/filesystem, probably that would be faster.


All times are GMT -5. The time now is 07:20 AM.