Trond Endrestøl
2013-Dec-06 12:46 UTC
Does FreeBSD's ZFS reserve 1/64 of the capacity for COW?
Hi, Today I came across "Becoming a ZFS Ninja Part 1" http://www.youtube.com/watch?v=tPsV_8k-aVU featuring Ben Rockwood who stated that ZFS reserves 1/64 of the capacity for COW safe-guarding. Fast forward to 00:49:44. Thus, one should take this fact into account when planning the storage capacity of your (larger) zpools. Does FreeBSD's ZFS also reserve 1/64 of the capacity for COW? If it's true, then I guess this should be noted in zpool(8) and in the Handbook. Any comments or insights? Do you think I should file a PR? Have a nice weekend! ;-) -- +-------------------------------+------------------------------------+ | Vennlig hilsen, | Best regards, | | Trond Endrest?l, | Trond Endrest?l, | | IT-ansvarlig, | System administrator, | | Fagskolen Innlandet, | Gj?vik Technical College, Norway, | | tlf. mob. 952 62 567, | Cellular...: +47 952 62 567, | | sentralbord 61 14 54 00. | Switchboard: +47 61 14 54 00. | +-------------------------------+------------------------------------+
Freddie Cash
2013-Dec-06 16:47 UTC
Does FreeBSD's ZFS reserve 1/64 of the capacity for COW?
On Fri, Dec 6, 2013 at 4:46 AM, Trond Endrest?l < Trond.Endrestol at fagskolen.gjovik.no> wrote:> Hi, > > Today I came across "Becoming a ZFS Ninja Part 1" > http://www.youtube.com/watch?v=tPsV_8k-aVU featuring Ben Rockwood who > stated that ZFS reserves 1/64 of the capacity for COW safe-guarding. > Fast forward to 00:49:44. Thus, one should take this fact into account > when planning the storage capacity of your (larger) zpools. > > Does FreeBSD's ZFS also reserve 1/64 of the capacity for COW? > > If it's true, then I guess this should be noted in zpool(8) and in the > Handbook. > > Any comments or insights? > Do you think I should file a PR? > > Have a nice weekend! ;-) >Based on the experience I went through a week or so ago, I would have to say, no. (Unless this is an unrelated issue.) I filled a 75 TB pool 100% full, 0 bytes left. Was unable to delete files, was unable to "cp /dev/null" files, was unable to truncate files.?? Mostly due to snapshots and "deleting" a file actually marks the blocks as part of the previous snapshot and updates a bunch of metadata. And, was unable to destroy any snapshots as there was 0 space to write out metadata. Thankfully, I had 1 ZFS filesystem without any snapshots, and I was able to successfully delete files from that dataset. Once a few MB of free space was made available, then I was able to start deleting snapshots ?I now have a dataset on each ZFS pool called "do-not-delete" with a 1 GB reservation (and no snapshots). This way, if the pool ever gets filled to 100% (and it did a few days later), it's a simple matter to "create" free space: # zfs set reservation=512M storage/do-not-delete ? Then delete some snapshots, and set the reservation back to 1 GB. I've now hit the 100% full issue 3 times. Twice, the do-not-delete reservation saved me. -- Freddie Cash fjwcash at gmail.com
Mark Felder
2013-Dec-06 17:23 UTC
Does FreeBSD's ZFS reserve 1/64 of the capacity for COW?
On Fri, Dec 6, 2013, at 6:46, Trond Endrest?l wrote:> Hi, > > Today I came across "Becoming a ZFS Ninja Part 1" > http://www.youtube.com/watch?v=tPsV_8k-aVU featuring Ben Rockwood who > stated that ZFS reserves 1/64 of the capacity for COW safe-guarding. > Fast forward to 00:49:44. Thus, one should take this fact into account > when planning the storage capacity of your (larger) zpools. > > Does FreeBSD's ZFS also reserve 1/64 of the capacity for COW? > > If it's true, then I guess this should be noted in zpool(8) and in the > Handbook. >Well, the rule-of-thumb / urban legend tends to be "don't let your zpool go over ~80% or you'll have severe performance issues" so I'm not sure that statement is accurate or COW wouldn't be so painful when your pool is over ~80%. I could be wrong though; I often am :-)
I wouldnt really worry about it as you shouldnt be planning to go over 80% capacity on a production pool anyhow, as at some point after that, and way before 100% you will start to get big slowdown on writes, which is more of an issue. On 6 December 2013 12:46, Trond Endrest?l < Trond.Endrestol at fagskolen.gjovik.no> wrote:> Hi, > > Today I came across "Becoming a ZFS Ninja Part 1" > http://www.youtube.com/watch?v=tPsV_8k-aVU featuring Ben Rockwood who > stated that ZFS reserves 1/64 of the capacity for COW safe-guarding. > Fast forward to 00:49:44. Thus, one should take this fact into account > when planning the storage capacity of your (larger) zpools. > > Does FreeBSD's ZFS also reserve 1/64 of the capacity for COW? > > If it's true, then I guess this should be noted in zpool(8) and in the > Handbook. > > Any comments or insights? > Do you think I should file a PR? > > Have a nice weekend! ;-) > > -- > +-------------------------------+------------------------------------+ > | Vennlig hilsen, | Best regards, | > | Trond Endrest?l, | Trond Endrest?l, | > | IT-ansvarlig, | System administrator, | > | Fagskolen Innlandet, | Gj?vik Technical College, Norway, | > | tlf. mob. 952 62 567, | Cellular...: +47 952 62 567, | > | sentralbord 61 14 54 00. | Switchboard: +47 61 14 54 00. | > +-------------------------------+------------------------------------+ > _______________________________________________ > freebsd-stable at freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe at freebsd.org" >