btrbk icon indicating copy to clipboard operation
btrbk copied to clipboard

FAQ: Number of snapshots vs disk performance

Open danboid opened this issue 2 years ago • 3 comments

I've read the btrbk FAQ but it didn't answer my only question. How many snapshots of a subvolume does BTRFS let the user create before disk performance begins to suffer?

Last time I looked into this, online sources were telling me to avoid creating more than 20 or so snapshots per subvolume to avoid degraded performance. Is that no longer the case?

Has anyone done some decent research / tests regarding this using a recent kernel?

danboid avatar Jul 26 '22 23:07 danboid

That info is also missing from here:

https://btrfs.wiki.kernel.org/index.php/SysadminGuide#Subvolumes

Which would seem like the place most likely to tell me this apart from the btrbk FAQ.

danboid avatar Jul 27 '22 00:07 danboid

I think the correct answer is "it depends", and that's probably why you can't find reliable information on this.

What I can say is that my backup servers contain thousand-ish subvolumes, causing a couple of seconds mount time on a slow embedded device (>3000 subvolumes currently, not going to reboot it just to check right now ;-).

From my experience I would say:

  • 100 subvolumes: no noticeable performance drop
  • 1000 subvolumes: slight performance drop
  • 10000 subvolumes: unknown, probably ok on a backup server, maybe not ok on a production server

digint avatar Jul 28 '22 13:07 digint

Thanks for the useful feedback @digint !

I've heard ZFS performance starts to suffer around the 10000 snapshots mark. I've also heard bcachefs can handle millions of snapshots without any problems, which will be cool if true. I've not tried bcachefs yet.

danboid avatar Jul 28 '22 13:07 danboid