Bug 1236520
Summary: | rsync --sparse cannot copy /var/log/lastlog on x86_64 server | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Jaroslav Aster <jaster> |
Component: | rsync | Assignee: | Michal Ruprich <mruprich> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Martin Zelený <mzeleny> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.2 | CC: | jorton, mruprich, mvermaes, mzeleny |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | rsync-3.1.2-4.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | 827429 | Environment: | |
Last Closed: | 2017-11-20 18:06:17 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Jaroslav Aster
2015-06-29 10:23:32 UTC
I was playing around with sparse files for a while and rsync IS able to copy them. The problem is that it basically takes the same time as it would take with a normal file with the same size. Even the test mentioned at the end of comment #1 works but you have to increase the watchdog time to much higher number. So from all this it seems that the --sparse option actually doesn't bring any improvement over normal mode. But the problem is that the sparse mode in rsync might not be understood well. The performance on the sender is horrible because rsync actually reads the whole file, even the empty part. The optimization happens on the receiver where the blocks of zero are not all stored in the memory thus relieving the receiver a bit. For example cp or tar have some optimization for sparse file AFAIK - what it does is that the file is analysed very quickly and the zero blocks are not copied. This is something that rsync cannot do yet and it seems that the upstream doesn't plan to do something with this in near future. There is however a workaround that might help you improve the performance: 1. Create a sparse file on the receiver with the same name as the file that you want to sync. OR Use the --sparse option for the first transfer and simply wait. The option works but isn't any faster than normal mode. 2. Next time use the --inplace option instead of --sparse. This will activate the delta mode which transfers only changed blocks. This could help you improve the performance. 3. Always use the -z when transferring sparse file. It will not speed up the process on the sender but you will save a considerable amount of bandwidth since the -z compresses the data during transfer and blocks of zeros are compressed very efficiently. Just an addition to comment #6: I tried to capture the traffic between two systems with tcpdump when transferring files with rsync and when transferring sparse file that existed on the receiver with --inplace and -z, the amount of data that went through the network was basically zero. But as I said rsync still needs to read the whole sparse file... Fixed in rsync-3.1.2-4 on rhel-7.5 |