Live data from Hacker News

OpenZFS deduplication is good now and you shouldn't use it

despairlabs.com

181–190 of 250 posts

Re: OpenZFS deduplication is good now and you shouldn't use it

#181
So if a sweet spot exists where dedup is widely beneficial then:

Is there an easy way to analyze your dataset to find if you're in this sweet spot?

If so, is anyone working on some kind of automated partial dedup system where only portions of the filesystem are dedupped based on analysis of how beneficial it would be?

Re: OpenZFS deduplication is good now and you shouldn't use it

#182

Earlier quoted context omitted.

Lazy/off-line dedup requires block pointer rewrite, but ZFS _cannot_ and will not ever get true BP rewrite because ZFS is not truly a CAS system. The problem is that physical locations are hashed into the Merkle hash tree, and that makes moving physical locations prohibitively expensive as you have to rewrite all the interior nodes on the way to the nodes you want to rewrite. A better design would have been to split…

> CAS system It looks like it means: https://en.wikipedia.org/wiki/Content-addressable_storage

Sorry, yes, CAS really means that pointers are hash values -- maybe with extra metadata, yes, but _not_ including physical locations. The point is that you need some other way to map logical pointers to physical locations. The easiest way to do that is to store the mappings nearby to the references so that they are easy to find, but the mappings must be left out of the Merkle hash tree in order to make it possible to change the physical locations of the referenced blocks.

Re: OpenZFS deduplication is good now and you shouldn't use it

#183
post #150
post #20

I clicked because of the bait-y title, but ended up reading pretty much the whole post, even though I have no reason to be interested in ZFS. (I skipped most of the stuff about logs...) Everything was explained clearly, I enjoyed the writing style, and the mobile CSS theme was particularly pleasing to my eyes. (It appears to be Pixyll theme with text set to the all-important #000, although I shouldn't derail this dis…

That being: > As we’ve seen from the last 7000+ words, the overheads are not trivial. Even with all these changes, you still need to have a lot of deduplicated blocks to offset the weight of all the unique entries in your dedup table. [...] what might surprise you is how rare it is to find blocks eligible for deduplication are on most general purpose workloads. > But the real reason you probably don’t want dedup thes…

[deleted]

Re: OpenZFS deduplication is good now and you shouldn't use it

#184

So if a sweet spot exists where dedup is widely beneficial then: Is there an easy way to analyze your dataset to find if you're in this sweet spot? If so, is anyone working on some kind of automated partial dedup system where only portions of the filesystem are dedupped based on analysis of how beneficial it would be?

I can't speak to the first one, but AIUI the ZFS way of thinking about the second one is to create a new filesystem and just mount it where you want it, versus "portions of the filesystem" which I doubt very seriously that ZFS allows. Bonus points that in that scenario, I would suspect the dedupe and compression would work even better since any such setup is likely to contain more homogeneous content (music, photos, etc)

Re: OpenZFS deduplication is good now and you shouldn't use it

#185

Earlier quoted context omitted.

I've read multiple comments on using dedup for VMs here. Wouldn't it be a lot more efficient for this to be implemented by the hypervisor rather than the filesystem?

I'm a former VMware certified admin. How do you envision this to work? All the data written to the VM's virtual disk will cause blocks to change and the storage array is the best place to keep track of that.

You do it at the file system layer. Clone the template which creates only metadata referencing the original blocks then you perform copy-on-write as needed.

Re: OpenZFS deduplication is good now and you shouldn't use it

#186

Earlier quoted context omitted.

No, pointing to an original is how soft links work. Hard links are all equivalent. A file has any number of hard links, and at least in theory you can't distinguish between them. The risk with hardlinks is that you might alter the file. Reflinks remove that risk, and also perform very well.

Thank you, I was unaware of this. However, the fact that editing one copy edits all of them still makes this a non-solution for me at least. I'd also strongly prefer deduping at the block level vs file level.

I would suspect a call to $(chmod a-w) would fix that, or at least serve as a very fine reminder that there's something special about them

Re: OpenZFS deduplication is good now and you shouldn't use it

#187
post #20

I clicked because of the bait-y title, but ended up reading pretty much the whole post, even though I have no reason to be interested in ZFS. (I skipped most of the stuff about logs...) Everything was explained clearly, I enjoyed the writing style, and the mobile CSS theme was particularly pleasing to my eyes. (It appears to be Pixyll theme with text set to the all-important #000, although I shouldn't derail this dis…

[deleted]

Re: OpenZFS deduplication is good now and you shouldn't use it

#188

Earlier quoted context omitted.

I'm a former VMware certified admin. How do you envision this to work? All the data written to the VM's virtual disk will cause blocks to change and the storage array is the best place to keep track of that.

You do it at the file system layer. Clone the template which creates only metadata referencing the original blocks then you perform copy-on-write as needed.

But that is exactly what the storage array is doing. What is the advantage?

Re: OpenZFS deduplication is good now and you shouldn't use it

#189

Earlier quoted context omitted.

I'm a former VMware certified admin. How do you envision this to work? All the data written to the VM's virtual disk will cause blocks to change and the storage array is the best place to keep track of that.

You do it at the file system layer. Clone the template which creates only metadata referencing the original blocks then you perform copy-on-write as needed.

VMware allows linked clones which you can do when deploying from template

https://docs.vmware.com/en/VMware-Fusion/13/com.vmware.fusio...

Re: OpenZFS deduplication is good now and you shouldn't use it

#190

Earlier quoted context omitted.

Can relate. I’ve recently taken ownership of a new work laptop with Ubuntu (with “experimental” zfs) and using dedupe on my nix store has been an absolute blessing!

Isn't it better to use `nix store optimise` for dedup of the nix store? The nix command has more knowledge of the structure of the nix store so should be able to do a better job with fewer resources. Also the store is immutable so you don't actually need reflinks - hard links are enough.

It is, yeah, though you have to turn it on. I'm not actually sure why it's off by default.
Post reply on HN