On Tue, Oct 21, 2014 at 06:10:27PM -0700, Robert White wrote: > That's an unmanageably large and probably pointless number of > snapshots guys. > > I mean 150 is a heck of a lot, and 5000 is almost unfathomable in > terms of possible usefulness. > > Snapshots are cheap but they aren't free. This could be better documented. Most of the documentation about btrfs snapshots frankly just says how to make them and how awesome they are. In small-scale tests they seem cheap--a little more expensive than mkdir--but on larger scales they can become nightmares. Things I learned the hard way about ~200 snapshots on a half-TB filesystem: btrfs balance cancel/pause take a long time. Like 24+ hours. Not the entire balance operation--just one block group. Reboot and mount with skip_balance is a crude but effective way out. Making new snapshots is cheap. Deleting them is not. btrfs-cleaner will systematically disassemble each snapshot, sequentially, one extent (or some similarly tiny fragment) at a time, for more than a week. fsync() will take several seconds on that filesystem for the entire time btrfs-cleaner is running. There is no way to pause or stop the btrfs-cleaner kernel thread and as far as I can tell it's more or less immune to attempts to limit the amount of I/O bandwidth it demands with cgroup blkio.weight or ionice. Rebooting won't even stop it--it will just resume the next time the filesystem is mounted. mkfs and restore the filesystem from a backup of the original subvolume--it's an order of magnitude faster even with rsync. 2 or 3 are good numbers for snapshots. 0 or 1 are even better.
Attachment:
signature.asc
Description: Digital signature
