Workload Tuning: actualize volblocksize

It was a little bit obsolete and obscure.

Signed-off-by: George Melikov <mail@gmelikov.ru>
This commit is contained in:
George Melikov
2023-02-22 11:47:09 +03:00
parent 2254f0cb61
commit c3db54b664

View File

@@ -203,7 +203,7 @@ ZFS datasets use an internal recordsize of 128KB by default. The dataset
recordsize is the basic unit of data used for internal copy-on-write on recordsize is the basic unit of data used for internal copy-on-write on
files. Partial record writes require that data be read from either ARC files. Partial record writes require that data be read from either ARC
(cheap) or disk (expensive). recordsize can be set to any power of 2 (cheap) or disk (expensive). recordsize can be set to any power of 2
from 512 bytes to 128 kilobytes. Software that writes in fixed record from 512 bytes to 1 megabyte. Software that writes in fixed record
sizes (e.g. databases) will benefit from the use of a matching sizes (e.g. databases) will benefit from the use of a matching
recordsize. recordsize.
@@ -233,10 +233,32 @@ must support the large_blocks feature.
zvol volblocksize zvol volblocksize
~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
Zvols have a volblocksize property that is analogous to record size. The Zvols have a ``volblocksize`` property that is analogous to ``recordsize``.
default size is 8KB, which is the size of a page on the SPARC Current default (16KB since v2.2) balances the metadata overhead, compression
architecture. Workloads that use smaller sized IOs (such as swap on x86 opportunities and decent space efficiency on majority of pool configurations
which use 4096-byte pages) will benefit from a smaller volblocksize. due to 4KB disk physical block rounding (especially on RAIDZ and DRAID),
while incurring some write amplification on guest FSes that run with smaller
block sizes [#VOLBLOCKSIZE]_.
Users are advised to test their scenarios and see whether the ``volblocksize``
needs to be changed to favor one or the other:
- sector alignment of guest FS is crucial
- most of guest FSes use default block size of 4-8KB, so:
- Larger ``volblocksize`` can help with mostly sequential workloads and
will gain a compression efficiency
- Smaller ``volblocksize`` can help with random workloads and minimize
IO amplification, but will use more metadata
(e.g. more small IOs will be generated by ZFS) and may have worse
space efficiency (especially on RAIDZ and DRAID)
- It's meaningless to set ``volblocksize`` less than guest FS's block size
or :ref:`ashift <alignment_shift_ashift>`
- See :ref:`Dataset recordsize <dataset_recordsize>`
for additional information
Deduplication Deduplication
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
@@ -760,3 +782,4 @@ AIO should be used to maximize IOPS when using files for guest storage.
.. [#sqlite_ps_change] <https://www.sqlite.org/pgszchng2016.html> .. [#sqlite_ps_change] <https://www.sqlite.org/pgszchng2016.html>
.. [#FS_CASEFOLD_FL] <https://github.com/openzfs/zfs/pull/13790> .. [#FS_CASEFOLD_FL] <https://github.com/openzfs/zfs/pull/13790>
.. [#init_on_alloc] <https://patchwork.kernel.org/project/linux-security-module/patch/20190626121943.131390-2-glider@google.com/#22731857> .. [#init_on_alloc] <https://patchwork.kernel.org/project/linux-security-module/patch/20190626121943.131390-2-glider@google.com/#22731857>
.. [#VOLBLOCKSIZE] <https://github.com/openzfs/zfs/pull/12406>