[bknr-devel] BKNR.datastore snapshot frequency and old snapshots

Hans Hübner hans.huebner at gmail.com
Fri Dec 30 18:22:21 UTC 2011


Hi Vladimir,

On Tue, Dec 27, 2011 at 11:04 PM, Vladimir Sedach <vsedach at gmail.com> wrote:
> How often should a BKNR datastore be snapshot? I tried daily, but that
> is clearly too much.

In my deployed application, I snapshot once per day.  This has not
bothered me beyond the disk space usage, but eventually I came up with
a cron job to automatically purge old snapshots.

> Is there a criteria (# of transaction since last
> snapshot) that can be used to determine this programmatically?

The store itself has no mechanisms regarding that.  I have pondered
over various ideas how one could schedule snapshots in a more
intelligent fashion - One was to measure and accumulate transaction
execution time and snapshot whenever the execution time would exceed
some threshold.  Nothing like that ever went into code, though, as the
nightly scheme never caused any problems for me.  After all, even with
my largest application that has some 700k objects, a restart only
takes a minute or two, and happens only every few months when I need
to do some maintenance.

> Related to this, are snapshots linked to each other? Are old ones
> unneeded? Is it ok to delete them if they are?

They are completely independent and can be deleted at will.  Only the
current/ and blob-root/ directories are needed.  Blobs are not
automatically garbage collected, though, as they could be referenced
in older snapshots and the store has no information regarding such
references.  The function bknr.datastore::delete-orphaned-blob-files
can be used to remove all blob files that are not currently referenced
from the store.

Let me know if you need further information.

Cheers,
Hans




More information about the Bknr-devel mailing list