SHA question
David Precious
davidp at preshweb.co.uk
Sat Jan 16 16:23:03 GMT 2010
Andy Wardley wrote:
> On 14/01/2010 17:41, Philip Newton wrote:
>> Yes - you're missing the fact that in order to compute the differences
>> (which it has to if it doesn't want to transfer the whole file), it
>> has to read the entire file over the slow NFS link into your
>> computer's memory in order to compare it with the "local" file in
>> order to tell which pieces have changed.
>
> No, I don't think it does.
>
> My understanding[*] is that it computes a checksum for each block of a file
> and only transmits blocks that have different checksums.
Of course, but to compute a checksum for each block of the file, that
block first needs to be read, over the NFS connection, which is the
whole issue.
Normally, rsync would be speaking to rsync running on the remote box,
but the situation David described was one rsync process on box A,
accessing files on box B via an NFS mount (as opposed to speaking to an
rsync daemon on box B).
I'm not entirely sure, but I think that rsync will first compare the
timestamps of the the two files, and if the timestamps match (to within
the window specified with --modify-window, defaulting to an exact
match), and the sizes match, it will consider the file to be the same,
and skip generating checksums (so the file's data won't be read over NFS).
More information about the london.pm
mailing list