[SOLVED] rsync -z vs. scp ... which one is faster over network?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
rsync -z vs. scp ... which one is faster over network?
Hi,
I often have to transfer huge data over our LAN from one computer to another. The size of the files varies and can be somewhere from 2 GB to 50GB or more! The only accepted connection protocol between machines are ssh; and rsync and scp are the only options available for copying over network (unison is not installed).
I usually use rsync with "-z" option to copy over network.
Does anyone have any idea if "rsync -z" is faster than "scp" for data transfer?
It probably is, especially if your connection sometimes gets interrupted and you have to resume (and double especially if you use rsync's --partial, and triple especially if you transfer the same files with minor changes to the same destination).
Have you benchmarked it? rsync has a "-h --stats" and scp also gives stats.
It probably is, especially if your connection sometimes gets interrupted and you have to resume (and double especially if you use rsync's --partial, and triple especially if you transfer the same files with minor changes to the same destination).
Have you benchmarked it? rsync has a "-h --stats" and scp also gives stats.
Thanks AlucardZero! I haven't benchmarked it using "-h --stats", but using "/usr/bin/time" I have seen rsync -z to be faster. Here is one set of results for same source and no prior existence of destination:
As AlucardZero pointed out, rsync is better for broken txfrs & by default it only sends diffrences, so if you sent the same file twice it would only send the diffs. You're also using -z = compress.
scp encrypts everything, so its likely what's sent is the same size as what's on the disk. Also, encrypted stuff doesn't compress very well as a rule.
You'd notice a slowdown if you told rsync to use ssh encryption. (-e ssh ...)
I believe mp3/ogg files cannot be compressed much and hence doesn't really matter whether we give "-z" option, or not. However for other cases "-z" option seem to make a big difference! Also timing for rsync with and without "-e ssh" are pretty much the same.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.