LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 05-22-2015, 10:17 AM   #1
dilettante9
Member
 
Registered: Jun 2012
Location: U.S.
Distribution: Debian, Xubuntu
Posts: 46

Rep: Reputation: Disabled
Rsync slow when copying tar files


In Mint, on a GB ethernet connection, I am copying a large amount of data (around 800 GB) from a server to a local computer using rysnc. One directory on the server contains some large tar files (each one about 1 GB in size) that archived an entire (now-defunct) computer. The problem is that when rsync copies these tar files, it slows down to a crawl. It goes so slow, in fact--like 15 minutes per file--that it's making the job take a huge amount of time.

Does anyone know why this is happening, and if there is some switch in rsync that could prevent it? I suspect that rsync is recursing through the tar files and doing some type of checksum or something. All I want, though, is the files copied. Those tar files aren't even that important, so if there is a way to simply copy them byte by byte, that would be great.
 
Old 05-22-2015, 10:48 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
If the files do not currently exist at the destination, rsync should be fast. If the files do exist at the destination, using the "-c" option will slow the startup considerably since the checksums of the source and destination files need to be calculated and compared.

The other thing that can slow down the transfer is a weak CPU at the source compressing the files for transfer. Since compression is the default, consider using the "--no-z" (--no-compression) option to turn it off, especially if the tar files are mostly incompressible anyway, or if your network is faster than the CPU doing the compression. (Compression is by default disabled for files with certain known incompressible extensions, which include ".gz", ".tgz", and ".tbz".)

Last edited by rknichols; 05-22-2015 at 10:52 AM. Reason: Add mention of known-incompressible types
 
Old 05-22-2015, 11:11 AM   #3
dilettante9
Member
 
Registered: Jun 2012
Location: U.S.
Distribution: Debian, Xubuntu
Posts: 46

Original Poster
Rep: Reputation: Disabled
Thanks, rknichols. The CPU is rather weak, so I am trying it with compression turned off, though as you say, the tar files (which have a gz extensuion), are not compressed by rsync anyway.
 
Old 05-22-2015, 12:08 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by rknichols View Post
Since compression is the default, consider using the "--no-z" (--no-compression) option to turn it off
Compression has never been the default in my experience, is this something new with Ubuntu/Mint?

Last edited by suicidaleggroll; 05-22-2015 at 12:38 PM.
 
Old 05-22-2015, 01:58 PM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by suicidaleggroll View Post
Compression has never been the default in my experience, is this something new with Ubuntu/Mint?
You're right. Scratch that. I'm getting my protocols mixed up again.
 
Old 05-22-2015, 09:31 PM   #6
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
It' s not compression, its encryption. Rsync runs over ssh. If you run top while copying you might see an encryption process or SSH using much CPU time. If you see a high percentage of %wa (third line from the top) you have a network or disk problem.

jlinkels
 
Old 05-23-2015, 02:36 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
There should be some posts on this exact tar rsync deal on large files. Think someone said it needed to do the entire file at a shot so you end up consuming all your ram and into swap space. Might double check that to be sure.


Could exclude those larger files and just copy them. Should fix the speed.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rsync not copying all files barbz127 Linux - Newbie 2 08-04-2013 07:56 PM
rsync not copying files, no error shown RedMist Linux - Server 1 09-16-2009 08:44 AM
LXer: [Video] Commandline 101: Copying Files with rsync LXer Syndicated Linux News 0 04-11-2009 04:41 AM
Copying whole changed files - rsync? deadlock Linux - Software 2 12-04-2007 04:57 AM
prevent rsync from copying open files? bkeeper Linux - General 2 12-11-2006 04:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration