[plug] rsync and nfs

Cameron Patrick cameron at patrick.wattle.id.au
Sat Oct 19 13:12:19 WST 2002


G'day,

On Sat, 19 Oct 2002 12:26:20 +0800, Bernard Blackham wrote:

| I'm using rsync to make backups of my machine to an area on another
| machine mounted over nfs as such:
| 
| 	mount /backups
| 	rsync -avx --delete / /backups/machine/
| 
| And the thought just dawned on me - am I actually gaining anything
| by using rsync? The comparison is still done over the network
| (100Mbit, so its not so bad), ie, each file is read over the
| network, and then written if it's different. This seems more
| inefficient than just blatting over the top with "cp -ax /
| /backups/machine".
| 
| It appears to be somewhat faster though, or am I just hallucinating?

You may well be hallucinating, but it wouldn't surprising me if rsync was
faster than CP. I believe that rsync may just compare size/mtime/etc of the
files, without sucking each file in over the network.

| When running it over ssh using -c blowfish, the server repeatedly
| kills it's rsync process because it was hogging too much memory
| (only has 32MB+80MB swap), so I just stuck to NFS. 

Weird... I use rsync with ssh (and blowfish in some ssh config file 'cos
that way it goes fast) on a setup which is remarkably similar to yours and
it works perfectly, backing up ~2gb in a few minutes. When I ran it just
now with "watch free" going on an ssh job, it peaked at ~ 22mb ram + 37mb
swap used, and returned to 11mb ram + 22mb swap after rsync had finished.
That means that rsync used 26mb.  According to 'find | wc -l' there were
61660 files being backed up in this instance. <bofh>Your gateway machine
has (*clicky clicky clicky*), erm, 58mb of swap free at the moment</bofh>,
so unless you're backing up a /lot/ of files, running out of memory sounds
a little weird. You could always swapon a Big Swap File and see if that
helps...

If you're backing up your whole machine at once, you could perhaps split it
into several jobs, each of which would need slightly less memory than one
monster-rsync. If this actually helps, it raises the question of why rsync
isn't clever enough to do this of its own accord, though.

FWIW, here's the gist of my nightly backup cron job:
	cd /home/cameron
	rsync --delete -Rave ssh misc projects Mail euclid:
	rsync --delete -Rave ssh euclid:web .

Cheers,

CP.



More information about the plug mailing list