logoalt Hacker News

badgersnakeyesterday at 8:58 PM2 repliesview on HN

zfs-mirror-8k (whatever that is) looks alright.


Replies

magicalhippotoday at 1:03 AM

The script[1] shows it's a ZFS mirror (RAID-1) with 8k max record size, as opposed to the default 128k.

I say max, as ZFS stores multiples of the physical block size up to the record size. So even with 128k record size, if your file fits in two physical blocks, it will write two physical blocks of data.

The `ashift` parameter[2] controls the physical block size, typically 512 bytes or 4k for HDDs. Though higher can be useful on SSDs (but less tested, have seen some bug reports with >4k block sizes).

Typically you'd only want to use such small records if you are tuning it for a specific workload, like if you have a database that writes 8k pages.

Compression acts on records, so by limiting the record size, you limit the effectiveness of the compression: 1.2 and 1.8 blocks worth of data both gets written as 2 physical blocks.

On the upside, record size is a dataset property, so you can have many different datasets with different record sizes on the same pool.

[1]: https://github.com/fenio/modern-fs-benchmark/blob/599ec72fe3...

[2]: https://openzfs.github.io/openzfs-docs/Performance%20and%20T...