Live data from Hacker News

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

despairlabs.com

121–130 of 250 posts

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

#121

I've used ZFS dedupe for a personal archive since dedupe was first introduced. Currently, it seems to be reducing on-disk footprint by a factor of 3. When I first started this project, 2TB hard drives were the largest available. My current setup uses slow 2.5-inch hard drives; I attempt to improve things somewhat via NVMe-based Optane drives for cache. Every few years, I try to do a better job of things but at this p…

Cache or ZIL (SLOG device)?

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

#122
post #103

Earlier quoted context omitted.

You don't need it to dedup writable files. But redundant copies in snapshots are stuck there as far as I'm aware. So if you search for duplicates every once in a while, you're not going to reap the space savings until your snapshots fully rotate.

The issue with this, in my experience, is that at some point that pro (exactly, and literally, only one copy of a specific bit of data despite many apparent copies) can become a con if there is some data corruption somewhere. Sometimes it can be a similar issue in some edge cases performance wise, but usually caching can address those problems. Efficiency being the enemy of reliability, sometimes.

Redundant copies on a single volume are a waste of resources. Spend less on size, spend more on an extra parity drive, or another backup of your most important files. That way you get more safety per gigabyte.

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

#123
post #103

Earlier quoted context omitted.

The issue with this, in my experience, is that at some point that pro (exactly, and literally, only one copy of a specific bit of data despite many apparent copies) can become a con if there is some data corruption somewhere. Sometimes it can be a similar issue in some edge cases performance wise, but usually caching can address those problems. Efficiency being the enemy of reliability, sometimes.

Redundant copies on a single volume are a waste of resources. Spend less on size, spend more on an extra parity drive, or another backup of your most important files. That way you get more safety per gigabyte.

Notably, having to duplicate all data x2 (or more) is more of a waste than having 2 copies of a few files - if full drive failure is not the expected failure mode, and not all files should be protected this heavily.

It’s why metadata gets duplicated in ZFS the way it does on all volumes.

Having seen this play out a bunch of times, it isn’t an uncommon need either.

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

#124

"And this is the fundamental issue with traditional dedup: these overheads are so outrageous that you are unlikely to ever get them back except on rare and specific workloads." This struck me as a very odd claim. I've worked with Pure and Dell/EMC arrays and for VMWare workloads they normally got at least 3:1 dedupe/compression savings. Only storing one copy of the base VM image works extremely well. Dedupe/compressi…

Certainly it makes sense to not have deep copies of VM base images, but the deduplication is not the right way to do it in ZFS. Instead, you can clone the base image and before changes it will take almost no space at all. This is thanks to the copy-on-write nature of ZFS.

ZFS deduplication instead tries to find existing copies of data that is being written to the volume. For some use cases it could make a lot of sense (container image storage maybe?), but it's very inefficient if you already know some datasets to be clones of the others, at least initially.

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

#125
post #123

Earlier quoted context omitted.

Redundant copies on a single volume are a waste of resources. Spend less on size, spend more on an extra parity drive, or another backup of your most important files. That way you get more safety per gigabyte.

Notably, having to duplicate all data x2 (or more) is more of a waste than having 2 copies of a few files - if full drive failure is not the expected failure mode, and not all files should be protected this heavily. It’s why metadata gets duplicated in ZFS the way it does on all volumes. Having seen this play out a bunch of times, it isn’t an uncommon need either.

> having to duplicate all data x2

Well I didn't suggest that. I said important files only for the extra backup, and I was talking about reallocating resources not getting new ones.

The simplest version is the scenario where turning on dedup means you need one less drive of space. Convert that drive to parity and you'll be better off. Split that drive from the pool and use it to backup the most important files and you'll be better off.

If you can't save much space with dedup then don't bother.

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

#126

"And this is the fundamental issue with traditional dedup: these overheads are so outrageous that you are unlikely to ever get them back except on rare and specific workloads." This struck me as a very odd claim. I've worked with Pure and Dell/EMC arrays and for VMWare workloads they normally got at least 3:1 dedupe/compression savings. Only storing one copy of the base VM image works extremely well. Dedupe/compressi…

For text based logs I'm almost entirely sure that just using compression is more than enough. ZFS supports compression natively on block level and it's almost always turned on. Trying to use dedup alongside of compression for syslog most likely will not yield any benefits.

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

#127
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…

It scrolls horizontally :(

It's because of this element in one of the final sections [1]:

    kstat.zfs..misc.ddt_stats_
Typesetting code on a narrow screen is tricky!

[1] https://despairlabs.com/blog/posts/2024-10-27-openzfs-dedup-...

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

#128
post #123

Earlier quoted context omitted.

Notably, having to duplicate all data x2 (or more) is more of a waste than having 2 copies of a few files - if full drive failure is not the expected failure mode, and not all files should be protected this heavily. It’s why metadata gets duplicated in ZFS the way it does on all volumes. Having seen this play out a bunch of times, it isn’t an uncommon need either.

> having to duplicate all data x2 Well I didn't suggest that. I said important files only for the extra backup, and I was talking about reallocating resources not getting new ones. The simplest version is the scenario where turning on dedup means you need one less drive of space. Convert that drive to parity and you'll be better off. Split that drive from the pool and use it to backup the most important files and you…

There was an implication in your statement that volume level was the level of granularity, yeah?

I’m noting that during on volume wide dedup can have the con that you can’t choose (but it looks like you can!) to manually duplicate data.

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

#129
post #69
post #59

Earlier quoted context omitted.

VMs are known to benefit from dedupe so yes, you'll see benefits there. ZFS is a general-purpose filesystem not just an enterprise SAN so many ZFS users aren't running VMs. Dedupe/compression works really well on syslog I apologize for the pedantry but dedupe and compression aren't the same thing (although they tend to be bundled in the enterprise storage world). Logs are probably benefiting from compression not dedu…

They are not the same thing, but when you boil it down to the raw math, they aren't identical twins, but they're absolutely fraternal twins. Both are trying to eliminate repeating data, it's just the frame of reference that changes. Compression in this context is operating on a given block or handful of blocks. Deduplication is operating on the entire "volume" of data. "Volume" having a different meaning depending on…

compression tends NOT to use a global dictionary. So to me they are vastly different even if they have the same goal of reducing the output size.

Compression with a global dict would like do better than dedup yet it will have a lot of other issues.

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

#130
post #67

I want "offline" dedupe, or "lazy" dedupe that doesn't require the pool to be fully offline, but doesn't happen immediately. Because: > When dedup is enabled [...] every single write and free operation requires a lookup and a then a write to the dedup table, regardless of whether or not the write or free proper was actually done by the pool. To me, this is "obviously" the wrong approach in most cases. When I'm writin…

I run rdfind[1] as a cronjob to replace duplicates with hardlinks. Works fine! https://github.com/pauldreik/rdfind

Quite cool, though it's not as storage saving as deduplicating at e.g. N byte blocks, at block level.
Post reply on HN