QuicksearchDisclaimerThe individual owning this blog works for Oracle in Germany. The opinions expressed here are his own, are not necessarily reviewed in advance by anyone but the individual author, and neither Oracle nor any other party necessarily agrees with them.
|
df considered problematicWednesday, December 2. 2009Trackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
I'm curious, what happens if you "fill" the disk with copies of wireshark ? (I.e. get some capacity percentage >100)
Hopefully there are not any tools depending on statvfs before deciding if to copy or not?
Why can "capacity percentage > 100%"?
The "total" column in df will grow as the "used" column grows, in above case, each addition copy of wireshark only consume around 3K space due to dedup, so even if you eventually fill the disk with million copies of wireshark, the "total" column will grow at the same time, so the capacity percentage showed in df will stuck at 100% and won't exceed it.
Joerg, one of your cut&pastes is wrong for the Wireshark cp, copied over the same filename destination twice!
Otherwise nice followup to the discussions … Craig
So, this should be true for all deduped filesystems, not a problem of ZFS. Or am I wrong ?
Gerd
I have no Data Domain or NetApp device available, so i can't check it, but it should be pretty much the same with other deduping filesystems. But as ZFS is the first dedupe for the masses implementation, most users will find this challenge with ZFS the first time.
Another aspect is the "total" column is not always going up, it can come down as well when more zfs are created in the same pool since the "df -k" will calculate based on individual filesystem;
The points are: (1) in "df -k" output, total=used+available; (2) in "zpool list" output, size=alloc+free; (3) The "size" in "zpool list" should remain unchanged (unless zpool add...); (4) The "used" in df and "alloc" in zpool will be different due to dedup=on; if there is only one zfs in zpool, then alloc < used; (5) yet, if more zfs created in the same pool, the "used" column in each zfs could be eventually less than "alloc" in "zpool list" output; (dedup is on pool level, so it is only guaranteed that the "alloc" in "zpool list" is less than the combined "used" column for all the zfs in the same pool, for an individual zfs, the "used" column in df -k could be more than the "alloc" in "zpool list" output. As an example, here are some output on a test box: #### when there is only one zfs holding data, the total column for testdedup/pdfatt is 101G: #df -k ...... testdedup 97G 24K 97G 1% /testdedup testdedup/pdfatt 101G 4.3G 97G 5% /testdedup/pdfatt testdedup/vboximage 97G 21K 97G 1% /testdedup/vboximage # zpool list testdedup NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT testdedup 99.5G 1.39G 98.1G 1% 3.23x ONLINE - #### After copy some data to another zfs testdedup/vboximage, the total column for testdedup/pdfatt became 97G: #df -k ...... testdedup 93G 24K 93G 1% /testdedup testdedup/pdfatt 97G 4.3G 93G 5% /testdedup/pdfatt testdedup/vboximage 97G 4.7G 93G 5% /testdedup/vboximage #zpool list testdedup NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT testdedup 99.5G 5.61G 93.9G 5% 1.61x ONLINE -
"df looks at the data from the filesystem perspective."
~ "zpool list looks from the pool perspective..." Maybe they should look at the SA's perspective... Great article as always
If you perform any more experiments, I would be interested to know what you have set for dedupditto. Did ZFS automatically create a second copy when you crossed the threshold (default 100 references)?
Also, it would be instructive to see how compression=on affects the reported values. It seems like the interaction with dedup ratio could further distort the user's understanding.
So I got a chance to try the snv_128a bits, and dedup works as advertised. This is all in my tiny Virtualbox guest. Good stuff! =-)
It looks like the dedupditto pool property is not entirely public yet. At least, it's not in the manpages, or the usage output of zpool get/set. But it does appear in libzfs.so.1. I can explicitly run "zpool get dedupditto", and get a valid result. It looks like the default value is zero. Does that mean it is turned off, perhaps? I should try tuning this. As for compression, this works rather like I expected -- the USEDDS space is shown as the compressed amount, multiplied by the number of deduped copies. Okay then, fair enough. Where it gets confusing for me is how meaningful the dedupratio should be. If I copy in a file ten times, the ratio is 10.00x. This is true, regardless of whether the file is tiny or huge. But my pool has a real size. What objective value does this ratio correlate with? Without knowing the size of just the particular data subject to dedup, can I really learn much about my pool from seeing the ratio out of context? It looks like what I really have to watch is whether my pool available size dynamically grew, and compare real size vs. perceived size with dedup. I think in the future it will be harder to know the answer of just how much space is available, unless the tools are further enhanced, as with zfs list -o space. -cheers, CSB
Update: "zpool set dedupditto=x" failed, it's a readonly property. Perhaps it will be enabled in a future release. Oh well.
Thanks. Interesting discussion.
I guess this will kill tools like JDiskReport as well. Or is there a way to find out how much space a directory uses after deduplication? http://www.jgoodies.com/freeware/jdiskreport/features.html
In build 129, I was able to set dedupditto. Minimum value is 100. As I crossed 100x dedupratio, indeed it dropped back to 50x indicating the second copy.
Further, as I crossed 10000x (100 x 100), copies appeared to go to 3 (3333x). I had to drop all the way back down to 99x before copies were removed, and it went from 3 directly back to 1. Given the various issues with build 130, I think I'll wait before conducting any more testing. Hopefully they can also clear up the memory / performance issues that make importing a pool with dedup=on take so long. Thanks.
Deduplication and ZFS compression are two very useful features of ZFS. It's true that df hasn't kept up with the times. I think now is the time to extend df and add some additional flags that make it better capable of handling these extensions and enabling the sys admin choose how he wants to see the information presented. How about flags for total file usage, and actual space used on disk for starters?
|
+1The LKSF bookThe book with the consolidated Less known Solaris Tutorials is available for download here
Web 2.0Contact
Networking xing.com My photos Buttons![]() This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Germany License
![]() ![]() ![]() Blog AdministrationDonateOkay, okay ... as several people have asked for it ... but you know my opinion.
|