Sane Default Snapshot Strategies for Various Workloads: Is there a list of these of a guide somewhere?

I know we’ve talked in various threads here about what counts as a sane place to start for setting up ZFS snapshot schedules for various specific workloads workloads (like Time Machine), but overall it feels like one of those semi-overwhelming things that’s going to take experience to get right–and attempting to learn to get it right as you go might end up resulting in data loss.

We already have a great set of recommendations for sane defaults on recordsize and volblocksize, and they really help me feel confident just doing things with my NAS.

But I’ve been hesitant to set up snapshots or even start some projects that I want to use snapshots with because I feel like I don’t know what I’m doing and don’t want to waste CPU cycles and storage space (and increase power/heat) on my NAS by taking too many or retaining them too long.

For me, at least, it feels like there’s at least a few different categories of snapshot that would need their own strategy (scheduling and retention):

  1. Datasets used to back up production workstations, (e.g., office work, software development, etc.–the things we use to make money), including user data and system configurations that need to be restored in the event of a problem. EDIT: Tools I’m planning to test/use:
    1. Restic
    2. Proxmox Backup Server
    3. Carbon Copy Cloner and SuperDuper (Mac backup utilities)
    4. Rsync/rclone
  2. Self-hosted internal services data, including configurations. I feel like this snapshot strategy would be a bit more aggressive in frequency and maybe somewhat less aggressive in retention, as the data would change more, faster, and keeping older snapshots might not be as useful.
  3. Externally-exposed services data, (e.g., websites, Minecraft servers, etc.). Similar to (2), but I’m thinking you’d want to be a bit more aggressive on frequency and retention because something exposed to the outside world is more likely to get smoked.
  4. Media and other large file read-only datasets (e.g., vintage game ROMs, your family’s precious videos and photos, etc.). As long as you’ve got an up-to-date, snapshot index of your legally obtained archives, I don’t think it makes much sense to go aggro on snapshotting data that rarely changes. The metadata would change quite a bit over time, and I’d want to try to preserve that, but I’m not going to be that upset if something happens to the last 24 hours of progress I made in my 40th play through of Super Metroid.
  5. A/V production. This is not an area I do much of anything in, but I put it on the list because I suspect that the snapshot strategy needs of someone doing real work on large, changing files is going to be different than any of the above.

I do thirty hourlies, thirty dailies, and three monthlies on every workload by default. The strategy only gets adjusted in the face of a specific need otherwise (like a workload that is ephemeral with a lot of churn).

I encounter one of those specialty workloads that needs a different strategy maybe once every couple of years. 30/30/3 works 99+% of the time.

Thanks!

Do you find that this schedule takes up a lot of space (like, a considerable percentage of the size of the source), or is the reality that most of the time most files change relatively infrequently so incremental snapshots don’t take up that much space?

EDIT:

I’ve also realized that, at least in TrueNAS, I have to create three snapshot tasks to cover a 30/30/3 schedule. That seems like it could get overwhelming to maintain pretty quickly, so I’ve decided to go with a strategy of recursively snapshotting the top level datasets underneath the pool root.

For child datasets that need a different schedule, I’m assuming I can override the schedule for those children somehow. I hope. I’ll figure that out later. Or maybe regret this later. :stuck_out_tongue:

I’m trying this first with my backup dataset (Uniservo1):

So, all my snapshots will look like this (Take Empty Snapshots, Recursive, Enabled), with the main difference being the schedules:

As far as excluding certain child datasets, one thing I’m thinking of is, again, Time Machine. I want to use ZFS snapshots to be able to roll back a corrupted Time Machine backup. Time Machine fires off every hour, and potentially takes a good amount of time to complete. (I haven’t fully tested it with this setup yet.) I wonder if I need to use a separate snapshot schedule for Time Machine to avoid snapshotting Time Machine in inconsistent states? Or is ZFS smart enough to avoid that?

This seems too easy? I feel like I must be forgetting something.

EDIT 2: As far as snapshot size, snapshots are at the block level, focused on changed blocks, so I’m also now curious about the implications of using recordsize=1M. I assume that things like filenames and metadata are stored using small enough block sizes even in that case that it doesn’t make the snapshots bloat, but I’m not exactly sure how that works.

Which “blocks” is ZFS’ snapshot function looking at?

Very active working datasets, eg Windows Server virtual machines which host primary network shared drives in an engineering firm, typically should budget about 30-35% extra storage for the described 30/30/3 policy.

But there’s no way for me to tell you how much you change your own data in proportion to how much of it you have. If you’re not filtering out ephemeral nonsense in any way, the junk a typical operating system produces is enough to keep it within that 30-35% overhead range, usually. Which, it’s interesting and worth knowing, matches that same 30-35% typical range for the working set of their actual data.

This is a long winded way of me saying “probably about 30-35%, and you can probably figure it out for yourself if you’re likely to have a different value, but there’s no way for me to figure that out for you.” :beer_mug::cowboy_hat_face::+1:

That makes sense. I know this is one of those things that I have to test in production to get a real picture of how my NAS is going to behave. I was trying to set a reasonable baseline in my head, which seems to be “probably about 30-35%.” :wink:

If I start to run into space constraints later, I can always be a bit less aggressive with the snapshots, I suppose.

I will admit that when I started all this before the Rise of the Robots and set up my 8 bay NAS as 4x mirror vdevs (8x14 TB, ~56 TB raw capacity), I was making the assumption that I could relatively easily expand to bigger used enterprise SATA disks later.

And then … AIpocalypse. Damn.