Linux - General This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-03-2010, 09:34 AM
|
#1
|
|
Member
Registered: Jul 2009
Location: PA, USA
Distribution: Debian, RHEL5.4, CentOS 5.4
Posts: 103
Rep:
|
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?
TIA,
|
|
|
|
12-03-2010, 10:20 AM
|
#2
|
|
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,474
|
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.
|
|
|
|
12-07-2010, 04:26 PM
|
#3
|
|
Member
Registered: Jul 2009
Location: PA, USA
Distribution: Debian, RHEL5.4, CentOS 5.4
Posts: 103
Original Poster
Rep:
|
Quote:
Originally Posted by AlucardZero
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:
Code:
scp -r: RunTime: System: 1.34; User: 2.42; Elapsed:15:39.39
rsync -az: RunTime: System: 0.66; User: 2.69; Elapsed:3:32.51
|
|
|
|
12-08-2010, 12:02 AM
|
#4
|
|
Guru
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.4, Centos 5.9
Posts: 14,941
|
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 ...)
|
|
|
|
12-08-2010, 06:05 AM
|
#5
|
|
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,474
|
I don't understand, chrism01. rsync goes over SSH just like SCP. Also, it's possible to compress, THEN encrypt.
|
|
|
|
12-08-2010, 06:06 PM
|
#6
|
|
Member
Registered: Jul 2009
Location: PA, USA
Distribution: Debian, RHEL5.4, CentOS 5.4
Posts: 103
Original Poster
Rep:
|
compression is the key!
I did some more timing studies, and here is what I found:
For a directory predominantly full of music (mp3/ogg)
Code:
rsync -aze 'ssh' ... RunTime: System: 22.37; User: 99.39; Elapsed:3:08.79
rsync -ae 'ssh' ... RunTime: System: 21.52; User: 80.57; Elapsed:3:06.14
scp -r ... RunTime: System: 19.48; User: 69.78; Elapsed:3:23.12
rsync -az ... RunTime: System: 22.29; User: 99.86; Elapsed:3:10.09
For a directory full of various data and text and binary files
Code:
rsync -aze 'ssh' ... RunTime: System: 3.90; User: 15.54; Elapsed:0:48.96
rsync -ae 'ssh' ... RunTime: System: 12.61; User: 47.56; Elapsed:1:49.80
scp -r ... RunTime: System: 11.69; User: 41.92; Elapsed:2:03.16
rsync -az ... RunTime: System: 4.02; User: 15.52; Elapsed:0:47.11
rsync -a ... RunTime: System: 12.69; User: 47.53; Elapsed:1:55.53
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:59 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|