I'm trying to transfer thousands of small files from one server to another using the following command:
rsync -zr --delete /home/user/ user@10.1.1.1::backup
Currently the transfer takes a long time (I haven't timed it). Is there way to make this faster? Should I be using another tool? Should I be using rsync over ssh rather than using the rsync protocol?
Best Answer
You need to determine the bottleneck. It isn't rsync. It probably isn't your network bandwidth. As @Zoredache suggested it is most likely the huge number of iops generated by all the
stat()
calls. Any syncing tool is going to need to stat the files. While syncing runiostat
to verify.So the question becomes; how to I optimize stat? Two easy answers:
noatime
and add adir_index
).If by some chance it isn't your disk iops that is the limit then you could experiment with splitting the dir tree into multiple distinct trees and run multiple rsyncs.