openzfs / zfs

OpenZFS on Linux and FreeBSD
https://openzfs.github.io/openzfs-docs
Other
10.69k stars 1.76k forks source link

Support special_small_blocks larger than 1M #15388

Open HammerAdmin86 opened 1 year ago

HammerAdmin86 commented 1 year ago

Describe the feature would like to see added to OpenZFS

OpenZFS officially supports record sizes up to 16M (https://openzfs.github.io/openzfs-docs/Performance%20and%20Tuning/Workload%20Tuning.html#larger-record-sizes). However, the maximum allowable "special_small_block" parameter is currently 1M.

This feature request would be to increase the allowable parameter to "special_small_block=8M" in OpenZFS.

How will this feature improve OpenZFS?

Given the advances in NVME SSD storage capacities and associated price drops since the last time this parameter was increased 4 years ago (https://github.com/openzfs/zfs/issues/9131); this community is in a position to benefit more than ever from hybrid NAS systems to speed up metadata and small file access times and throughput.

Additional context

In our use cases we currently employ record sizes of 4M and "special_small_block=1M". However, internal calculations indicate we would be most optimal with "special_small_block=2M" - which is currently not allowed. The request to increase to 8M would be the highest logical option and may benefit other users with data scenarios we have not encountered or imagined as of yet.

rincebrain commented 1 year ago

624222ae31bc8ce0009c7da9b0877a3c93aa56fb and 5aa69a57da86a38d49cca1623b0c79764f8ad3e9 already changed that, so that should work on 2.0.x in non-debug builds and 2.1.x with debug builds, I think? Where are you hitting it not working?

HammerAdmin86 commented 1 year ago

My current systems are as follows:

TrueNAS 13.0 U5.3 (FreeBSD 13.1-RELEASE-p7 zfs-2.1.11-1 zfs-kmod-v2023072100-zfs_0eb787a7e

1) This is the description given when the zfs set special_small_blocks is run. You can see that it only mentions blocks up to 1M. image

2) The TrueNAS description of the parameter also indicates the same. image

3) However, ZFS supports a max_recordsize of 16M. image

4) Which can be set in the OS with a LOADER tunable. image

I did read commits https://github.com/openzfs/zfs/commit/624222ae31bc8ce0009c7da9b0877a3c93aa56fb and https://github.com/openzfs/zfs/commit/5aa69a57da86a38d49cca1623b0c79764f8ad3e9 but it was not explicity clear about support for special_small_blocks beyond 1M.

In the end, I decided to make an attempt to set special_small_blocks via the ZFS CMD line and found that my systems behave well. The TrueNAS web-gui doesn't throw a fit or cause some other kind of crash or kernel panic.

Could we find a way to update both the zfs docs and the helper text in the zfs CMD line with regards to usage of max_recordsize and expanded special_small_block parameters?

TrueNAS should edit their docs too.

HammerAdmin86 commented 1 year ago

This is what I came up with:

image