Characterizing files for metadata/etc. before transfer to ZFS pool
https://forum.level1techs.com/t/zfs-metadata-special-device-z/159954 contains info for getting metadata size and block-size histograms, but both processes assume the data is already in a ZFS pool. I've looked around but can't seem to find any techniques for getting that info before actually moving those files to ZFS (useful when first setting up a ZFS system). The histogram can be approximated by a simple analysis of file sizes that rounds each up to a power of two (with whatever cutoff is wanted for record size), but I'm not sure how to emulate the metadata calculations. That link does mention that the metadata will be about 0.3% of a "typical" workload, but it does not clarify what a typical workload is, and I assume that will also vary based on chosen record size, how often files are modified (due to COW), and the like.
Posted Jun 20, 2022, 6:05 PM UTC · edited
I did some measurements on this. Metadata is something like the sum of:
a) 1 GB per 100k multi-record files.
b) 1 GB per 1M single-record files.
c) 1 GB per 1 TB (recordsize=128k) or 10 TB (recordsize=1M) of data.
d) 5 GB of DDT tables per 60 GB (recordsize=8k), 1 TB (recordsize=128k) or 10 TB (recordsize=1M) of data, if dedup is enabled.
e) plus any blocks from special_small_blocks.
redundant_metadata=most should halve (a) and (c).
Take these with a grain of salt, do your own measurements etc, but I've posted these a few times before and not had anybody point out any major problems, so I think they should be reasonable as a rough estimate.
Those are definitely some more clear approximations, thanks.