On Mon, Dec 1, 2014 at 3:12 PM, Roman Bysh email@example.com wrote:
I really wanted to like btrfs. IMHO Snapper is silently taking way too many snapshots. I think that a snapshot message should pop up letting the user know. Otherwise I have to go in and delete a lot of the snapshots.
I think snapper is pretty efficient and only files like database files of VM backend storage consumes drastically more space if there are lots of snapshots.
As a simple example, assume I have a collection of 3 1 GB files and I delete 1 of them each day for 3 days. Further I assume I make a nightly snapshot.
Day 1: Snapshot 1 created - currentlyempty File 1 deleted - behind the scenes it is moved to snapshot 1
Day 2 Snapshot 2 created - currently empty - Snapshot 1 is effectively frozen File 2 deleted - behind the scenes it is moved to snapshot 2
Day 3 Snapshot 3 created - currently empty - Snapshot 2 is effectively frozen File 3 deleted - behind the scenes it is moved to snapshot 3
So at the end of the day, I have 3 snapshots, each 1GB in size.
If you delete snapshot 2, then its contents are merged with snapshot 1, so now snapshot 1 is 2GB and snapshot 3 is 1GB.
Thus for static file creation / deletion scenarios, btrfs is very efficient and you don't really recover any disk space until you delete the oldest snapshot.
Where btrfs falls down with lots of snapshots is when you have a file like a database where the same data blocks routinely have different content.
Then each of the snapshots has to maintain the content of the data blocks redundantly.
ie. dnapshot 1 has the contents of the changing data blocks as of the morning of Day 1, Snapshot 2 has the day 2 content, etc.
I believe therefore that it is recommended to disable COW snapshot functionality on database files.
The same logic applies to VM virtual disks, so there too it is recommended to disable COW functionality.
Thus if you are following the guidelines to disable COW on problematic files, then there is very little penalty associated with having lots of snapshots.
Greg -- Greg Freemyer