View Single Post
Community Council | Posts: 4,920 | Thanked: 12,867 times | Joined on May 2012 @ Southerrn Finland
#11
Originally Posted by knobtviker View Post
Just a question:
When you update an existing file, do you upload/download a whole file or just the part of the file that changed?
Well, that's up to the implementation of rsync on the platform.

As far as I know (and now checking from wikipedia confirms this) the linux rsync divides all files into fixed size blocks and only transmits the differing blocks based on checksumming algorithm. (source: http://en.wikipedia.org/wiki/Rsync, see the section "Determining which parts of a file have changed")

A short test of my own; I transferred a binary file of about 9MB with cloudsync.sh, then hexedited it so that I changed just one byte somewhere about middle of the file, and resent it.

Code:
Apr 29 08:25:50 (2013) cloudsync: Triggered upload from filesystem
Apr 29 08:25:50 (2013) cloudsync: Using WLAN connection to server
Apr 29 08:26:02 (2013) cloudsync: sending incremental file list ./ rsync-muutostesti  sent 9176267 bytes  received 34 bytes  734104.08 bytes/sec total size is 9175040  speedup is 1.00
Apr 29 08:26:02 (2013) cloudsync: Upload tranfer succeeded
Apr 29 08:26:54 (2013) cloudsync: Triggered upload from filesystem
Apr 29 08:26:54 (2013) cloudsync: Using WLAN connection to server
Apr 29 08:27:01 (2013) cloudsync: sending incremental file list ./ rsync-muutostesti  sent 15267 bytes  received 18244 bytes  5155.54 bytes/sec total size is 9175040  speedup is 273.79
Apr 29 08:27:01 (2013) cloudsync: Upload tranfer succeeded
From this simple test you can see that on the second serving, only 15kB needed to be sent to transfer the changes to the file. (and most of this is transferring the MD5 hashes of the file blocks I guess, plus the changed block when it is detected...)

The "speedup is 273.79" means that the filesize/(sent_bytes+received_bytes) = 273.79, so only 2.7% of the total file size needed to be sent on the second round.

Last edited by juiceme; 2013-04-29 at 05:44. Reason: Added some info
 

The Following 7 Users Say Thank You to juiceme For This Useful Post: