Technical-ish question...
On my file server, I'm using both compression and deduplication (yes, I have enough RAM for dedupe). For a particular dataset, I was trying to determine if compressing the data with gzip-9 vs lz4 would yield a better compression ratio while still meeting my performance requirements. I tried to test this with (basically) the following...
I've used this pattern of copying/rewriting data before to switch settings that are only applied on write with success. This time, however, I got an unexpected result. The compression ratio on 'old' and 'new' were exactly the same, but 'zpool list' showed a significant increase in dedup ratio. Also the free space on the pool was barely changed. So what I think happened is that the entire new file system deduped against the old before the new compression was applied.
Does this sound plausible? Are blocks deduplicated before compression is applied? If so, is it possible to do what I'm looking to achieve without having to first copy all of the data off the system and back?
Thanks.
On my file server, I'm using both compression and deduplication (yes, I have enough RAM for dedupe). For a particular dataset, I was trying to determine if compressing the data with gzip-9 vs lz4 would yield a better compression ratio while still meeting my performance requirements. I tried to test this with (basically) the following...
Code:
zfs create pool/new
zfs set compression=gzip-9 pool/old
zfs snapshot pool/old@snap
zfs send -R pool/old@snap | zfs recv -F pool/new
I've used this pattern of copying/rewriting data before to switch settings that are only applied on write with success. This time, however, I got an unexpected result. The compression ratio on 'old' and 'new' were exactly the same, but 'zpool list' showed a significant increase in dedup ratio. Also the free space on the pool was barely changed. So what I think happened is that the entire new file system deduped against the old before the new compression was applied.
Does this sound plausible? Are blocks deduplicated before compression is applied? If so, is it possible to do what I'm looking to achieve without having to first copy all of the data off the system and back?
Thanks.