On Sun, 7 Jun 2015 13:46:28 +0100
Post by Patrick O'CallaghanI have a feeling this has been covered before, but whats the working
hypothesis for the x10 decrease in speeds mentioned (assuming this is
NFSv4)? I tested with NFSv4 and got the roughly the same on the
initial sync. With no files changed NFS is slower, but it was still
under 1 second for 1000 files. Using SSHFS in my test load I got x7
slower with synchronous R/W. With no changes its roughly the same as
rsnapshot.
The speed difference is from direct measurement from the two versions
on my setup ("client" and "server" refer to the the functional
components of the backup system, i.e. the machine being backed up and
the machine where the backup set is stored, not the
Version 1: rsnapshot running on the client, with the backup set being
accessed via NFS mount(s) from the server. There is only one rsync
process, running on the client. From the point of view of this
process, it's comparing two local files at a time. Recall how rsync
works: candidate files are compared by various criteria including
block-by-block to minimize the amount of physical copying. However in
this scenario the blocks are being compared *on the client machine*,
i.e. each file is transferred via NFS protocols to the client,
comparison is run, then any differing blocks are written back to the
new backup copy. Clearly in this case rsync is not reducing the amount
of traffic relative to a direct remote copy (in fact it's often moving
more data across the network in this case).
Version 2: rsnapshot runs on the server, connecting via an SSH tunnel
to an rsync process on the client. Each end of the connection
generates its own block checksums *locally* and only differing blocks
are copied across. This is how rsync is designed to work, and it does
it very efficiently.
poc
------------------------------------------------------------------------------
The way I see the problem, is that the variability of client access
poses issues with the basic way rsnapshot wants to operate.
One method that Tapani put forward keeps the solution entirely in the
domain of rsnapshot by creatively manipulating timing and basically
'over-subscribing', understanding and accepting that there will be a lot
of failures. This keeps all configuration centralized on the backup
server, and thus is easier to manage for a sysadmin. With the only tool
at your disposal being rsnapshot itself, this seems like it is a very
good solution.
Another method I can think of expands the toolbox somewhat using bash
and ssh. This method has the benefit of running backups based on client
availability, rather than the server continuously trying to backup
ghosts and erroring out. e.g. it's more efficient and less noisy.
Here's how it would work:
Each client would have a script execute using the @reboot cron
directive. This script would test for the availability of the backup
server using ping to it's local LAN address. Not available? exit (or
keep testing for some period of time before exiting, to allow network
to come up). Available? scp a flag file named for the hostname of the
client to a specific directory on the server. This file could be empty
or it may contain data like IP address of the client. All of the data
about the file (name, IP) are variables. The same exact script is on all
clients. The client could also have a icon on their desktop to manually
run the script if they want to force a backup as well.
Once a minute, the server would scan this directory for files using a
simple bash wrapper to rsnapshot. If a file is found, the server would
read then delete the file(s), and initiate a backup to the client(s),
using the data present in the file(s) and filename(s) to uniquely
generate the unique portions of the rsnapshot.conf file(s) on the fly.
This can be made completely self administering if desired. In other
words, a new client that has never been backed up can just work because
it has a unique hostname, the client script is present on the host,
and it's key is on the server, and the server's key is on it. All
things easily automated as well.
Then, I would use apache to allow remote access to each user's data
securely to self-serve restores as required. Again, with an icon
already setup on their desktops.
Anyway, that's how I would approach this issue.
--
Regards,
Christopher Barry
Random geeky fortune:
Slous' Contention:
If you do a job too well, you'll get stuck with it.
------------------------------------------------------------------------------