Today I was using rsync over a slow internet connection to transfer a video file - uncompressed avi, 60 seconds duration, 360MB in size. Basically it contained 1500 frames of the same image, hence it was highly compressible.
Top upload speed on my internet connection is 130KB/s. I ran rsync like this:
rsync -avhz --progress --partial myfile.avi remote:/path/
The transfer speed varied from 400KB/s to 1,5MB/s. I accidentially
Ctrl+C'd the running rsync after the file was about halfway transferred. But no worries, I used
--partial switch, so I just restarted rsync with the same parameters as before. Only that now the transfer speed was 80MB/s!
I tried this again, and again and again. Even without the
-z switch, the result was the same. On the first run, the transfer speed was a shy 1,5MB/s, but after interrupting rsync after a while and restarting it, the rest of the file was transferred almost instantaneously. The
md5sum matched on both ends.
My question is: can anyone explain this behaviour to me? Am I missing something obvious here? I would expect that file would be transferred much faster already with
-z switch on the first go, but I wouldn't expect it to speed up so drastically without even using
-z after resuming the transfer.