Bobcares

Rsync hangs on large files – Quick fixes !!

by | Oct 4, 2019

Facing migration problems where Rsync hangs on large files?

Quite often the Rsync operations go into a stuck state when copying large files from one server to another.

Mostly, Rsync hangs on large files due to the insufficient RAM size of the server.

At Bobcares we often get requests to fix Rsync errors, as a part of our Server Management Services.

Today, we’ll see the Rsync problem in detail and see how our Dedicated Engineers copy files efficiently.

 

What is Rsync?

Rsync is a great tool for replicating a single file or directories to remote file systems. This makes it a popular backup option.

Usually, Rsync is faster than other methods such as SCP. It uses an algorithm that minimizes the amount of data copied by only moving the portions of files that have changed.

Do you think why the Rsync is better than other commands like SCP?

Speed: Rsync replicates the entire content between the directories of destination and source.

Privileges: Rsync does not require the root privilege or sudo privilege. It comes handy for non-root users.

Security: It has a separate protocol, usually SSH, that must be specified for the transfer. Rsync allows encryption of data using ssh protocol during transfer.

There are basically two ways in which Rsync can copy/sync data:

1. Copying/syncing to/from another host over any remote shell like ssh, rsh.
2. Copying/Syncing through Rsync daemon using TCP.

 

Rsync hangs on large files- Reasons and fixes

Nowadays, we see many customers facing errors while transferring big files using the Rsync command.

Let’s see the main causes of this error and how our Support Engineers fix it.

 

1. Insufficient RAM space

Recently, one of our customers approached us with an error where Rsync hangs on large files.
Here, we checked and found that his server was running with insufficient RAM space. This was creating problems with Rsync too.

Usually, one of the important reasons for this error is insufficient RAM space on the server. Rsync’s memory usage is directly proportional to the size and number of files. In other words, large directories/files take a large amount of RAM.

Therefore, maintaining an adequate amount of free memory on the server comes as a prerequisite for Rsync operations.

So we always check the RAM space on the server using the free command and check the server space effectively.

We also analyze the results of the following commands and increase the memory on the server.

1. cat /proc/meminfo
2. vmstat -s
3. top -c

 

2. Wrong options

Sometimes the Rsync command hangs on large files due to the usage of wrong options with Rsync too. This becomes applicable in scenarios where we need to transfer large files with a slow network connection.

So we suggest to our customers to try it with the -z option ‘compress file data during the transfer‘. Also, our Support Engineers make sure to use the “–partial” option, which simply restarts an interrupted download/upload file. Further, we add the –timeout=0 option which means Rsync will not timeout.

Also, we set a big value for “–block-size” when there is a need to transfer the large files. A sample Rsync command will be:

To Copy a Directory from Local Server to a Remote Server

server## rsync --timeout=600 -r -zp --block-size=1048576 "filename/file path" root@remoteserverIP:/home/

That fixes the error and copies the file effectively.

 

3. SSH options

Similarly, bad SSH configuration also affects the Rsync operation. We make sure to alter SSH settings in /etc/ssh/sshd_config

A sample set of entries looks like:

KeepAlive yes
ServerAliveInterval 30
ServerAliveCountMax 6

This helps to avoid timeout errors when transferring large files.

 

4. The version of the Rsync

Last and not the least version of Rsync definitely affects a file transfer.

The older Rsync version causes incompatibility issues with the switches or protocol while transferring larger files. So we suggest our customers use the latest version of the Rsync.

We always use the command to check the current version of the rsync before any data transfer:

rsync --version

[Stuck on large file transfer using Rsync? Our Experts are available 24×7 to help you.]

 

Conclusion

In short, the reasons where Rsync hangs on large files are insufficient RAM space on the server, bad connection, wrong SSH settings and so on. Today, we discussed the fixes and saw how our Support Team proactively avoid the rsync errors on large file transfer.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

1 Comment

  1. Piet

    I’ve been using Linux since the mid 90s and learnt something about rsync. Never had any big files failing issues until now.

    Cheers

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF