xref: /freebsd/sys/contrib/openzfs/man/man4/zfs.4 (revision 7e97c6adffde3bd6f60f042ed2603335c005c6a7)
1.\" SPDX-License-Identifier: CDDL-1.0
2.\"
3.\" Copyright (c) 2013 by Turbo Fredriksson <turbo@bayour.com>. All rights reserved.
4.\" Copyright (c) 2019, 2021 by Delphix. All rights reserved.
5.\" Copyright (c) 2019 Datto Inc.
6.\" Copyright (c) 2023, 2024, 2025, Klara, Inc.
7.\" The contents of this file are subject to the terms of the Common Development
8.\" and Distribution License (the "License").  You may not use this file except
9.\" in compliance with the License. You can obtain a copy of the license at
10.\" usr/src/OPENSOLARIS.LICENSE or https://opensource.org/licenses/CDDL-1.0.
11.\"
12.\" See the License for the specific language governing permissions and
13.\" limitations under the License. When distributing Covered Code, include this
14.\" CDDL HEADER in each file and include the License file at
15.\" usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this
16.\" CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your
17.\" own identifying information:
18.\" Portions Copyright [yyyy] [name of copyright owner]
19.\"
20.Dd May 29, 2025
21.Dt ZFS 4
22.Os
23.
24.Sh NAME
25.Nm zfs
26.Nd tuning of the ZFS kernel module
27.
28.Sh DESCRIPTION
29The ZFS module supports these parameters:
30.Bl -tag -width Ds
31.It Sy dbuf_cache_max_bytes Ns = Ns Sy UINT64_MAX Ns B Pq u64
32Maximum size in bytes of the dbuf cache.
33The target size is determined by the MIN versus
34.No 1/2^ Ns Sy dbuf_cache_shift Pq 1/32nd
35of the target ARC size.
36The behavior of the dbuf cache and its associated settings
37can be observed via the
38.Pa /proc/spl/kstat/zfs/dbufstats
39kstat.
40.
41.It Sy dbuf_metadata_cache_max_bytes Ns = Ns Sy UINT64_MAX Ns B Pq u64
42Maximum size in bytes of the metadata dbuf cache.
43The target size is determined by the MIN versus
44.No 1/2^ Ns Sy dbuf_metadata_cache_shift Pq 1/64th
45of the target ARC size.
46The behavior of the metadata dbuf cache and its associated settings
47can be observed via the
48.Pa /proc/spl/kstat/zfs/dbufstats
49kstat.
50.
51.It Sy dbuf_cache_hiwater_pct Ns = Ns Sy 10 Ns % Pq uint
52The percentage over
53.Sy dbuf_cache_max_bytes
54when dbufs must be evicted directly.
55.
56.It Sy dbuf_cache_lowater_pct Ns = Ns Sy 10 Ns % Pq uint
57The percentage below
58.Sy dbuf_cache_max_bytes
59when the evict thread stops evicting dbufs.
60.
61.It Sy dbuf_cache_shift Ns = Ns Sy 5 Pq uint
62Set the size of the dbuf cache
63.Pq Sy dbuf_cache_max_bytes
64to a log2 fraction of the target ARC size.
65.
66.It Sy dbuf_metadata_cache_shift Ns = Ns Sy 6 Pq uint
67Set the size of the dbuf metadata cache
68.Pq Sy dbuf_metadata_cache_max_bytes
69to a log2 fraction of the target ARC size.
70.
71.It Sy dbuf_mutex_cache_shift Ns = Ns Sy 0 Pq uint
72Set the size of the mutex array for the dbuf cache.
73When set to
74.Sy 0
75the array is dynamically sized based on total system memory.
76.
77.It Sy dmu_object_alloc_chunk_shift Ns = Ns Sy 7 Po 128 Pc Pq uint
78dnode slots allocated in a single operation as a power of 2.
79The default value minimizes lock contention for the bulk operation performed.
80.
81.It Sy dmu_ddt_copies Ns = Ns Sy 3 Pq uint
82Controls the number of copies stored for DeDup Table
83.Pq DDT
84objects.
85Reducing the number of copies to 1 from the previous default of 3
86can reduce the write inflation caused by deduplication.
87This assumes redundancy for this data is provided by the vdev layer.
88If the DDT is damaged, space may be leaked
89.Pq not freed
90when the DDT can not report the correct reference count.
91.
92.It Sy dmu_prefetch_max Ns = Ns Sy 134217728 Ns B Po 128 MiB Pc Pq uint
93Limit the amount we can prefetch with one call to this amount in bytes.
94This helps to limit the amount of memory that can be used by prefetching.
95.
96.It Sy l2arc_feed_again Ns = Ns Sy 1 Ns | Ns 0 Pq int
97Turbo L2ARC warm-up.
98When the L2ARC is cold the fill interval will be set as fast as possible.
99.
100.It Sy l2arc_feed_min_ms Ns = Ns Sy 200 Pq u64
101Min feed interval in milliseconds.
102Requires
103.Sy l2arc_feed_again Ns = Ns Ar 1
104and only applicable in related situations.
105.
106.It Sy l2arc_feed_secs Ns = Ns Sy 1 Pq u64
107Seconds between L2ARC writing.
108.
109.It Sy l2arc_headroom Ns = Ns Sy 8 Pq u64
110How far through the ARC lists to search for L2ARC cacheable content,
111expressed as a multiplier of
112.Sy l2arc_write_max .
113ARC persistence across reboots can be achieved with persistent L2ARC
114by setting this parameter to
115.Sy 0 ,
116allowing the full length of ARC lists to be searched for cacheable content.
117.
118.It Sy l2arc_headroom_boost Ns = Ns Sy 200 Ns % Pq u64
119Scales
120.Sy l2arc_headroom
121by this percentage when L2ARC contents are being successfully compressed
122before writing.
123A value of
124.Sy 100
125disables this feature.
126.
127.It Sy l2arc_exclude_special Ns = Ns Sy 0 Ns | Ns 1 Pq int
128Controls whether buffers present on special vdevs are eligible for caching
129into L2ARC.
130If set to 1, exclude dbufs on special vdevs from being cached to L2ARC.
131.
132.It Sy l2arc_mfuonly Ns = Ns Sy 0 Ns | Ns 1 Ns | Ns 2 Pq int
133Controls whether only MFU metadata and data are cached from ARC into L2ARC.
134This may be desired to avoid wasting space on L2ARC when reading/writing large
135amounts of data that are not expected to be accessed more than once.
136.Pp
137The default is 0,
138meaning both MRU and MFU data and metadata are cached.
139When turning off this feature (setting it to 0), some MRU buffers will
140still be present in ARC and eventually cached on L2ARC.
141.No If Sy l2arc_noprefetch Ns = Ns Sy 0 ,
142some prefetched buffers will be cached to L2ARC, and those might later
143transition to MRU, in which case the
144.Sy l2arc_mru_asize No arcstat will not be Sy 0 .
145.Pp
146Setting it to 1 means to L2 cache only MFU data and metadata.
147.Pp
148Setting it to 2 means to L2 cache all metadata (MRU+MFU) but
149only MFU data (i.e. MRU data are not cached). This can be the right setting
150to cache as much metadata as possible even when having high data turnover.
151.Pp
152Regardless of
153.Sy l2arc_noprefetch ,
154some MFU buffers might be evicted from ARC,
155accessed later on as prefetches and transition to MRU as prefetches.
156If accessed again they are counted as MRU and the
157.Sy l2arc_mru_asize No arcstat will not be Sy 0 .
158.Pp
159The ARC status of L2ARC buffers when they were first cached in
160L2ARC can be seen in the
161.Sy l2arc_mru_asize , Sy l2arc_mfu_asize , No and Sy l2arc_prefetch_asize
162arcstats when importing the pool or onlining a cache
163device if persistent L2ARC is enabled.
164.Pp
165The
166.Sy evict_l2_eligible_mru
167arcstat does not take into account if this option is enabled as the information
168provided by the
169.Sy evict_l2_eligible_m[rf]u
170arcstats can be used to decide if toggling this option is appropriate
171for the current workload.
172.
173.It Sy l2arc_meta_percent Ns = Ns Sy 33 Ns % Pq uint
174Percent of ARC size allowed for L2ARC-only headers.
175Since L2ARC buffers are not evicted on memory pressure,
176too many headers on a system with an irrationally large L2ARC
177can render it slow or unusable.
178This parameter limits L2ARC writes and rebuilds to achieve the target.
179.
180.It Sy l2arc_trim_ahead Ns = Ns Sy 0 Ns % Pq u64
181Trims ahead of the current write size
182.Pq Sy l2arc_write_max
183on L2ARC devices by this percentage of write size if we have filled the device.
184If set to
185.Sy 100
186we TRIM twice the space required to accommodate upcoming writes.
187A minimum of
188.Sy 64 MiB
189will be trimmed.
190It also enables TRIM of the whole L2ARC device upon creation
191or addition to an existing pool or if the header of the device is
192invalid upon importing a pool or onlining a cache device.
193A value of
194.Sy 0
195disables TRIM on L2ARC altogether and is the default as it can put significant
196stress on the underlying storage devices.
197This will vary depending of how well the specific device handles these commands.
198.
199.It Sy l2arc_noprefetch Ns = Ns Sy 1 Ns | Ns 0 Pq int
200Do not write buffers to L2ARC if they were prefetched but not used by
201applications.
202In case there are prefetched buffers in L2ARC and this option
203is later set, we do not read the prefetched buffers from L2ARC.
204Unsetting this option is useful for caching sequential reads from the
205disks to L2ARC and serve those reads from L2ARC later on.
206This may be beneficial in case the L2ARC device is significantly faster
207in sequential reads than the disks of the pool.
208.Pp
209Use
210.Sy 1
211to disable and
212.Sy 0
213to enable caching/reading prefetches to/from L2ARC.
214.
215.It Sy l2arc_norw Ns = Ns Sy 0 Ns | Ns 1 Pq int
216No reads during writes.
217.
218.It Sy l2arc_write_boost Ns = Ns Sy 33554432 Ns B Po 32 MiB Pc Pq u64
219Cold L2ARC devices will have
220.Sy l2arc_write_max
221increased by this amount while they remain cold.
222.
223.It Sy l2arc_write_max Ns = Ns Sy 33554432 Ns B Po 32 MiB Pc Pq u64
224Max write bytes per interval.
225.
226.It Sy l2arc_rebuild_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int
227Rebuild the L2ARC when importing a pool (persistent L2ARC).
228This can be disabled if there are problems importing a pool
229or attaching an L2ARC device (e.g. the L2ARC device is slow
230in reading stored log metadata, or the metadata
231has become somehow fragmented/unusable).
232.
233.It Sy l2arc_rebuild_blocks_min_l2size Ns = Ns Sy 1073741824 Ns B Po 1 GiB Pc Pq u64
234Minimum size of an L2ARC device required in order to write log blocks in it.
235The log blocks are used upon importing the pool to rebuild the persistent L2ARC.
236.Pp
237For L2ARC devices less than 1 GiB, the amount of data
238.Fn l2arc_evict
239evicts is significant compared to the amount of restored L2ARC data.
240In this case, do not write log blocks in L2ARC in order not to waste space.
241.
242.It Sy metaslab_aliquot Ns = Ns Sy 2097152 Ns B Po 2 MiB Pc Pq u64
243Metaslab group's per child vdev allocation granularity, in bytes.
244This is roughly similar to what would be referred to as the "stripe size"
245in traditional RAID arrays.
246In normal operation, ZFS will try to write this amount of data to each child
247of a top-level vdev before moving on to the next top-level vdev.
248.
249.It Sy metaslab_bias_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int
250Enable metaslab groups biasing based on their over- or under-utilization
251relative to the metaslab class average.
252If disabled, each metaslab group will receive allocations proportional to its
253capacity.
254.
255.It Sy metaslab_perf_bias Ns = Ns Sy 1 Ns | Ns 0 Ns | Ns 2 Pq int
256Controls metaslab groups biasing based on their write performance.
257Setting to 0 makes all metaslab groups receive fixed amounts of allocations.
258Setting to 2 allows faster metaslab groups to allocate more.
259Setting to 1 equals to 2 if the pool is write-bound or 0 otherwise.
260That is, if the pool is limited by write throughput, then allocate more from
261faster metaslab groups, but if not, try to evenly distribute the allocations.
262.
263.It Sy metaslab_force_ganging Ns = Ns Sy 16777217 Ns B Po 16 MiB + 1 B Pc Pq u64
264Make some blocks above a certain size be gang blocks.
265This option is used by the test suite to facilitate testing.
266.
267.It Sy metaslab_force_ganging_pct Ns = Ns Sy 3 Ns % Pq uint
268For blocks that could be forced to be a gang block (due to
269.Sy metaslab_force_ganging ) ,
270force this many of them to be gang blocks.
271.
272.It Sy brt_zap_prefetch Ns = Ns Sy 1 Ns | Ns 0 Pq int
273Controls prefetching BRT records for blocks which are going to be cloned.
274.
275.It Sy brt_zap_default_bs Ns = Ns Sy 12 Po 4 KiB Pc Pq int
276Default BRT ZAP data block size as a power of 2. Note that changing this after
277creating a BRT on the pool will not affect existing BRTs, only newly created
278ones.
279.
280.It Sy brt_zap_default_ibs Ns = Ns Sy 12 Po 4 KiB Pc Pq int
281Default BRT ZAP indirect block size as a power of 2. Note that changing this
282after creating a BRT on the pool will not affect existing BRTs, only newly
283created ones.
284.
285.It Sy ddt_zap_default_bs Ns = Ns Sy 15 Po 32 KiB Pc Pq int
286Default DDT ZAP data block size as a power of 2. Note that changing this after
287creating a DDT on the pool will not affect existing DDTs, only newly created
288ones.
289.
290.It Sy ddt_zap_default_ibs Ns = Ns Sy 15 Po 32 KiB Pc Pq int
291Default DDT ZAP indirect block size as a power of 2. Note that changing this
292after creating a DDT on the pool will not affect existing DDTs, only newly
293created ones.
294.
295.It Sy zfs_default_bs Ns = Ns Sy 9 Po 512 B Pc Pq int
296Default dnode block size as a power of 2.
297.
298.It Sy zfs_default_ibs Ns = Ns Sy 17 Po 128 KiB Pc Pq int
299Default dnode indirect block size as a power of 2.
300.
301.It Sy zfs_dio_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int
302Enable Direct I/O.
303If this setting is 0, then all I/O requests will be directed through the ARC
304acting as though the dataset property
305.Sy direct
306was set to
307.Sy disabled .
308.
309.It Sy zfs_dio_strict Ns = Ns Sy 0 Ns | Ns 1 Pq int
310Strictly enforce alignment for Direct I/O requests, returning
311.Sy EINVAL
312if not page-aligned instead of silently falling back to uncached I/O.
313.
314.It Sy zfs_history_output_max Ns = Ns Sy 1048576 Ns B Po 1 MiB Pc Pq u64
315When attempting to log an output nvlist of an ioctl in the on-disk history,
316the output will not be stored if it is larger than this size (in bytes).
317This must be less than
318.Sy DMU_MAX_ACCESS Pq 64 MiB .
319This applies primarily to
320.Fn zfs_ioc_channel_program Pq cf. Xr zfs-program 8 .
321.
322.It Sy zfs_keep_log_spacemaps_at_export Ns = Ns Sy 0 Ns | Ns 1 Pq int
323Prevent log spacemaps from being destroyed during pool exports and destroys.
324.
325.It Sy zfs_metaslab_segment_weight_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int
326Enable/disable segment-based metaslab selection.
327.
328.It Sy zfs_metaslab_switch_threshold Ns = Ns Sy 2 Pq int
329When using segment-based metaslab selection, continue allocating
330from the active metaslab until this option's
331worth of buckets have been exhausted.
332.
333.It Sy metaslab_debug_load Ns = Ns Sy 0 Ns | Ns 1 Pq int
334Load all metaslabs during pool import.
335.
336.It Sy metaslab_debug_unload Ns = Ns Sy 0 Ns | Ns 1 Pq int
337Prevent metaslabs from being unloaded.
338.
339.It Sy metaslab_fragmentation_factor_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int
340Enable use of the fragmentation metric in computing metaslab weights.
341.
342.It Sy metaslab_df_max_search Ns = Ns Sy 16777216 Ns B Po 16 MiB Pc Pq uint
343Maximum distance to search forward from the last offset.
344Without this limit, fragmented pools can see
345.Em >100`000
346iterations and
347.Fn metaslab_block_picker
348becomes the performance limiting factor on high-performance storage.
349.Pp
350With the default setting of
351.Sy 16 MiB ,
352we typically see less than
353.Em 500
354iterations, even with very fragmented
355.Sy ashift Ns = Ns Sy 9
356pools.
357The maximum number of iterations possible is
358.Sy metaslab_df_max_search / 2^(ashift+1) .
359With the default setting of
360.Sy 16 MiB
361this is
362.Em 16*1024 Pq with Sy ashift Ns = Ns Sy 9
363or
364.Em 2*1024 Pq with Sy ashift Ns = Ns Sy 12 .
365.
366.It Sy metaslab_df_use_largest_segment Ns = Ns Sy 0 Ns | Ns 1 Pq int
367If not searching forward (due to
368.Sy metaslab_df_max_search , metaslab_df_free_pct ,
369.No or Sy metaslab_df_alloc_threshold ) ,
370this tunable controls which segment is used.
371If set, we will use the largest free segment.
372If unset, we will use a segment of at least the requested size.
373.
374.It Sy zfs_metaslab_max_size_cache_sec Ns = Ns Sy 3600 Ns s Po 1 hour Pc Pq u64
375When we unload a metaslab, we cache the size of the largest free chunk.
376We use that cached size to determine whether or not to load a metaslab
377for a given allocation.
378As more frees accumulate in that metaslab while it's unloaded,
379the cached max size becomes less and less accurate.
380After a number of seconds controlled by this tunable,
381we stop considering the cached max size and start
382considering only the histogram instead.
383.
384.It Sy zfs_metaslab_mem_limit Ns = Ns Sy 25 Ns % Pq uint
385When we are loading a new metaslab, we check the amount of memory being used
386to store metaslab range trees.
387If it is over a threshold, we attempt to unload the least recently used metaslab
388to prevent the system from clogging all of its memory with range trees.
389This tunable sets the percentage of total system memory that is the threshold.
390.
391.It Sy zfs_metaslab_try_hard_before_gang Ns = Ns Sy 0 Ns | Ns 1 Pq int
392.Bl -item -compact
393.It
394If unset, we will first try normal allocation.
395.It
396If that fails then we will do a gang allocation.
397.It
398If that fails then we will do a "try hard" gang allocation.
399.It
400If that fails then we will have a multi-layer gang block.
401.El
402.Pp
403.Bl -item -compact
404.It
405If set, we will first try normal allocation.
406.It
407If that fails then we will do a "try hard" allocation.
408.It
409If that fails we will do a gang allocation.
410.It
411If that fails we will do a "try hard" gang allocation.
412.It
413If that fails then we will have a multi-layer gang block.
414.El
415.
416.It Sy zfs_metaslab_find_max_tries Ns = Ns Sy 100 Pq uint
417When not trying hard, we only consider this number of the best metaslabs.
418This improves performance, especially when there are many metaslabs per vdev
419and the allocation can't actually be satisfied
420(so we would otherwise iterate all metaslabs).
421.
422.It Sy zfs_vdev_default_ms_count Ns = Ns Sy 200 Pq uint
423When a vdev is added, target this number of metaslabs per top-level vdev.
424.
425.It Sy zfs_vdev_default_ms_shift Ns = Ns Sy 29 Po 512 MiB Pc Pq uint
426Default lower limit for metaslab size.
427.
428.It Sy zfs_vdev_max_ms_shift Ns = Ns Sy 34 Po 16 GiB Pc Pq uint
429Default upper limit for metaslab size.
430.
431.It Sy zfs_vdev_max_auto_ashift Ns = Ns Sy 14 Pq uint
432Maximum ashift used when optimizing for logical \[->] physical sector size on
433new
434top-level vdevs.
435May be increased up to
436.Sy ASHIFT_MAX Po 16 Pc ,
437but this may negatively impact pool space efficiency.
438.
439.It Sy zfs_vdev_direct_write_verify Ns = Ns Sy Linux 1 | FreeBSD 0 Pq uint
440If non-zero, then a Direct I/O write's checksum will be verified every
441time the write is issued and before it is committed to the block pointer.
442In the event the checksum is not valid then the I/O operation will return EIO.
443This module parameter can be used to detect if the
444contents of the users buffer have changed in the process of doing a Direct I/O
445write.
446It can also help to identify if reported checksum errors are tied to Direct I/O
447writes.
448Each verify error causes a
449.Sy dio_verify_wr
450zevent.
451Direct Write I/O checksum verify errors can be seen with
452.Nm zpool Cm status Fl d .
453The default value for this is 1 on Linux, but is 0 for
454.Fx
455because user pages can be placed under write protection in
456.Fx
457before the Direct I/O write is issued.
458.
459.It Sy zfs_vdev_min_auto_ashift Ns = Ns Sy ASHIFT_MIN Po 9 Pc Pq uint
460Minimum ashift used when creating new top-level vdevs.
461.
462.It Sy zfs_vdev_min_ms_count Ns = Ns Sy 16 Pq uint
463Minimum number of metaslabs to create in a top-level vdev.
464.
465.It Sy vdev_validate_skip Ns = Ns Sy 0 Ns | Ns 1 Pq int
466Skip label validation steps during pool import.
467Changing is not recommended unless you know what you're doing
468and are recovering a damaged label.
469.
470.It Sy zfs_vdev_ms_count_limit Ns = Ns Sy 131072 Po 128k Pc Pq uint
471Practical upper limit of total metaslabs per top-level vdev.
472.
473.It Sy metaslab_preload_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int
474Enable metaslab group preloading.
475.
476.It Sy metaslab_preload_limit Ns = Ns Sy 10 Pq uint
477Maximum number of metaslabs per group to preload
478.
479.It Sy metaslab_preload_pct Ns = Ns Sy 50 Pq uint
480Percentage of CPUs to run a metaslab preload taskq
481.
482.It Sy metaslab_lba_weighting_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int
483Give more weight to metaslabs with lower LBAs,
484assuming they have greater bandwidth,
485as is typically the case on a modern constant angular velocity disk drive.
486.
487.It Sy metaslab_unload_delay Ns = Ns Sy 32 Pq uint
488After a metaslab is used, we keep it loaded for this many TXGs, to attempt to
489reduce unnecessary reloading.
490Note that both this many TXGs and
491.Sy metaslab_unload_delay_ms
492milliseconds must pass before unloading will occur.
493.
494.It Sy metaslab_unload_delay_ms Ns = Ns Sy 600000 Ns ms Po 10 min Pc Pq uint
495After a metaslab is used, we keep it loaded for this many milliseconds,
496to attempt to reduce unnecessary reloading.
497Note, that both this many milliseconds and
498.Sy metaslab_unload_delay
499TXGs must pass before unloading will occur.
500.
501.It Sy reference_history Ns = Ns Sy 3 Pq uint
502Maximum reference holders being tracked when reference_tracking_enable is
503active.
504.It Sy raidz_expand_max_copy_bytes Ns = Ns Sy 160MB Pq ulong
505Max amount of memory to use for RAID-Z expansion I/O.
506This limits how much I/O can be outstanding at once.
507.
508.It Sy raidz_expand_max_reflow_bytes Ns = Ns Sy 0 Pq ulong
509For testing, pause RAID-Z expansion when reflow amount reaches this value.
510.
511.It Sy raidz_io_aggregate_rows Ns = Ns Sy 4 Pq ulong
512For expanded RAID-Z, aggregate reads that have more rows than this.
513.
514.It Sy reference_history Ns = Ns Sy 3 Pq int
515Maximum reference holders being tracked when reference_tracking_enable is
516active.
517.
518.It Sy reference_tracking_enable Ns = Ns Sy 0 Ns | Ns 1 Pq int
519Track reference holders to
520.Sy refcount_t
521objects (debug builds only).
522.
523.It Sy send_holes_without_birth_time Ns = Ns Sy 1 Ns | Ns 0 Pq int
524When set, the
525.Sy hole_birth
526optimization will not be used, and all holes will always be sent during a
527.Nm zfs Cm send .
528This is useful if you suspect your datasets are affected by a bug in
529.Sy hole_birth .
530.
531.It Sy spa_config_path Ns = Ns Pa /etc/zfs/zpool.cache Pq charp
532SPA config file.
533.
534.It Sy spa_asize_inflation Ns = Ns Sy 24 Pq uint
535Multiplication factor used to estimate actual disk consumption from the
536size of data being written.
537The default value is a worst case estimate,
538but lower values may be valid for a given pool depending on its configuration.
539Pool administrators who understand the factors involved
540may wish to specify a more realistic inflation factor,
541particularly if they operate close to quota or capacity limits.
542.
543.It Sy spa_load_print_vdev_tree Ns = Ns Sy 0 Ns | Ns 1 Pq int
544Whether to print the vdev tree in the debugging message buffer during pool
545import.
546.
547.It Sy spa_load_verify_data Ns = Ns Sy 1 Ns | Ns 0 Pq int
548Whether to traverse data blocks during an "extreme rewind"
549.Pq Fl X
550import.
551.Pp
552An extreme rewind import normally performs a full traversal of all
553blocks in the pool for verification.
554If this parameter is unset, the traversal skips non-metadata blocks.
555It can be toggled once the
556import has started to stop or start the traversal of non-metadata blocks.
557.
558.It Sy spa_load_verify_metadata  Ns = Ns Sy 1 Ns | Ns 0 Pq int
559Whether to traverse blocks during an "extreme rewind"
560.Pq Fl X
561pool import.
562.Pp
563An extreme rewind import normally performs a full traversal of all
564blocks in the pool for verification.
565If this parameter is unset, the traversal is not performed.
566It can be toggled once the import has started to stop or start the traversal.
567.
568.It Sy spa_load_verify_shift Ns = Ns Sy 4 Po 1/16th Pc Pq uint
569Sets the maximum number of bytes to consume during pool import to the log2
570fraction of the target ARC size.
571.
572.It Sy spa_slop_shift Ns = Ns Sy 5 Po 1/32nd Pc Pq int
573Normally, we don't allow the last
574.Sy 3.2% Pq Sy 1/2^spa_slop_shift
575of space in the pool to be consumed.
576This ensures that we don't run the pool completely out of space,
577due to unaccounted changes (e.g. to the MOS).
578It also limits the worst-case time to allocate space.
579If we have less than this amount of free space,
580most ZPL operations (e.g. write, create) will return
581.Sy ENOSPC .
582.
583.It Sy spa_num_allocators Ns = Ns Sy 4 Pq int
584Determines the number of block allocators to use per spa instance.
585Capped by the number of actual CPUs in the system via
586.Sy spa_cpus_per_allocator .
587.Pp
588Note that setting this value too high could result in performance
589degradation and/or excess fragmentation.
590Set value only applies to pools imported/created after that.
591.
592.It Sy spa_cpus_per_allocator Ns = Ns Sy 4 Pq int
593Determines the minimum number of CPUs in a system for block allocator
594per spa instance.
595Set value only applies to pools imported/created after that.
596.
597.It Sy spa_upgrade_errlog_limit Ns = Ns Sy 0 Pq uint
598Limits the number of on-disk error log entries that will be converted to the
599new format when enabling the
600.Sy head_errlog
601feature.
602The default is to convert all log entries.
603.
604.It Sy vdev_removal_max_span Ns = Ns Sy 32768 Ns B Po 32 KiB Pc Pq uint
605During top-level vdev removal, chunks of data are copied from the vdev
606which may include free space in order to trade bandwidth for IOPS.
607This parameter determines the maximum span of free space, in bytes,
608which will be included as "unnecessary" data in a chunk of copied data.
609.Pp
610The default value here was chosen to align with
611.Sy zfs_vdev_read_gap_limit ,
612which is a similar concept when doing
613regular reads (but there's no reason it has to be the same).
614.
615.It Sy vdev_file_logical_ashift Ns = Ns Sy 9 Po 512 B Pc Pq u64
616Logical ashift for file-based devices.
617.
618.It Sy vdev_file_physical_ashift Ns = Ns Sy 9 Po 512 B Pc Pq u64
619Physical ashift for file-based devices.
620.
621.It Sy zap_iterate_prefetch Ns = Ns Sy 1 Ns | Ns 0 Pq int
622If set, when we start iterating over a ZAP object,
623prefetch the entire object (all leaf blocks).
624However, this is limited by
625.Sy dmu_prefetch_max .
626.
627.It Sy zap_micro_max_size Ns = Ns Sy 131072 Ns B Po 128 KiB Pc Pq int
628Maximum micro ZAP size.
629A "micro" ZAP is upgraded to a "fat" ZAP once it grows beyond the specified
630size.
631Sizes higher than 128KiB will be clamped to 128KiB unless the
632.Sy large_microzap
633feature is enabled.
634.
635.It Sy zap_shrink_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int
636If set, adjacent empty ZAP blocks will be collapsed, reducing disk space.
637.
638.It Sy zfetch_min_distance Ns = Ns Sy 4194304 Ns B Po 4 MiB Pc Pq uint
639Min bytes to prefetch per stream.
640Prefetch distance starts from the demand access size and quickly grows to
641this value, doubling on each hit.
642After that it may grow further by 1/8 per hit, but only if some prefetch
643since last time haven't completed in time to satisfy demand request, i.e.
644prefetch depth didn't cover the read latency or the pool got saturated.
645.
646.It Sy zfetch_max_distance Ns = Ns Sy 67108864 Ns B Po 64 MiB Pc Pq uint
647Max bytes to prefetch per stream.
648.
649.It Sy zfetch_max_idistance Ns = Ns Sy 67108864 Ns B Po 64 MiB Pc Pq uint
650Max bytes to prefetch indirects for per stream.
651.
652.It Sy zfetch_max_reorder Ns = Ns Sy 16777216 Ns B Po 16 MiB Pc Pq uint
653Requests within this byte distance from the current prefetch stream position
654are considered parts of the stream, reordered due to parallel processing.
655Such requests do not advance the stream position immediately unless
656.Sy zfetch_hole_shift
657fill threshold is reached, but saved to fill holes in the stream later.
658.
659.It Sy zfetch_max_streams Ns = Ns Sy 8 Pq uint
660Max number of streams per zfetch (prefetch streams per file).
661.
662.It Sy zfetch_min_sec_reap Ns = Ns Sy 1 Pq uint
663Min time before inactive prefetch stream can be reclaimed
664.
665.It Sy zfetch_max_sec_reap Ns = Ns Sy 2 Pq uint
666Max time before inactive prefetch stream can be deleted
667.
668.It Sy zfs_abd_scatter_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int
669Enables ARC from using scatter/gather lists and forces all allocations to be
670linear in kernel memory.
671Disabling can improve performance in some code paths
672at the expense of fragmented kernel memory.
673.
674.It Sy zfs_abd_scatter_max_order Ns = Ns Sy MAX_ORDER\-1 Pq uint
675Maximum number of consecutive memory pages allocated in a single block for
676scatter/gather lists.
677.Pp
678The value of
679.Sy MAX_ORDER
680depends on kernel configuration.
681.
682.It Sy zfs_abd_scatter_min_size Ns = Ns Sy 1536 Ns B Po 1.5 KiB Pc Pq uint
683This is the minimum allocation size that will use scatter (page-based) ABDs.
684Smaller allocations will use linear ABDs.
685.
686.It Sy zfs_arc_dnode_limit Ns = Ns Sy 0 Ns B Pq u64
687When the number of bytes consumed by dnodes in the ARC exceeds this number of
688bytes, try to unpin some of it in response to demand for non-metadata.
689This value acts as a ceiling to the amount of dnode metadata, and defaults to
690.Sy 0 ,
691which indicates that a percent which is based on
692.Sy zfs_arc_dnode_limit_percent
693of the ARC meta buffers that may be used for dnodes.
694.It Sy zfs_arc_dnode_limit_percent Ns = Ns Sy 10 Ns % Pq u64
695Percentage that can be consumed by dnodes of ARC meta buffers.
696.Pp
697See also
698.Sy zfs_arc_dnode_limit ,
699which serves a similar purpose but has a higher priority if nonzero.
700.
701.It Sy zfs_arc_dnode_reduce_percent Ns = Ns Sy 10 Ns % Pq u64
702Percentage of ARC dnodes to try to scan in response to demand for non-metadata
703when the number of bytes consumed by dnodes exceeds
704.Sy zfs_arc_dnode_limit .
705.
706.It Sy zfs_arc_average_blocksize Ns = Ns Sy 8192 Ns B Po 8 KiB Pc Pq uint
707The ARC's buffer hash table is sized based on the assumption of an average
708block size of this value.
709This works out to roughly 1 MiB of hash table per 1 GiB of physical memory
710with 8-byte pointers.
711For configurations with a known larger average block size,
712this value can be increased to reduce the memory footprint.
713.
714.It Sy zfs_arc_eviction_pct Ns = Ns Sy 200 Ns % Pq uint
715When
716.Fn arc_is_overflowing ,
717.Fn arc_get_data_impl
718waits for this percent of the requested amount of data to be evicted.
719For example, by default, for every
720.Em 2 KiB
721that's evicted,
722.Em 1 KiB
723of it may be "reused" by a new allocation.
724Since this is above
725.Sy 100 Ns % ,
726it ensures that progress is made towards getting
727.Sy arc_size No under Sy arc_c .
728Since this is finite, it ensures that allocations can still happen,
729even during the potentially long time that
730.Sy arc_size No is more than Sy arc_c .
731.
732.It Sy zfs_arc_evict_batch_limit Ns = Ns Sy 10 Pq uint
733Number ARC headers to evict per sub-list before proceeding to another sub-list.
734This batch-style operation prevents entire sub-lists from being evicted at once
735but comes at a cost of additional unlocking and locking.
736.
737.It Sy zfs_arc_evict_threads Ns = Ns Sy 0 Pq int
738Sets the number of ARC eviction threads to be used.
739.Pp
740If set greater than 0, ZFS will dedicate up to that many threads to ARC
741eviction.
742Each thread will process one sub-list at a time,
743until the eviction target is reached or all sub-lists have been processed.
744When set to 0, ZFS will compute a reasonable number of eviction threads based
745on the number of CPUs.
746.TS
747box;
748lb l l .
749	CPUs	Threads
750_
751	1-4	1
752	5-8	2
753	9-15	3
754	16-31	4
755	32-63	6
756	64-95	8
757	96-127	9
758	128-160	11
759	160-191	12
760	192-223	13
761	224-255	14
762	256+	16
763.TE
764.Pp
765More threads may improve the responsiveness of ZFS to memory pressure.
766This can be important for performance when eviction from the ARC becomes
767a bottleneck for reads and writes.
768.Pp
769This parameter can only be set at module load time.
770.
771.It Sy zfs_arc_grow_retry Ns = Ns Sy 0 Ns s Pq uint
772If set to a non zero value, it will replace the
773.Sy arc_grow_retry
774value with this value.
775The
776.Sy arc_grow_retry
777.No value Pq default Sy 5 Ns s
778is the number of seconds the ARC will wait before
779trying to resume growth after a memory pressure event.
780.
781.It Sy zfs_arc_lotsfree_percent Ns = Ns Sy 10 Ns % Pq int
782Throttle I/O when free system memory drops below this percentage of total
783system memory.
784Setting this value to
785.Sy 0
786will disable the throttle.
787.
788.It Sy zfs_arc_max Ns = Ns Sy 0 Ns B Pq u64
789Max size of ARC in bytes.
790If
791.Sy 0 ,
792then the max size of ARC is determined by the amount of system memory installed.
793The larger of
794.Sy all_system_memory No \- Sy 1 GiB
795and
796.Sy 5/8 No \(mu Sy all_system_memory
797will be used as the limit.
798This value must be at least
799.Sy 67108864 Ns B Pq 64 MiB .
800.Pp
801This value can be changed dynamically, with some caveats.
802It cannot be set back to
803.Sy 0
804while running, and reducing it below the current ARC size will not cause
805the ARC to shrink without memory pressure to induce shrinking.
806.
807.It Sy zfs_arc_meta_balance Ns = Ns Sy 500 Pq uint
808Balance between metadata and data on ghost hits.
809Values above 100 increase metadata caching by proportionally reducing effect
810of ghost data hits on target data/metadata rate.
811.
812.It Sy zfs_arc_min Ns = Ns Sy 0 Ns B Pq u64
813Min size of ARC in bytes.
814.No If set to Sy 0 , arc_c_min
815will default to consuming the larger of
816.Sy 32 MiB
817and
818.Sy all_system_memory No / Sy 32 .
819.
820.It Sy zfs_arc_min_prefetch_ms Ns = Ns Sy 0 Ns ms Ns Po Ns ≡ Ns 1s Pc Pq uint
821Minimum time prefetched blocks are locked in the ARC.
822.
823.It Sy zfs_arc_min_prescient_prefetch_ms Ns = Ns Sy 0 Ns ms Ns Po Ns ≡ Ns 6s Pc Pq uint
824Minimum time "prescient prefetched" blocks are locked in the ARC.
825These blocks are meant to be prefetched fairly aggressively ahead of
826the code that may use them.
827.
828.It Sy zfs_arc_prune_task_threads Ns = Ns Sy 1 Pq int
829Number of arc_prune threads.
830.Fx
831does not need more than one.
832Linux may theoretically use one per mount point up to number of CPUs,
833but that was not proven to be useful.
834.
835.It Sy zfs_max_missing_tvds Ns = Ns Sy 0 Pq int
836Number of missing top-level vdevs which will be allowed during
837pool import (only in read-only mode).
838.
839.It Sy zfs_max_nvlist_src_size Ns = Sy 0 Pq u64
840Maximum size in bytes allowed to be passed as
841.Sy zc_nvlist_src_size
842for ioctls on
843.Pa /dev/zfs .
844This prevents a user from causing the kernel to allocate
845an excessive amount of memory.
846When the limit is exceeded, the ioctl fails with
847.Sy EINVAL
848and a description of the error is sent to the
849.Pa zfs-dbgmsg
850log.
851This parameter should not need to be touched under normal circumstances.
852If
853.Sy 0 ,
854equivalent to a quarter of the user-wired memory limit under
855.Fx
856and to
857.Sy 134217728 Ns B Pq 128 MiB
858under Linux.
859.
860.It Sy zfs_multilist_num_sublists Ns = Ns Sy 0 Pq uint
861To allow more fine-grained locking, each ARC state contains a series
862of lists for both data and metadata objects.
863Locking is performed at the level of these "sub-lists".
864This parameters controls the number of sub-lists per ARC state,
865and also applies to other uses of the multilist data structure.
866.Pp
867If
868.Sy 0 ,
869equivalent to the greater of the number of online CPUs and
870.Sy 4 .
871.
872.It Sy zfs_arc_overflow_shift Ns = Ns Sy 8 Pq int
873The ARC size is considered to be overflowing if it exceeds the current
874ARC target size
875.Pq Sy arc_c
876by thresholds determined by this parameter.
877Exceeding by
878.Sy ( arc_c No >> Sy zfs_arc_overflow_shift ) No / Sy 2
879starts ARC reclamation process.
880If that appears insufficient, exceeding by
881.Sy ( arc_c No >> Sy zfs_arc_overflow_shift ) No \(mu Sy 1.5
882blocks new buffer allocation until the reclaim thread catches up.
883Started reclamation process continues till ARC size returns below the
884target size.
885.Pp
886The default value of
887.Sy 8
888causes the ARC to start reclamation if it exceeds the target size by
889.Em 0.2%
890of the target size, and block allocations by
891.Em 0.6% .
892.
893.It Sy zfs_arc_shrink_shift Ns = Ns Sy 0 Pq uint
894If nonzero, this will update
895.Sy arc_shrink_shift Pq default Sy 7
896with the new value.
897.
898.It Sy zfs_arc_pc_percent Ns = Ns Sy 0 Ns % Po off Pc Pq uint
899Percent of pagecache to reclaim ARC to.
900.Pp
901This tunable allows the ZFS ARC to play more nicely
902with the kernel's LRU pagecache.
903It can guarantee that the ARC size won't collapse under scanning
904pressure on the pagecache, yet still allows the ARC to be reclaimed down to
905.Sy zfs_arc_min
906if necessary.
907This value is specified as percent of pagecache size (as measured by
908.Sy NR_ACTIVE_FILE
909+
910.Sy NR_INACTIVE_FILE ) ,
911where that percent may exceed
912.Sy 100 .
913This
914only operates during memory pressure/reclaim.
915.
916.It Sy zfs_arc_shrinker_limit Ns = Ns Sy 0 Pq int
917This is a limit on how many pages the ARC shrinker makes available for
918eviction in response to one page allocation attempt.
919Note that in practice, the kernel's shrinker can ask us to evict
920up to about four times this for one allocation attempt.
921To reduce OOM risk, this limit is applied for kswapd reclaims only.
922.Pp
923For example a value of
924.Sy 10000 Pq in practice, Em 160 MiB No per allocation attempt with 4 KiB pages
925limits the amount of time spent attempting to reclaim ARC memory to
926less than 100 ms per allocation attempt,
927even with a small average compressed block size of ~8 KiB.
928.Pp
929The parameter can be set to 0 (zero) to disable the limit,
930and only applies on Linux.
931.
932.It Sy zfs_arc_shrinker_seeks Ns = Ns Sy 2 Pq int
933Relative cost of ARC eviction on Linux, AKA number of seeks needed to
934restore evicted page.
935Bigger values make ARC more precious and evictions smaller, comparing to
936other kernel subsystems.
937Value of 4 means parity with page cache.
938.
939.It Sy zfs_arc_sys_free Ns = Ns Sy 0 Ns B Pq u64
940The target number of bytes the ARC should leave as free memory on the system.
941If zero, equivalent to the bigger of
942.Sy 512 KiB No and Sy all_system_memory/64 .
943.
944.It Sy zfs_checksum_events_per_second Ns = Ns Sy 20 Ns /s Pq uint
945Rate limit checksum events to this many per second.
946Note that this should not be set below the ZED thresholds
947(currently 10 checksums over 10 seconds)
948or else the daemon may not trigger any action.
949.
950.It Sy zfs_commit_timeout_pct Ns = Ns Sy 10 Ns % Pq uint
951This controls the amount of time that a ZIL block (lwb) will remain "open"
952when it isn't "full", and it has a thread waiting for it to be committed to
953stable storage.
954The timeout is scaled based on a percentage of the last lwb
955latency to avoid significantly impacting the latency of each individual
956transaction record (itx).
957.
958.It Sy zfs_condense_indirect_commit_entry_delay_ms Ns = Ns Sy 0 Ns ms Pq int
959Vdev indirection layer (used for device removal) sleeps for this many
960milliseconds during mapping generation.
961Intended for use with the test suite to throttle vdev removal speed.
962.
963.It Sy zfs_condense_indirect_obsolete_pct Ns = Ns Sy 25 Ns % Pq uint
964Minimum percent of obsolete bytes in vdev mapping required to attempt to
965condense
966.Pq see Sy zfs_condense_indirect_vdevs_enable .
967Intended for use with the test suite
968to facilitate triggering condensing as needed.
969.
970.It Sy zfs_condense_indirect_vdevs_enable Ns = Ns Sy 1 Ns | Ns 0 Pq int
971Enable condensing indirect vdev mappings.
972When set, attempt to condense indirect vdev mappings
973if the mapping uses more than
974.Sy zfs_condense_min_mapping_bytes
975bytes of memory and if the obsolete space map object uses more than
976.Sy zfs_condense_max_obsolete_bytes
977bytes on-disk.
978The condensing process is an attempt to save memory by removing obsolete
979mappings.
980.
981.It Sy zfs_condense_max_obsolete_bytes Ns = Ns Sy 1073741824 Ns B Po 1 GiB Pc Pq u64
982Only attempt to condense indirect vdev mappings if the on-disk size
983of the obsolete space map object is greater than this number of bytes
984.Pq see Sy zfs_condense_indirect_vdevs_enable .
985.
986.It Sy zfs_condense_min_mapping_bytes Ns = Ns Sy 131072 Ns B Po 128 KiB Pc Pq u64
987Minimum size vdev mapping to attempt to condense
988.Pq see Sy zfs_condense_indirect_vdevs_enable .
989.
990.It Sy zfs_dbgmsg_enable Ns = Ns Sy 1 Ns | Ns 0 Pq int
991Internally ZFS keeps a small log to facilitate debugging.
992The log is enabled by default, and can be disabled by unsetting this option.
993The contents of the log can be accessed by reading
994.Pa /proc/spl/kstat/zfs/dbgmsg .
995Writing
996.Sy 0
997to the file clears the log.
998.Pp
999This setting does not influence debug prints due to
1000.Sy zfs_flags .
1001.
1002.It Sy zfs_dbgmsg_maxsize Ns = Ns Sy 4194304 Ns B Po 4 MiB Pc Pq uint
1003Maximum size of the internal ZFS debug log.
1004.
1005.It Sy zfs_dbuf_state_index Ns = Ns Sy 0 Pq int
1006Historically used for controlling what reporting was available under
1007.Pa /proc/spl/kstat/zfs .
1008No effect.
1009.
1010.It Sy zfs_deadman_checktime_ms Ns = Ns Sy 60000 Ns ms Po 1 min Pc Pq u64
1011Check time in milliseconds.
1012This defines the frequency at which we check for hung I/O requests
1013and potentially invoke the
1014.Sy zfs_deadman_failmode
1015behavior.
1016.
1017.It Sy zfs_deadman_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int
1018When a pool sync operation takes longer than
1019.Sy zfs_deadman_synctime_ms ,
1020or when an individual I/O operation takes longer than
1021.Sy zfs_deadman_ziotime_ms ,
1022then the operation is considered to be "hung".
1023If
1024.Sy zfs_deadman_enabled
1025is set, then the deadman behavior is invoked as described by
1026.Sy zfs_deadman_failmode .
1027By default, the deadman is enabled and set to
1028.Sy wait
1029which results in "hung" I/O operations only being logged.
1030The deadman is automatically disabled when a pool gets suspended.
1031.
1032.It Sy zfs_deadman_events_per_second Ns = Ns Sy 1 Ns /s Pq int
1033Rate limit deadman zevents (which report hung I/O operations) to this many per
1034second.
1035.
1036.It Sy zfs_deadman_failmode Ns = Ns Sy wait Pq charp
1037Controls the failure behavior when the deadman detects a "hung" I/O operation.
1038Valid values are:
1039.Bl -tag -compact -offset 4n -width "continue"
1040.It Sy wait
1041Wait for a "hung" operation to complete.
1042For each "hung" operation a "deadman" event will be posted
1043describing that operation.
1044.It Sy continue
1045Attempt to recover from a "hung" operation by re-dispatching it
1046to the I/O pipeline if possible.
1047.It Sy panic
1048Panic the system.
1049This can be used to facilitate automatic fail-over
1050to a properly configured fail-over partner.
1051.El
1052.
1053.It Sy zfs_deadman_synctime_ms Ns = Ns Sy 600000 Ns ms Po 10 min Pc Pq u64
1054Interval in milliseconds after which the deadman is triggered and also
1055the interval after which a pool sync operation is considered to be "hung".
1056Once this limit is exceeded the deadman will be invoked every
1057.Sy zfs_deadman_checktime_ms
1058milliseconds until the pool sync completes.
1059.
1060.It Sy zfs_deadman_ziotime_ms Ns = Ns Sy 300000 Ns ms Po 5 min Pc Pq u64
1061Interval in milliseconds after which the deadman is triggered and an
1062individual I/O operation is considered to be "hung".
1063As long as the operation remains "hung",
1064the deadman will be invoked every
1065.Sy zfs_deadman_checktime_ms
1066milliseconds until the operation completes.
1067.
1068.It Sy zfs_dedup_prefetch Ns = Ns Sy 0 Ns | Ns 1 Pq int
1069Enable prefetching dedup-ed blocks which are going to be freed.
1070.
1071.It Sy zfs_dedup_log_flush_min_time_ms Ns = Ns Sy 1000 Ns Pq uint
1072Minimum time to spend on dedup log flush each transaction.
1073.Pp
1074At least this long will be spent flushing dedup log entries each transaction,
1075up to
1076.Sy zfs_txg_timeout .
1077This occurs even if doing so would delay the transaction, that is, other IO
1078completes under this time.
1079.
1080.It Sy zfs_dedup_log_flush_entries_min Ns = Ns Sy 100 Ns Pq uint
1081Flush at least this many entries each transaction.
1082.Pp
1083OpenZFS will flush a fraction of the log every TXG, to keep the size
1084proportional to the ingest rate (see
1085.Sy zfs_dedup_log_flush_txgs ) .
1086This sets the minimum for that estimate, which prevents the backlog from
1087completely draining if the ingest rate falls.
1088Raising it can force OpenZFS to flush more aggressively, reducing the backlog
1089to zero more quickly, but can make it less able to back off if log
1090flushing would compete with other IO too much.
1091.
1092.It Sy zfs_dedup_log_flush_entries_max Ns = Ns Sy UINT_MAX Ns Pq uint
1093Flush at most this many entries each transaction.
1094.Pp
1095Mostly used for debugging purposes.
1096.It Sy zfs_dedup_log_flush_txgs Ns = Ns Sy 100 Ns Pq uint
1097Target number of TXGs to process the whole dedup log.
1098.Pp
1099Every TXG, OpenZFS will process the inverse of this number times the size
1100of the DDT backlog.
1101This will keep the backlog at a size roughly equal to the ingest rate
1102times this value.
1103This offers a balance between a more efficient DDT log, with better
1104aggregation, and shorter import times, which increase as the size of the
1105DDT log increases.
1106Increasing this value will result in a more efficient DDT log, but longer
1107import times.
1108.It Sy zfs_dedup_log_cap Ns = Ns Sy UINT_MAX Ns Pq uint
1109Soft cap for the size of the current dedup log.
1110.Pp
1111If the log is larger than this size, we increase the aggressiveness of
1112the flushing to try to bring it back down to the soft cap.
1113Setting it will reduce import times, but will reduce the efficiency of
1114the DDT log, increasing the expected number of IOs required to flush the same
1115amount of data.
1116.It Sy zfs_dedup_log_hard_cap Ns = Ns Sy 0 Ns | Ns 1 Pq uint
1117Whether to treat the log cap as a firm cap or not.
1118.Pp
1119When set to 0 (the default), the
1120.Sy zfs_dedup_log_cap
1121will increase the maximum number of log entries we flush in a given txg.
1122This will bring the backlog size down towards the cap, but not at the expense
1123of making TXG syncs take longer.
1124If this is set to 1, the cap acts more like a hard cap than a soft cap; it will
1125also increase the minimum number of log entries we flush per TXG.
1126Enabling it will reduce worst-case import times, at the cost of increased TXG
1127sync times.
1128.It Sy zfs_dedup_log_flush_flow_rate_txgs Ns = Ns Sy 10 Ns Pq uint
1129Number of transactions to use to compute the flow rate.
1130.Pp
1131OpenZFS will estimate number of entries changed (ingest rate), number of entries
1132flushed (flush rate) and time spent flushing (flush time rate) and combining
1133these into an overall "flow rate".
1134It will use an exponential weighted moving average over some number of recent
1135transactions to compute these rates.
1136This sets the number of transactions to compute these averages over.
1137Setting it higher can help to smooth out the flow rate in the face of spiky
1138workloads, but will take longer for the flow rate to adjust to a sustained
1139change in the ingress rate.
1140.
1141.It Sy zfs_dedup_log_txg_max Ns = Ns Sy 8 Ns Pq uint
1142Max transactions to before starting to flush dedup logs.
1143.Pp
1144OpenZFS maintains two dedup logs, one receiving new changes, one flushing.
1145If there is nothing to flush, it will accumulate changes for no more than this
1146many transactions before switching the logs and starting to flush entries out.
1147.
1148.It Sy zfs_dedup_log_mem_max Ns = Ns Sy 0 Ns Pq u64
1149Max memory to use for dedup logs.
1150.Pp
1151OpenZFS will spend no more than this much memory on maintaining the in-memory
1152dedup log.
1153Flushing will begin when around half this amount is being spent on logs.
1154The default value of
1155.Sy 0
1156will cause it to be set by
1157.Sy zfs_dedup_log_mem_max_percent
1158instead.
1159.
1160.It Sy zfs_dedup_log_mem_max_percent Ns = Ns Sy 1 Ns % Pq uint
1161Max memory to use for dedup logs, as a percentage of total memory.
1162.Pp
1163If
1164.Sy zfs_dedup_log_mem_max
1165is not set, it will be initialized as a percentage of the total memory in the
1166system.
1167.
1168.It Sy zfs_delay_min_dirty_percent Ns = Ns Sy 60 Ns % Pq uint
1169Start to delay each transaction once there is this amount of dirty data,
1170expressed as a percentage of
1171.Sy zfs_dirty_data_max .
1172This value should be at least
1173.Sy zfs_vdev_async_write_active_max_dirty_percent .
1174.No See Sx ZFS TRANSACTION DELAY .
1175.
1176.It Sy zfs_delay_scale Ns = Ns Sy 500000 Pq int
1177This controls how quickly the transaction delay approaches infinity.
1178Larger values cause longer delays for a given amount of dirty data.
1179.Pp
1180For the smoothest delay, this value should be about 1 billion divided
1181by the maximum number of operations per second.
1182This will smoothly handle between ten times and a tenth of this number.
1183.No See Sx ZFS TRANSACTION DELAY .
1184.Pp
1185.Sy zfs_delay_scale No \(mu Sy zfs_dirty_data_max Em must No be smaller than Sy 2^64 .
1186.
1187.It Sy zfs_dio_write_verify_events_per_second Ns = Ns Sy 20 Ns /s Pq uint
1188Rate limit Direct I/O write verify events to this many per second.
1189.
1190.It Sy zfs_disable_ivset_guid_check Ns = Ns Sy 0 Ns | Ns 1 Pq int
1191Disables requirement for IVset GUIDs to be present and match when doing a raw
1192receive of encrypted datasets.
1193Intended for users whose pools were created with
1194OpenZFS pre-release versions and now have compatibility issues.
1195.
1196.It Sy zfs_key_max_salt_uses Ns = Ns Sy 400000000 Po 4*10^8 Pc Pq ulong
1197Maximum number of uses of a single salt value before generating a new one for
1198encrypted datasets.
1199The default value is also the maximum.
1200.
1201.It Sy zfs_object_mutex_size Ns = Ns Sy 64 Pq uint
1202Size of the znode hashtable used for holds.
1203.Pp
1204Due to the need to hold locks on objects that may not exist yet, kernel mutexes
1205are not created per-object and instead a hashtable is used where collisions
1206will result in objects waiting when there is not actually contention on the
1207same object.
1208.
1209.It Sy zfs_slow_io_events_per_second Ns = Ns Sy 20 Ns /s Pq int
1210Rate limit delay zevents (which report slow I/O operations) to this many per
1211second.
1212.
1213.It Sy zfs_unflushed_max_mem_amt Ns = Ns Sy 1073741824 Ns B Po 1 GiB Pc Pq u64
1214Upper-bound limit for unflushed metadata changes to be held by the
1215log spacemap in memory, in bytes.
1216.
1217.It Sy zfs_unflushed_max_mem_ppm Ns = Ns Sy 1000 Ns ppm Po 0.1% Pc Pq u64
1218Part of overall system memory that ZFS allows to be used
1219for unflushed metadata changes by the log spacemap, in millionths.
1220.
1221.It Sy zfs_unflushed_log_block_max Ns = Ns Sy 131072 Po 128k Pc Pq u64
1222Describes the maximum number of log spacemap blocks allowed for each pool.
1223The default value means that the space in all the log spacemaps
1224can add up to no more than
1225.Sy 131072
1226blocks (which means
1227.Em 16 GiB
1228of logical space before compression and ditto blocks,
1229assuming that blocksize is
1230.Em 128 KiB ) .
1231.Pp
1232This tunable is important because it involves a trade-off between import
1233time after an unclean export and the frequency of flushing metaslabs.
1234The higher this number is, the more log blocks we allow when the pool is
1235active which means that we flush metaslabs less often and thus decrease
1236the number of I/O operations for spacemap updates per TXG.
1237At the same time though, that means that in the event of an unclean export,
1238there will be more log spacemap blocks for us to read, inducing overhead
1239in the import time of the pool.
1240The lower the number, the amount of flushing increases, destroying log
1241blocks quicker as they become obsolete faster, which leaves less blocks
1242to be read during import time after a crash.
1243.Pp
1244Each log spacemap block existing during pool import leads to approximately
1245one extra logical I/O issued.
1246This is the reason why this tunable is exposed in terms of blocks rather
1247than space used.
1248.
1249.It Sy zfs_unflushed_log_block_min Ns = Ns Sy 1000 Pq u64
1250If the number of metaslabs is small and our incoming rate is high,
1251we could get into a situation that we are flushing all our metaslabs every TXG.
1252Thus we always allow at least this many log blocks.
1253.
1254.It Sy zfs_unflushed_log_block_pct Ns = Ns Sy 400 Ns % Pq u64
1255Tunable used to determine the number of blocks that can be used for
1256the spacemap log, expressed as a percentage of the total number of
1257unflushed metaslabs in the pool.
1258.
1259.It Sy zfs_unflushed_log_txg_max Ns = Ns Sy 1000 Pq u64
1260Tunable limiting maximum time in TXGs any metaslab may remain unflushed.
1261It effectively limits maximum number of unflushed per-TXG spacemap logs
1262that need to be read after unclean pool export.
1263.
1264.It Sy zfs_unlink_suspend_progress Ns = Ns Sy 0 Ns | Ns 1 Pq uint
1265When enabled, files will not be asynchronously removed from the list of pending
1266unlinks and the space they consume will be leaked.
1267Once this option has been disabled and the dataset is remounted,
1268the pending unlinks will be processed and the freed space returned to the pool.
1269This option is used by the test suite.
1270.
1271.It Sy zfs_delete_blocks Ns = Ns Sy 20480 Pq ulong
1272This is the used to define a large file for the purposes of deletion.
1273Files containing more than
1274.Sy zfs_delete_blocks
1275will be deleted asynchronously, while smaller files are deleted synchronously.
1276Decreasing this value will reduce the time spent in an
1277.Xr unlink 2
1278system call, at the expense of a longer delay before the freed space is
1279available.
1280This only applies on Linux.
1281.
1282.It Sy zfs_dirty_data_max Ns = Pq int
1283Determines the dirty space limit in bytes.
1284Once this limit is exceeded, new writes are halted until space frees up.
1285This parameter takes precedence over
1286.Sy zfs_dirty_data_max_percent .
1287.No See Sx ZFS TRANSACTION DELAY .
1288.Pp
1289Defaults to
1290.Sy physical_ram/10 ,
1291capped at
1292.Sy zfs_dirty_data_max_max .
1293.
1294.It Sy zfs_dirty_data_max_max Ns = Pq int
1295Maximum allowable value of
1296.Sy zfs_dirty_data_max ,
1297expressed in bytes.
1298This limit is only enforced at module load time, and will be ignored if
1299.Sy zfs_dirty_data_max
1300is later changed.
1301This parameter takes precedence over
1302.Sy zfs_dirty_data_max_max_percent .
1303.No See Sx ZFS TRANSACTION DELAY .
1304.Pp
1305Defaults to
1306.Sy min(physical_ram/4, 4GiB) ,
1307or
1308.Sy min(physical_ram/4, 1GiB)
1309for 32-bit systems.
1310.
1311.It Sy zfs_dirty_data_max_max_percent Ns = Ns Sy 25 Ns % Pq uint
1312Maximum allowable value of
1313.Sy zfs_dirty_data_max ,
1314expressed as a percentage of physical RAM.
1315This limit is only enforced at module load time, and will be ignored if
1316.Sy zfs_dirty_data_max
1317is later changed.
1318The parameter
1319.Sy zfs_dirty_data_max_max
1320takes precedence over this one.
1321.No See Sx ZFS TRANSACTION DELAY .
1322.
1323.It Sy zfs_dirty_data_max_percent Ns = Ns Sy 10 Ns % Pq uint
1324Determines the dirty space limit, expressed as a percentage of all memory.
1325Once this limit is exceeded, new writes are halted until space frees up.
1326The parameter
1327.Sy zfs_dirty_data_max
1328takes precedence over this one.
1329.No See Sx ZFS TRANSACTION DELAY .
1330.Pp
1331Subject to
1332.Sy zfs_dirty_data_max_max .
1333.
1334.It Sy zfs_dirty_data_sync_percent Ns = Ns Sy 20 Ns % Pq uint
1335Start syncing out a transaction group if there's at least this much dirty data
1336.Pq as a percentage of Sy zfs_dirty_data_max .
1337This should be less than
1338.Sy zfs_vdev_async_write_active_min_dirty_percent .
1339.
1340.It Sy zfs_wrlog_data_max Ns = Pq int
1341The upper limit of write-transaction ZIL log data size in bytes.
1342Write operations are throttled when approaching the limit until log data is
1343cleared out after transaction group sync.
1344Because of some overhead, it should be set at least 2 times the size of
1345.Sy zfs_dirty_data_max
1346.No to prevent harming normal write throughput .
1347It also should be smaller than the size of the slog device if slog is present.
1348.Pp
1349Defaults to
1350.Sy zfs_dirty_data_max*2
1351.
1352.It Sy zfs_fallocate_reserve_percent Ns = Ns Sy 110 Ns % Pq uint
1353Since ZFS is a copy-on-write filesystem with snapshots, blocks cannot be
1354preallocated for a file in order to guarantee that later writes will not
1355run out of space.
1356Instead,
1357.Xr fallocate 2
1358space preallocation only checks that sufficient space is currently available
1359in the pool or the user's project quota allocation,
1360and then creates a sparse file of the requested size.
1361The requested space is multiplied by
1362.Sy zfs_fallocate_reserve_percent
1363to allow additional space for indirect blocks and other internal metadata.
1364Setting this to
1365.Sy 0
1366disables support for
1367.Xr fallocate 2
1368and causes it to return
1369.Sy EOPNOTSUPP .
1370.
1371.It Sy zfs_fletcher_4_impl Ns = Ns Sy fastest Pq string
1372Select a fletcher 4 implementation.
1373.Pp
1374Supported selectors are:
1375.Sy fastest , scalar , sse2 , ssse3 , avx2 , avx512f , avx512bw ,
1376.No and Sy aarch64_neon .
1377All except
1378.Sy fastest No and Sy scalar
1379require instruction set extensions to be available,
1380and will only appear if ZFS detects that they are present at runtime.
1381If multiple implementations of fletcher 4 are available, the
1382.Sy fastest
1383will be chosen using a micro benchmark.
1384Selecting
1385.Sy scalar
1386results in the original CPU-based calculation being used.
1387Selecting any option other than
1388.Sy fastest No or Sy scalar
1389results in vector instructions
1390from the respective CPU instruction set being used.
1391.
1392.It Sy zfs_bclone_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int
1393Enables access to the block cloning feature.
1394If this setting is 0, then even if feature@block_cloning is enabled,
1395using functions and system calls that attempt to clone blocks will act as
1396though the feature is disabled.
1397.
1398.It Sy zfs_bclone_wait_dirty Ns = Ns Sy 1 Ns | Ns 0 Pq int
1399When set to 1 the FICLONE and FICLONERANGE ioctls will wait for any dirty
1400data to be written to disk before proceeding.
1401This ensures that the clone operation reliably succeeds, even if a file is
1402modified and then immediately cloned.
1403Note that for small files this may be slower than simply copying the file.
1404When set to 0 the clone operation will immediately fail if it encounters
1405any dirty blocks.
1406By default waiting is enabled.
1407.
1408.It Sy zfs_blake3_impl Ns = Ns Sy fastest Pq string
1409Select a BLAKE3 implementation.
1410.Pp
1411Supported selectors are:
1412.Sy cycle , fastest , generic , sse2 , sse41 , avx2 , avx512 .
1413All except
1414.Sy cycle , fastest No and Sy generic
1415require instruction set extensions to be available,
1416and will only appear if ZFS detects that they are present at runtime.
1417If multiple implementations of BLAKE3 are available, the
1418.Sy fastest will be chosen using a micro benchmark. You can see the
1419benchmark results by reading this kstat file:
1420.Pa /proc/spl/kstat/zfs/chksum_bench .
1421.
1422.It Sy zfs_free_bpobj_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int
1423Enable/disable the processing of the free_bpobj object.
1424.
1425.It Sy zfs_async_block_max_blocks Ns = Ns Sy UINT64_MAX Po unlimited Pc Pq u64
1426Maximum number of blocks freed in a single TXG.
1427.
1428.It Sy zfs_max_async_dedup_frees Ns = Ns Sy 100000 Po 10^5 Pc Pq u64
1429Maximum number of dedup blocks freed in a single TXG.
1430.
1431.It Sy zfs_vdev_async_read_max_active Ns = Ns Sy 3 Pq uint
1432Maximum asynchronous read I/O operations active to each device.
1433.No See Sx ZFS I/O SCHEDULER .
1434.
1435.It Sy zfs_vdev_async_read_min_active Ns = Ns Sy 1 Pq uint
1436Minimum asynchronous read I/O operation active to each device.
1437.No See Sx ZFS I/O SCHEDULER .
1438.
1439.It Sy zfs_vdev_async_write_active_max_dirty_percent Ns = Ns Sy 60 Ns % Pq uint
1440When the pool has more than this much dirty data, use
1441.Sy zfs_vdev_async_write_max_active
1442to limit active async writes.
1443If the dirty data is between the minimum and maximum,
1444the active I/O limit is linearly interpolated.
1445.No See Sx ZFS I/O SCHEDULER .
1446.
1447.It Sy zfs_vdev_async_write_active_min_dirty_percent Ns = Ns Sy 30 Ns % Pq uint
1448When the pool has less than this much dirty data, use
1449.Sy zfs_vdev_async_write_min_active
1450to limit active async writes.
1451If the dirty data is between the minimum and maximum,
1452the active I/O limit is linearly
1453interpolated.
1454.No See Sx ZFS I/O SCHEDULER .
1455.
1456.It Sy zfs_vdev_async_write_max_active Ns = Ns Sy 10 Pq uint
1457Maximum asynchronous write I/O operations active to each device.
1458.No See Sx ZFS I/O SCHEDULER .
1459.
1460.It Sy zfs_vdev_async_write_min_active Ns = Ns Sy 2 Pq uint
1461Minimum asynchronous write I/O operations active to each device.
1462.No See Sx ZFS I/O SCHEDULER .
1463.Pp
1464Lower values are associated with better latency on rotational media but poorer
1465resilver performance.
1466The default value of
1467.Sy 2
1468was chosen as a compromise.
1469A value of
1470.Sy 3
1471has been shown to improve resilver performance further at a cost of
1472further increasing latency.
1473.
1474.It Sy zfs_vdev_initializing_max_active Ns = Ns Sy 1 Pq uint
1475Maximum initializing I/O operations active to each device.
1476.No See Sx ZFS I/O SCHEDULER .
1477.
1478.It Sy zfs_vdev_initializing_min_active Ns = Ns Sy 1 Pq uint
1479Minimum initializing I/O operations active to each device.
1480.No See Sx ZFS I/O SCHEDULER .
1481.
1482.It Sy zfs_vdev_max_active Ns = Ns Sy 1000 Pq uint
1483The maximum number of I/O operations active to each device.
1484Ideally, this will be at least the sum of each queue's
1485.Sy max_active .
1486.No See Sx ZFS I/O SCHEDULER .
1487.
1488.It Sy zfs_vdev_open_timeout_ms Ns = Ns Sy 1000 Pq uint
1489Timeout value to wait before determining a device is missing
1490during import.
1491This is helpful for transient missing paths due
1492to links being briefly removed and recreated in response to
1493udev events.
1494.
1495.It Sy zfs_vdev_rebuild_max_active Ns = Ns Sy 3 Pq uint
1496Maximum sequential resilver I/O operations active to each device.
1497.No See Sx ZFS I/O SCHEDULER .
1498.
1499.It Sy zfs_vdev_rebuild_min_active Ns = Ns Sy 1 Pq uint
1500Minimum sequential resilver I/O operations active to each device.
1501.No See Sx ZFS I/O SCHEDULER .
1502.
1503.It Sy zfs_vdev_removal_max_active Ns = Ns Sy 2 Pq uint
1504Maximum removal I/O operations active to each device.
1505.No See Sx ZFS I/O SCHEDULER .
1506.
1507.It Sy zfs_vdev_removal_min_active Ns = Ns Sy 1 Pq uint
1508Minimum removal I/O operations active to each device.
1509.No See Sx ZFS I/O SCHEDULER .
1510.
1511.It Sy zfs_vdev_scrub_max_active Ns = Ns Sy 2 Pq uint
1512Maximum scrub I/O operations active to each device.
1513.No See Sx ZFS I/O SCHEDULER .
1514.
1515.It Sy zfs_vdev_scrub_min_active Ns = Ns Sy 1 Pq uint
1516Minimum scrub I/O operations active to each device.
1517.No See Sx ZFS I/O SCHEDULER .
1518.
1519.It Sy zfs_vdev_sync_read_max_active Ns = Ns Sy 10 Pq uint
1520Maximum synchronous read I/O operations active to each device.
1521.No See Sx ZFS I/O SCHEDULER .
1522.
1523.It Sy zfs_vdev_sync_read_min_active Ns = Ns Sy 10 Pq uint
1524Minimum synchronous read I/O operations active to each device.
1525.No See Sx ZFS I/O SCHEDULER .
1526.
1527.It Sy zfs_vdev_sync_write_max_active Ns = Ns Sy 10 Pq uint
1528Maximum synchronous write I/O operations active to each device.
1529.No See Sx ZFS I/O SCHEDULER .
1530.
1531.It Sy zfs_vdev_sync_write_min_active Ns = Ns Sy 10 Pq uint
1532Minimum synchronous write I/O operations active to each device.
1533.No See Sx ZFS I/O SCHEDULER .
1534.
1535.It Sy zfs_vdev_trim_max_active Ns = Ns Sy 2 Pq uint
1536Maximum trim/discard I/O operations active to each device.
1537.No See Sx ZFS I/O SCHEDULER .
1538.
1539.It Sy zfs_vdev_trim_min_active Ns = Ns Sy 1 Pq uint
1540Minimum trim/discard I/O operations active to each device.
1541.No See Sx ZFS I/O SCHEDULER .
1542.
1543.It Sy zfs_vdev_nia_delay Ns = Ns Sy 5 Pq uint
1544For non-interactive I/O (scrub, resilver, removal, initialize and rebuild),
1545the number of concurrently-active I/O operations is limited to
1546.Sy zfs_*_min_active ,
1547unless the vdev is "idle".
1548When there are no interactive I/O operations active (synchronous or otherwise),
1549and
1550.Sy zfs_vdev_nia_delay
1551operations have completed since the last interactive operation,
1552then the vdev is considered to be "idle",
1553and the number of concurrently-active non-interactive operations is increased to
1554.Sy zfs_*_max_active .
1555.No See Sx ZFS I/O SCHEDULER .
1556.
1557.It Sy zfs_vdev_nia_credit Ns = Ns Sy 5 Pq uint
1558Some HDDs tend to prioritize sequential I/O so strongly, that concurrent
1559random I/O latency reaches several seconds.
1560On some HDDs this happens even if sequential I/O operations
1561are submitted one at a time, and so setting
1562.Sy zfs_*_max_active Ns = Sy 1
1563does not help.
1564To prevent non-interactive I/O, like scrub,
1565from monopolizing the device, no more than
1566.Sy zfs_vdev_nia_credit operations can be sent
1567while there are outstanding incomplete interactive operations.
1568This enforced wait ensures the HDD services the interactive I/O
1569within a reasonable amount of time.
1570.No See Sx ZFS I/O SCHEDULER .
1571.
1572.It Sy zfs_vdev_failfast_mask Ns = Ns Sy 1 Pq uint
1573Defines if the driver should retire on a given error type.
1574The following options may be bitwise-ored together:
1575.TS
1576box;
1577lbz r l l .
1578	Value	Name	Description
1579_
1580	1	Device	No driver retries on device errors
1581	2	Transport	No driver retries on transport errors.
1582	4	Driver	No driver retries on driver errors.
1583.TE
1584.
1585.It Sy zfs_vdev_disk_max_segs Ns = Ns Sy 0 Pq uint
1586Maximum number of segments to add to a BIO (min 4).
1587If this is higher than the maximum allowed by the device queue or the kernel
1588itself, it will be clamped.
1589Setting it to zero will cause the kernel's ideal size to be used.
1590This parameter only applies on Linux.
1591.
1592.It Sy zfs_expire_snapshot Ns = Ns Sy 300 Ns s Pq int
1593Time before expiring
1594.Pa .zfs/snapshot .
1595.
1596.It Sy zfs_admin_snapshot Ns = Ns Sy 0 Ns | Ns 1 Pq int
1597Allow the creation, removal, or renaming of entries in the
1598.Sy .zfs/snapshot
1599directory to cause the creation, destruction, or renaming of snapshots.
1600When enabled, this functionality works both locally and over NFS exports
1601which have the
1602.Em no_root_squash
1603option set.
1604.
1605.It Sy zfs_snapshot_no_setuid Ns = Ns Sy 0 Ns | Ns 1 Pq int
1606Whether to disable
1607.Em setuid/setgid
1608support for snapshot mounts triggered by access to the
1609.Sy .zfs/snapshot
1610directory by setting the
1611.Em nosuid
1612mount option.
1613.
1614.It Sy zfs_flags Ns = Ns Sy 0 Pq int
1615Set additional debugging flags.
1616The following flags may be bitwise-ored together:
1617.TS
1618box;
1619lbz r l l .
1620	Value	Name	Description
1621_
1622	1	ZFS_DEBUG_DPRINTF	Enable dprintf entries in the debug log.
1623*	2	ZFS_DEBUG_DBUF_VERIFY	Enable extra dbuf verifications.
1624*	4	ZFS_DEBUG_DNODE_VERIFY	Enable extra dnode verifications.
1625	8	ZFS_DEBUG_SNAPNAMES	Enable snapshot name verification.
1626*	16	ZFS_DEBUG_MODIFY	Check for illegally modified ARC buffers.
1627	64	ZFS_DEBUG_ZIO_FREE	Enable verification of block frees.
1628	128	ZFS_DEBUG_HISTOGRAM_VERIFY	Enable extra spacemap histogram verifications.
1629	256	ZFS_DEBUG_METASLAB_VERIFY	Verify space accounting on disk matches in-memory \fBrange_trees\fP.
1630	512	ZFS_DEBUG_SET_ERROR	Enable \fBSET_ERROR\fP and dprintf entries in the debug log.
1631	1024	ZFS_DEBUG_INDIRECT_REMAP	Verify split blocks created by device removal.
1632	2048	ZFS_DEBUG_TRIM	Verify TRIM ranges are always within the allocatable range tree.
1633	4096	ZFS_DEBUG_LOG_SPACEMAP	Verify that the log summary is consistent with the spacemap log
1634			       and enable \fBzfs_dbgmsgs\fP for metaslab loading and flushing.
1635	8192	ZFS_DEBUG_METASLAB_ALLOC	Enable debugging messages when allocations fail.
1636	16384	ZFS_DEBUG_BRT	Enable BRT-related debugging messages.
1637	32768	ZFS_DEBUG_RAIDZ_RECONSTRUCT	Enabled debugging messages for raidz reconstruction.
1638	65536	ZFS_DEBUG_DDT	Enable DDT-related debugging messages.
1639.TE
1640.Sy \& * No Requires debug build .
1641.
1642.It Sy zfs_btree_verify_intensity Ns = Ns Sy 0 Pq uint
1643Enables btree verification.
1644The following settings are cumulative:
1645.TS
1646box;
1647lbz r l l .
1648	Value	Description
1649
1650	1	Verify height.
1651	2	Verify pointers from children to parent.
1652	3	Verify element counts.
1653	4	Verify element order. (expensive)
1654*	5	Verify unused memory is poisoned. (expensive)
1655.TE
1656.Sy \& * No Requires debug build .
1657.
1658.It Sy zfs_free_leak_on_eio Ns = Ns Sy 0 Ns | Ns 1 Pq int
1659If destroy encounters an
1660.Sy EIO
1661while reading metadata (e.g. indirect blocks),
1662space referenced by the missing metadata can not be freed.
1663Normally this causes the background destroy to become "stalled",
1664as it is unable to make forward progress.
1665While in this stalled state, all remaining space to free
1666from the error-encountering filesystem is "temporarily leaked".
1667Set this flag to cause it to ignore the
1668.Sy EIO ,
1669permanently leak the space from indirect blocks that can not be read,
1670and continue to free everything else that it can.
1671.Pp
1672The default "stalling" behavior is useful if the storage partially
1673fails (i.e. some but not all I/O operations fail), and then later recovers.
1674In this case, we will be able to continue pool operations while it is
1675partially failed, and when it recovers, we can continue to free the
1676space, with no leaks.
1677Note, however, that this case is actually fairly rare.
1678.Pp
1679Typically pools either
1680.Bl -enum -compact -offset 4n -width "1."
1681.It
1682fail completely (but perhaps temporarily,
1683e.g. due to a top-level vdev going offline), or
1684.It
1685have localized, permanent errors (e.g. disk returns the wrong data
1686due to bit flip or firmware bug).
1687.El
1688In the former case, this setting does not matter because the
1689pool will be suspended and the sync thread will not be able to make
1690forward progress regardless.
1691In the latter, because the error is permanent, the best we can do
1692is leak the minimum amount of space,
1693which is what setting this flag will do.
1694It is therefore reasonable for this flag to normally be set,
1695but we chose the more conservative approach of not setting it,
1696so that there is no possibility of
1697leaking space in the "partial temporary" failure case.
1698.
1699.It Sy zfs_free_min_time_ms Ns = Ns Sy 1000 Ns ms Po 1s Pc Pq uint
1700During a
1701.Nm zfs Cm destroy
1702operation using the
1703.Sy async_destroy
1704feature,
1705a minimum of this much time will be spent working on freeing blocks per TXG.
1706.
1707.It Sy zfs_obsolete_min_time_ms Ns = Ns Sy 500 Ns ms Pq uint
1708Similar to
1709.Sy zfs_free_min_time_ms ,
1710but for cleanup of old indirection records for removed vdevs.
1711.
1712.It Sy zfs_immediate_write_sz Ns = Ns Sy 32768 Ns B Po 32 KiB Pc Pq s64
1713Largest write size to store the data directly into the ZIL if
1714.Sy logbias Ns = Ns Sy latency .
1715Larger writes may be written indirectly similar to
1716.Sy logbias Ns = Ns Sy throughput .
1717In presence of SLOG this parameter is ignored, as if it was set to infinity,
1718storing all written data into ZIL to not depend on regular vdev latency.
1719.
1720.It Sy zil_special_is_slog Ns = Ns Sy 1 Ns | Ns 0 Pq int
1721When enabled, and written blocks go to normal vdevs, treat present special
1722vdevs as SLOGs.
1723Blocks that go to the special vdevs are still written indirectly, as with
1724.Sy logbias Ns = Ns Sy throughput .
1725This parameter is ignored if an SLOG is present.
1726.
1727.It Sy zfs_initialize_value Ns = Ns Sy 16045690984833335022 Po 0xDEADBEEFDEADBEEE Pc Pq u64
1728Pattern written to vdev free space by
1729.Xr zpool-initialize 8 .
1730.
1731.It Sy zfs_initialize_chunk_size Ns = Ns Sy 1048576 Ns B Po 1 MiB Pc Pq u64
1732Size of writes used by
1733.Xr zpool-initialize 8 .
1734This option is used by the test suite.
1735.
1736.It Sy zfs_livelist_max_entries Ns = Ns Sy 500000 Po 5*10^5 Pc Pq u64
1737The threshold size (in block pointers) at which we create a new sub-livelist.
1738Larger sublists are more costly from a memory perspective but the fewer
1739sublists there are, the lower the cost of insertion.
1740.
1741.It Sy zfs_livelist_min_percent_shared Ns = Ns Sy 75 Ns % Pq int
1742If the amount of shared space between a snapshot and its clone drops below
1743this threshold, the clone turns off the livelist and reverts to the old
1744deletion method.
1745This is in place because livelists no long give us a benefit
1746once a clone has been overwritten enough.
1747.
1748.It Sy zfs_livelist_condense_new_alloc Ns = Ns Sy 0 Pq int
1749Incremented each time an extra ALLOC blkptr is added to a livelist entry while
1750it is being condensed.
1751This option is used by the test suite to track race conditions.
1752.
1753.It Sy zfs_livelist_condense_sync_cancel Ns = Ns Sy 0 Pq int
1754Incremented each time livelist condensing is canceled while in
1755.Fn spa_livelist_condense_sync .
1756This option is used by the test suite to track race conditions.
1757.
1758.It Sy zfs_livelist_condense_sync_pause Ns = Ns Sy 0 Ns | Ns 1 Pq int
1759When set, the livelist condense process pauses indefinitely before
1760executing the synctask \(em
1761.Fn spa_livelist_condense_sync .
1762This option is used by the test suite to trigger race conditions.
1763.
1764.It Sy zfs_livelist_condense_zthr_cancel Ns = Ns Sy 0 Pq int
1765Incremented each time livelist condensing is canceled while in
1766.Fn spa_livelist_condense_cb .
1767This option is used by the test suite to track race conditions.
1768.
1769.It Sy zfs_livelist_condense_zthr_pause Ns = Ns Sy 0 Ns | Ns 1 Pq int
1770When set, the livelist condense process pauses indefinitely before
1771executing the open context condensing work in
1772.Fn spa_livelist_condense_cb .
1773This option is used by the test suite to trigger race conditions.
1774.
1775.It Sy zfs_lua_max_instrlimit Ns = Ns Sy 100000000 Po 10^8 Pc Pq u64
1776The maximum execution time limit that can be set for a ZFS channel program,
1777specified as a number of Lua instructions.
1778.
1779.It Sy zfs_lua_max_memlimit Ns = Ns Sy 104857600 Po 100 MiB Pc Pq u64
1780The maximum memory limit that can be set for a ZFS channel program, specified
1781in bytes.
1782.
1783.It Sy zfs_max_dataset_nesting Ns = Ns Sy 50 Pq int
1784The maximum depth of nested datasets.
1785This value can be tuned temporarily to
1786fix existing datasets that exceed the predefined limit.
1787.
1788.It Sy zfs_max_log_walking Ns = Ns Sy 5 Pq u64
1789The number of past TXGs that the flushing algorithm of the log spacemap
1790feature uses to estimate incoming log blocks.
1791.
1792.It Sy zfs_max_logsm_summary_length Ns = Ns Sy 10 Pq u64
1793Maximum number of rows allowed in the summary of the spacemap log.
1794.
1795.It Sy zfs_max_recordsize Ns = Ns Sy 16777216 Po 16 MiB Pc Pq uint
1796We currently support block sizes from
1797.Em 512 Po 512 B Pc No to Em 16777216 Po 16 MiB Pc .
1798The benefits of larger blocks, and thus larger I/O,
1799need to be weighed against the cost of COWing a giant block to modify one byte.
1800Additionally, very large blocks can have an impact on I/O latency,
1801and also potentially on the memory allocator.
1802Therefore, we formerly forbade creating blocks larger than 1M.
1803Larger blocks could be created by changing it,
1804and pools with larger blocks can always be imported and used,
1805regardless of this setting.
1806.Pp
1807Note that it is still limited by default to
1808.Ar 1 MiB
1809on x86_32, because Linux's
18103/1 memory split doesn't leave much room for 16M chunks.
1811.
1812.It Sy zfs_allow_redacted_dataset_mount Ns = Ns Sy 0 Ns | Ns 1 Pq int
1813Allow datasets received with redacted send/receive to be mounted.
1814Normally disabled because these datasets may be missing key data.
1815.
1816.It Sy zfs_min_metaslabs_to_flush Ns = Ns Sy 1 Pq u64
1817Minimum number of metaslabs to flush per dirty TXG.
1818.
1819.It Sy zfs_metaslab_fragmentation_threshold Ns = Ns Sy 77 Ns % Pq uint
1820Allow metaslabs to keep their active state as long as their fragmentation
1821percentage is no more than this value.
1822An active metaslab that exceeds this threshold
1823will no longer keep its active status allowing better metaslabs to be selected.
1824.
1825.It Sy zfs_mg_fragmentation_threshold Ns = Ns Sy 95 Ns % Pq uint
1826Metaslab groups are considered eligible for allocations if their
1827fragmentation metric (measured as a percentage) is less than or equal to
1828this value.
1829If a metaslab group exceeds this threshold then it will be
1830skipped unless all metaslab groups within the metaslab class have also
1831crossed this threshold.
1832.
1833.It Sy zfs_mg_noalloc_threshold Ns = Ns Sy 0 Ns % Pq uint
1834Defines a threshold at which metaslab groups should be eligible for allocations.
1835The value is expressed as a percentage of free space
1836beyond which a metaslab group is always eligible for allocations.
1837If a metaslab group's free space is less than or equal to the
1838threshold, the allocator will avoid allocating to that group
1839unless all groups in the pool have reached the threshold.
1840Once all groups have reached the threshold, all groups are allowed to accept
1841allocations.
1842The default value of
1843.Sy 0
1844disables the feature and causes all metaslab groups to be eligible for
1845allocations.
1846.Pp
1847This parameter allows one to deal with pools having heavily imbalanced
1848vdevs such as would be the case when a new vdev has been added.
1849Setting the threshold to a non-zero percentage will stop allocations
1850from being made to vdevs that aren't filled to the specified percentage
1851and allow lesser filled vdevs to acquire more allocations than they
1852otherwise would under the old
1853.Sy zfs_mg_alloc_failures
1854facility.
1855.
1856.It Sy zfs_ddt_data_is_special Ns = Ns Sy 1 Ns | Ns 0 Pq int
1857If enabled, ZFS will place DDT data into the special allocation class.
1858.
1859.It Sy zfs_user_indirect_is_special Ns = Ns Sy 1 Ns | Ns 0 Pq int
1860If enabled, ZFS will place user data indirect blocks
1861into the special allocation class.
1862.
1863.It Sy zfs_multihost_history Ns = Ns Sy 0 Pq uint
1864Historical statistics for this many latest multihost updates will be available
1865in
1866.Pa /proc/spl/kstat/zfs/ Ns Ao Ar pool Ac Ns Pa /multihost .
1867.
1868.It Sy zfs_multihost_interval Ns = Ns Sy 1000 Ns ms Po 1 s Pc Pq u64
1869Used to control the frequency of multihost writes which are performed when the
1870.Sy multihost
1871pool property is on.
1872This is one of the factors used to determine the
1873length of the activity check during import.
1874.Pp
1875The multihost write period is
1876.Sy zfs_multihost_interval No / Sy leaf-vdevs .
1877On average a multihost write will be issued for each leaf vdev
1878every
1879.Sy zfs_multihost_interval
1880milliseconds.
1881In practice, the observed period can vary with the I/O load
1882and this observed value is the delay which is stored in the uberblock.
1883.
1884.It Sy zfs_multihost_import_intervals Ns = Ns Sy 20 Pq uint
1885Used to control the duration of the activity test on import.
1886Smaller values of
1887.Sy zfs_multihost_import_intervals
1888will reduce the import time but increase
1889the risk of failing to detect an active pool.
1890The total activity check time is never allowed to drop below one second.
1891.Pp
1892On import the activity check waits a minimum amount of time determined by
1893.Sy zfs_multihost_interval No \(mu Sy zfs_multihost_import_intervals ,
1894or the same product computed on the host which last had the pool imported,
1895whichever is greater.
1896The activity check time may be further extended if the value of MMP
1897delay found in the best uberblock indicates actual multihost updates happened
1898at longer intervals than
1899.Sy zfs_multihost_interval .
1900A minimum of
1901.Em 100 ms
1902is enforced.
1903.Pp
1904.Sy 0 No is equivalent to Sy 1 .
1905.
1906.It Sy zfs_multihost_fail_intervals Ns = Ns Sy 10 Pq uint
1907Controls the behavior of the pool when multihost write failures or delays are
1908detected.
1909.Pp
1910When
1911.Sy 0 ,
1912multihost write failures or delays are ignored.
1913The failures will still be reported to the ZED which depending on
1914its configuration may take action such as suspending the pool or offlining a
1915device.
1916.Pp
1917Otherwise, the pool will be suspended if
1918.Sy zfs_multihost_fail_intervals No \(mu Sy zfs_multihost_interval
1919milliseconds pass without a successful MMP write.
1920This guarantees the activity test will see MMP writes if the pool is imported.
1921.Sy 1 No is equivalent to Sy 2 ;
1922this is necessary to prevent the pool from being suspended
1923due to normal, small I/O latency variations.
1924.
1925.It Sy zfs_no_scrub_io Ns = Ns Sy 0 Ns | Ns 1 Pq int
1926Set to disable scrub I/O.
1927This results in scrubs not actually scrubbing data and
1928simply doing a metadata crawl of the pool instead.
1929.
1930.It Sy zfs_no_scrub_prefetch Ns = Ns Sy 0 Ns | Ns 1 Pq int
1931Set to disable block prefetching for scrubs.
1932.
1933.It Sy zfs_nocacheflush Ns = Ns Sy 0 Ns | Ns 1 Pq int
1934Disable cache flush operations on disks when writing.
1935Setting this will cause pool corruption on power loss
1936if a volatile out-of-order write cache is enabled.
1937.
1938.It Sy zfs_nopwrite_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int
1939Allow no-operation writes.
1940The occurrence of nopwrites will further depend on other pool properties
1941.Pq i.a. the checksumming and compression algorithms .
1942.
1943.It Sy zfs_dmu_offset_next_sync Ns = Ns Sy 1 Ns | Ns 0 Pq int
1944Enable forcing TXG sync to find holes.
1945When enabled forces ZFS to sync data when
1946.Sy SEEK_HOLE No or Sy SEEK_DATA
1947flags are used allowing holes in a file to be accurately reported.
1948When disabled holes will not be reported in recently dirtied files.
1949.
1950.It Sy zfs_pd_bytes_max Ns = Ns Sy 52428800 Ns B Po 50 MiB Pc Pq int
1951The number of bytes which should be prefetched during a pool traversal, like
1952.Nm zfs Cm send
1953or other data crawling operations.
1954.
1955.It Sy zfs_traverse_indirect_prefetch_limit Ns = Ns Sy 32 Pq uint
1956The number of blocks pointed by indirect (non-L0) block which should be
1957prefetched during a pool traversal, like
1958.Nm zfs Cm send
1959or other data crawling operations.
1960.
1961.It Sy zfs_per_txg_dirty_frees_percent Ns = Ns Sy 30 Ns % Pq u64
1962Control percentage of dirtied indirect blocks from frees allowed into one TXG.
1963After this threshold is crossed, additional frees will wait until the next TXG.
1964.Sy 0 No disables this throttle .
1965.
1966.It Sy zfs_prefetch_disable Ns = Ns Sy 0 Ns | Ns 1 Pq int
1967Disable predictive prefetch.
1968Note that it leaves "prescient" prefetch
1969.Pq for, e.g., Nm zfs Cm send
1970intact.
1971Unlike predictive prefetch, prescient prefetch never issues I/O
1972that ends up not being needed, so it can't hurt performance.
1973.
1974.It Sy zfs_qat_checksum_disable Ns = Ns Sy 0 Ns | Ns 1 Pq int
1975Disable QAT hardware acceleration for SHA256 checksums.
1976May be unset after the ZFS modules have been loaded to initialize the QAT
1977hardware as long as support is compiled in and the QAT driver is present.
1978.
1979.It Sy zfs_qat_compress_disable Ns = Ns Sy 0 Ns | Ns 1 Pq int
1980Disable QAT hardware acceleration for gzip compression.
1981May be unset after the ZFS modules have been loaded to initialize the QAT
1982hardware as long as support is compiled in and the QAT driver is present.
1983.
1984.It Sy zfs_qat_encrypt_disable Ns = Ns Sy 0 Ns | Ns 1 Pq int
1985Disable QAT hardware acceleration for AES-GCM encryption.
1986May be unset after the ZFS modules have been loaded to initialize the QAT
1987hardware as long as support is compiled in and the QAT driver is present.
1988.
1989.It Sy zfs_vnops_read_chunk_size Ns = Ns Sy 33554432 Ns B Po 32 MiB Pc Pq u64
1990Bytes to read per chunk.
1991.
1992.It Sy zfs_read_history Ns = Ns Sy 0 Pq uint
1993Historical statistics for this many latest reads will be available in
1994.Pa /proc/spl/kstat/zfs/ Ns Ao Ar pool Ac Ns Pa /reads .
1995.
1996.It Sy zfs_read_history_hits Ns = Ns Sy 0 Ns | Ns 1 Pq int
1997Include cache hits in read history
1998.
1999.It Sy zfs_rebuild_max_segment Ns = Ns Sy 1048576 Ns B Po 1 MiB Pc Pq u64
2000Maximum read segment size to issue when sequentially resilvering a
2001top-level vdev.
2002.
2003.It Sy zfs_rebuild_scrub_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int
2004Automatically start a pool scrub when the last active sequential resilver
2005completes in order to verify the checksums of all blocks which have been
2006resilvered.
2007This is enabled by default and strongly recommended.
2008.
2009.It Sy zfs_rebuild_vdev_limit Ns = Ns Sy 67108864 Ns B Po 64 MiB Pc Pq u64
2010Maximum amount of I/O that can be concurrently issued for a sequential
2011resilver per leaf device, given in bytes.
2012.
2013.It Sy zfs_reconstruct_indirect_combinations_max Ns = Ns Sy 4096 Pq int
2014If an indirect split block contains more than this many possible unique
2015combinations when being reconstructed, consider it too computationally
2016expensive to check them all.
2017Instead, try at most this many randomly selected
2018combinations each time the block is accessed.
2019This allows all segment copies to participate fairly
2020in the reconstruction when all combinations
2021cannot be checked and prevents repeated use of one bad copy.
2022.
2023.It Sy zfs_recover Ns = Ns Sy 0 Ns | Ns 1 Pq int
2024Set to attempt to recover from fatal errors.
2025This should only be used as a last resort,
2026as it typically results in leaked space, or worse.
2027.
2028.It Sy zfs_removal_ignore_errors Ns = Ns Sy 0 Ns | Ns 1 Pq int
2029Ignore hard I/O errors during device removal.
2030When set, if a device encounters a hard I/O error during the removal process
2031the removal will not be canceled.
2032This can result in a normally recoverable block becoming permanently damaged
2033and is hence not recommended.
2034This should only be used as a last resort when the
2035pool cannot be returned to a healthy state prior to removing the device.
2036.
2037.It Sy zfs_removal_suspend_progress Ns = Ns Sy 0 Ns | Ns 1 Pq uint
2038This is used by the test suite so that it can ensure that certain actions
2039happen while in the middle of a removal.
2040.
2041.It Sy zfs_remove_max_segment Ns = Ns Sy 16777216 Ns B Po 16 MiB Pc Pq uint
2042The largest contiguous segment that we will attempt to allocate when removing
2043a device.
2044If there is a performance problem with attempting to allocate large blocks,
2045consider decreasing this.
2046The default value is also the maximum.
2047.
2048.It Sy zfs_resilver_disable_defer Ns = Ns Sy 0 Ns | Ns 1 Pq int
2049Ignore the
2050.Sy resilver_defer
2051feature, causing an operation that would start a resilver to
2052immediately restart the one in progress.
2053.
2054.It Sy zfs_resilver_defer_percent Ns = Ns Sy 10 Ns % Pq uint
2055If the ongoing resilver progress is below this threshold, a new resilver will
2056restart from scratch instead of being deferred after the current one finishes,
2057even if the
2058.Sy resilver_defer
2059feature is enabled.
2060.
2061.It Sy zfs_resilver_min_time_ms Ns = Ns Sy 3000 Ns ms Po 3 s Pc Pq uint
2062Resilvers are processed by the sync thread.
2063While resilvering, it will spend at least this much time
2064working on a resilver between TXG flushes.
2065.
2066.It Sy zfs_scan_ignore_errors Ns = Ns Sy 0 Ns | Ns 1 Pq int
2067If set, remove the DTL (dirty time list) upon completion of a pool scan (scrub),
2068even if there were unrepairable errors.
2069Intended to be used during pool repair or recovery to
2070stop resilvering when the pool is next imported.
2071.
2072.It Sy zfs_scrub_after_expand Ns = Ns Sy 1 Ns | Ns 0 Pq int
2073Automatically start a pool scrub after a RAIDZ expansion completes
2074in order to verify the checksums of all blocks which have been
2075copied during the expansion.
2076This is enabled by default and strongly recommended.
2077.
2078.It Sy zfs_scrub_min_time_ms Ns = Ns Sy 1000 Ns ms Po 1 s Pc Pq uint
2079Scrubs are processed by the sync thread.
2080While scrubbing, it will spend at least this much time
2081working on a scrub between TXG flushes.
2082.
2083.It Sy zfs_scrub_error_blocks_per_txg Ns = Ns Sy 4096 Pq uint
2084Error blocks to be scrubbed in one txg.
2085.
2086.It Sy zfs_scan_checkpoint_intval Ns = Ns Sy 7200 Ns s Po 2 hour Pc Pq uint
2087To preserve progress across reboots, the sequential scan algorithm periodically
2088needs to stop metadata scanning and issue all the verification I/O to disk.
2089The frequency of this flushing is determined by this tunable.
2090.
2091.It Sy zfs_scan_fill_weight Ns = Ns Sy 3 Pq uint
2092This tunable affects how scrub and resilver I/O segments are ordered.
2093A higher number indicates that we care more about how filled in a segment is,
2094while a lower number indicates we care more about the size of the extent without
2095considering the gaps within a segment.
2096This value is only tunable upon module insertion.
2097Changing the value afterwards will have no effect on scrub or resilver
2098performance.
2099.
2100.It Sy zfs_scan_issue_strategy Ns = Ns Sy 0 Pq uint
2101Determines the order that data will be verified while scrubbing or resilvering:
2102.Bl -tag -compact -offset 4n -width "a"
2103.It Sy 1
2104Data will be verified as sequentially as possible, given the
2105amount of memory reserved for scrubbing
2106.Pq see Sy zfs_scan_mem_lim_fact .
2107This may improve scrub performance if the pool's data is very fragmented.
2108.It Sy 2
2109The largest mostly-contiguous chunk of found data will be verified first.
2110By deferring scrubbing of small segments, we may later find adjacent data
2111to coalesce and increase the segment size.
2112.It Sy 0
2113.No Use strategy Sy 1 No during normal verification
2114.No and strategy Sy 2 No while taking a checkpoint .
2115.El
2116.
2117.It Sy zfs_scan_legacy Ns = Ns Sy 0 Ns | Ns 1 Pq int
2118If unset, indicates that scrubs and resilvers will gather metadata in
2119memory before issuing sequential I/O.
2120Otherwise indicates that the legacy algorithm will be used,
2121where I/O is initiated as soon as it is discovered.
2122Unsetting will not affect scrubs or resilvers that are already in progress.
2123.
2124.It Sy zfs_scan_max_ext_gap Ns = Ns Sy 2097152 Ns B Po 2 MiB Pc Pq int
2125Sets the largest gap in bytes between scrub/resilver I/O operations
2126that will still be considered sequential for sorting purposes.
2127Changing this value will not
2128affect scrubs or resilvers that are already in progress.
2129.
2130.It Sy zfs_scan_mem_lim_fact Ns = Ns Sy 20 Ns ^-1 Pq uint
2131Maximum fraction of RAM used for I/O sorting by sequential scan algorithm.
2132This tunable determines the hard limit for I/O sorting memory usage.
2133When the hard limit is reached we stop scanning metadata and start issuing
2134data verification I/O.
2135This is done until we get below the soft limit.
2136.
2137.It Sy zfs_scan_mem_lim_soft_fact Ns = Ns Sy 20 Ns ^-1 Pq uint
2138The fraction of the hard limit used to determined the soft limit for I/O sorting
2139by the sequential scan algorithm.
2140When we cross this limit from below no action is taken.
2141When we cross this limit from above it is because we are issuing verification
2142I/O.
2143In this case (unless the metadata scan is done) we stop issuing verification I/O
2144and start scanning metadata again until we get to the hard limit.
2145.
2146.It Sy zfs_scan_report_txgs Ns = Ns Sy 0 Ns | Ns 1 Pq uint
2147When reporting resilver throughput and estimated completion time use the
2148performance observed over roughly the last
2149.Sy zfs_scan_report_txgs
2150TXGs.
2151When set to zero performance is calculated over the time between checkpoints.
2152.
2153.It Sy zfs_scan_strict_mem_lim Ns = Ns Sy 0 Ns | Ns 1 Pq int
2154Enforce tight memory limits on pool scans when a sequential scan is in progress.
2155When disabled, the memory limit may be exceeded by fast disks.
2156.
2157.It Sy zfs_scan_suspend_progress Ns = Ns Sy 0 Ns | Ns 1 Pq int
2158Freezes a scrub/resilver in progress without actually pausing it.
2159Intended for testing/debugging.
2160.
2161.It Sy zfs_scan_vdev_limit Ns = Ns Sy 16777216 Ns B Po 16 MiB Pc Pq int
2162Maximum amount of data that can be concurrently issued at once for scrubs and
2163resilvers per leaf device, given in bytes.
2164.
2165.It Sy zfs_send_corrupt_data Ns = Ns Sy 0 Ns | Ns 1 Pq int
2166Allow sending of corrupt data (ignore read/checksum errors when sending).
2167.
2168.It Sy zfs_send_unmodified_spill_blocks Ns = Ns Sy 1 Ns | Ns 0 Pq int
2169Include unmodified spill blocks in the send stream.
2170Under certain circumstances, previous versions of ZFS could incorrectly
2171remove the spill block from an existing object.
2172Including unmodified copies of the spill blocks creates a backwards-compatible
2173stream which will recreate a spill block if it was incorrectly removed.
2174.
2175.It Sy zfs_send_no_prefetch_queue_ff Ns = Ns Sy 20 Ns ^\-1 Pq uint
2176The fill fraction of the
2177.Nm zfs Cm send
2178internal queues.
2179The fill fraction controls the timing with which internal threads are woken up.
2180.
2181.It Sy zfs_send_no_prefetch_queue_length Ns = Ns Sy 1048576 Ns B Po 1 MiB Pc Pq uint
2182The maximum number of bytes allowed in
2183.Nm zfs Cm send Ns 's
2184internal queues.
2185.
2186.It Sy zfs_send_queue_ff Ns = Ns Sy 20 Ns ^\-1 Pq uint
2187The fill fraction of the
2188.Nm zfs Cm send
2189prefetch queue.
2190The fill fraction controls the timing with which internal threads are woken up.
2191.
2192.It Sy zfs_send_queue_length Ns = Ns Sy 16777216 Ns B Po 16 MiB Pc Pq uint
2193The maximum number of bytes allowed that will be prefetched by
2194.Nm zfs Cm send .
2195This value must be at least twice the maximum block size in use.
2196.
2197.It Sy zfs_recv_queue_ff Ns = Ns Sy 20 Ns ^\-1 Pq uint
2198The fill fraction of the
2199.Nm zfs Cm receive
2200queue.
2201The fill fraction controls the timing with which internal threads are woken up.
2202.
2203.It Sy zfs_recv_queue_length Ns = Ns Sy 16777216 Ns B Po 16 MiB Pc Pq uint
2204The maximum number of bytes allowed in the
2205.Nm zfs Cm receive
2206queue.
2207This value must be at least twice the maximum block size in use.
2208.
2209.It Sy zfs_recv_write_batch_size Ns = Ns Sy 1048576 Ns B Po 1 MiB Pc Pq uint
2210The maximum amount of data, in bytes, that
2211.Nm zfs Cm receive
2212will write in one DMU transaction.
2213This is the uncompressed size, even when receiving a compressed send stream.
2214This setting will not reduce the write size below a single block.
2215Capped at a maximum of
2216.Sy 32 MiB .
2217.
2218.It Sy zfs_recv_best_effort_corrective Ns = Ns Sy 0 Pq int
2219When this variable is set to non-zero a corrective receive:
2220.Bl -enum -compact -offset 4n -width "1."
2221.It
2222Does not enforce the restriction of source & destination snapshot GUIDs
2223matching.
2224.It
2225If there is an error during healing, the healing receive is not
2226terminated instead it moves on to the next record.
2227.El
2228.
2229.It Sy zfs_override_estimate_recordsize Ns = Ns Sy 0 Ns | Ns 1 Pq uint
2230Setting this variable overrides the default logic for estimating block
2231sizes when doing a
2232.Nm zfs Cm send .
2233The default heuristic is that the average block size
2234will be the current recordsize.
2235Override this value if most data in your dataset is not of that size
2236and you require accurate zfs send size estimates.
2237.
2238.It Sy zfs_sync_pass_deferred_free Ns = Ns Sy 2 Pq uint
2239Flushing of data to disk is done in passes.
2240Defer frees starting in this pass.
2241.
2242.It Sy zfs_spa_discard_memory_limit Ns = Ns Sy 16777216 Ns B Po 16 MiB Pc Pq int
2243Maximum memory used for prefetching a checkpoint's space map on each
2244vdev while discarding the checkpoint.
2245.
2246.It Sy zfs_spa_note_txg_time Ns = Ns Sy 600 Pq uint
2247This parameter defines, in seconds, how often the TXG time database will record
2248a new TXG if it has changed.
2249After the specified time interval has passed, and if the TXG number has changed,
2250the new value is recorded in the database.
2251These timestamps can later be used for more granular operations, such as
2252scrubbing.
2253.
2254.It Sy zfs_spa_flush_txg_time Ns = Ns Sy 600 Pq uint
2255This parameter defines, in seconds, how often the ZFS will flush
2256the TXG time database to disk.
2257It ensures that the data is actually written to persistent storage, which helps
2258preserve the database in case of unexpected shutdown.
2259The database is also automatically flushed during the export sequence.
2260.
2261.It Sy zfs_special_class_metadata_reserve_pct Ns = Ns Sy 25 Ns % Pq uint
2262Only allow small data blocks to be allocated on the special and dedup vdev
2263types when the available free space percentage on these vdevs exceeds this
2264value.
2265This ensures reserved space is available for pool metadata as the
2266special vdevs approach capacity.
2267.
2268.It Sy zfs_sync_pass_dont_compress Ns = Ns Sy 8 Pq uint
2269Starting in this sync pass, disable compression (including of metadata).
2270With the default setting, in practice, we don't have this many sync passes,
2271so this has no effect.
2272.Pp
2273The original intent was that disabling compression would help the sync passes
2274to converge.
2275However, in practice, disabling compression increases
2276the average number of sync passes; because when we turn compression off,
2277many blocks' size will change, and thus we have to re-allocate
2278(not overwrite) them.
2279It also increases the number of
2280.Em 128 KiB
2281allocations (e.g. for indirect blocks and spacemaps)
2282because these will not be compressed.
2283The
2284.Em 128 KiB
2285allocations are especially detrimental to performance
2286on highly fragmented systems, which may have very few free segments of this
2287size,
2288and may need to load new metaslabs to satisfy these allocations.
2289.
2290.It Sy zfs_sync_pass_rewrite Ns = Ns Sy 2 Pq uint
2291Rewrite new block pointers starting in this pass.
2292.
2293.It Sy zfs_trim_extent_bytes_max Ns = Ns Sy 134217728 Ns B Po 128 MiB Pc Pq uint
2294Maximum size of TRIM command.
2295Larger ranges will be split into chunks no larger than this value before
2296issuing.
2297.
2298.It Sy zfs_trim_extent_bytes_min Ns = Ns Sy 32768 Ns B Po 32 KiB Pc Pq uint
2299Minimum size of TRIM commands.
2300TRIM ranges smaller than this will be skipped,
2301unless they're part of a larger range which was chunked.
2302This is done because it's common for these small TRIMs
2303to negatively impact overall performance.
2304.
2305.It Sy zfs_trim_metaslab_skip Ns = Ns Sy 0 Ns | Ns 1 Pq uint
2306Skip uninitialized metaslabs during the TRIM process.
2307This option is useful for pools constructed from large thinly-provisioned
2308devices
2309where TRIM operations are slow.
2310As a pool ages, an increasing fraction of the pool's metaslabs
2311will be initialized, progressively degrading the usefulness of this option.
2312This setting is stored when starting a manual TRIM and will
2313persist for the duration of the requested TRIM.
2314.
2315.It Sy zfs_trim_queue_limit Ns = Ns Sy 10 Pq uint
2316Maximum number of queued TRIMs outstanding per leaf vdev.
2317The number of concurrent TRIM commands issued to the device is controlled by
2318.Sy zfs_vdev_trim_min_active No and Sy zfs_vdev_trim_max_active .
2319.
2320.It Sy zfs_trim_txg_batch Ns = Ns Sy 32 Pq uint
2321The number of transaction groups' worth of frees which should be aggregated
2322before TRIM operations are issued to the device.
2323This setting represents a trade-off between issuing larger,
2324more efficient TRIM operations and the delay
2325before the recently trimmed space is available for use by the device.
2326.Pp
2327Increasing this value will allow frees to be aggregated for a longer time.
2328This will result is larger TRIM operations and potentially increased memory
2329usage.
2330Decreasing this value will have the opposite effect.
2331The default of
2332.Sy 32
2333was determined to be a reasonable compromise.
2334.
2335.It Sy zfs_txg_history Ns = Ns Sy 100 Pq uint
2336Historical statistics for this many latest TXGs will be available in
2337.Pa /proc/spl/kstat/zfs/ Ns Ao Ar pool Ac Ns Pa /TXGs .
2338.
2339.It Sy zfs_txg_timeout Ns = Ns Sy 5 Ns s Pq uint
2340Flush dirty data to disk at least every this many seconds (maximum TXG
2341duration).
2342.
2343.It Sy zfs_vdev_aggregation_limit Ns = Ns Sy 1048576 Ns B Po 1 MiB Pc Pq uint
2344Max vdev I/O aggregation size.
2345.
2346.It Sy zfs_vdev_aggregation_limit_non_rotating Ns = Ns Sy 131072 Ns B Po 128 KiB Pc Pq uint
2347Max vdev I/O aggregation size for non-rotating media.
2348.
2349.It Sy zfs_vdev_mirror_rotating_inc Ns = Ns Sy 0 Pq int
2350A number by which the balancing algorithm increments the load calculation for
2351the purpose of selecting the least busy mirror member when an I/O operation
2352immediately follows its predecessor on rotational vdevs
2353for the purpose of making decisions based on load.
2354.
2355.It Sy zfs_vdev_mirror_rotating_seek_inc Ns = Ns Sy 5 Pq int
2356A number by which the balancing algorithm increments the load calculation for
2357the purpose of selecting the least busy mirror member when an I/O operation
2358lacks locality as defined by
2359.Sy zfs_vdev_mirror_rotating_seek_offset .
2360Operations within this that are not immediately following the previous operation
2361are incremented by half.
2362.
2363.It Sy zfs_vdev_mirror_rotating_seek_offset Ns = Ns Sy 1048576 Ns B Po 1 MiB Pc Pq int
2364The maximum distance for the last queued I/O operation in which
2365the balancing algorithm considers an operation to have locality.
2366.No See Sx ZFS I/O SCHEDULER .
2367.
2368.It Sy zfs_vdev_mirror_non_rotating_inc Ns = Ns Sy 0 Pq int
2369A number by which the balancing algorithm increments the load calculation for
2370the purpose of selecting the least busy mirror member on non-rotational vdevs
2371when I/O operations do not immediately follow one another.
2372.
2373.It Sy zfs_vdev_mirror_non_rotating_seek_inc Ns = Ns Sy 1 Pq int
2374A number by which the balancing algorithm increments the load calculation for
2375the purpose of selecting the least busy mirror member when an I/O operation
2376lacks
2377locality as defined by the
2378.Sy zfs_vdev_mirror_rotating_seek_offset .
2379Operations within this that are not immediately following the previous operation
2380are incremented by half.
2381.
2382.It Sy zfs_vdev_read_gap_limit Ns = Ns Sy 32768 Ns B Po 32 KiB Pc Pq uint
2383Aggregate read I/O operations if the on-disk gap between them is within this
2384threshold.
2385.
2386.It Sy zfs_vdev_write_gap_limit Ns = Ns Sy 4096 Ns B Po 4 KiB Pc Pq uint
2387Aggregate write I/O operations if the on-disk gap between them is within this
2388threshold.
2389.
2390.It Sy zfs_vdev_raidz_impl Ns = Ns Sy fastest Pq string
2391Select the raidz parity implementation to use.
2392.Pp
2393Variants that don't depend on CPU-specific features
2394may be selected on module load, as they are supported on all systems.
2395The remaining options may only be set after the module is loaded,
2396as they are available only if the implementations are compiled in
2397and supported on the running system.
2398.Pp
2399Once the module is loaded,
2400.Pa /sys/module/zfs/parameters/zfs_vdev_raidz_impl
2401will show the available options,
2402with the currently selected one enclosed in square brackets.
2403.Pp
2404.TS
2405lb l l .
2406fastest	selected by built-in benchmark
2407original	original implementation
2408scalar	scalar implementation
2409sse2	SSE2 instruction set	64-bit x86
2410ssse3	SSSE3 instruction set	64-bit x86
2411avx2	AVX2 instruction set	64-bit x86
2412avx512f	AVX512F instruction set	64-bit x86
2413avx512bw	AVX512F & AVX512BW instruction sets	64-bit x86
2414aarch64_neon	NEON	Aarch64/64-bit ARMv8
2415aarch64_neonx2	NEON with more unrolling	Aarch64/64-bit ARMv8
2416powerpc_altivec	Altivec	PowerPC
2417.TE
2418.
2419.It Sy zfs_zevent_len_max Ns = Ns Sy 512 Pq uint
2420Max event queue length.
2421Events in the queue can be viewed with
2422.Xr zpool-events 8 .
2423.
2424.It Sy zfs_zevent_retain_max Ns = Ns Sy 2000 Pq int
2425Maximum recent zevent records to retain for duplicate checking.
2426Setting this to
2427.Sy 0
2428disables duplicate detection.
2429.
2430.It Sy zfs_zevent_retain_expire_secs Ns = Ns Sy 900 Ns s Po 15 min Pc Pq int
2431Lifespan for a recent ereport that was retained for duplicate checking.
2432.
2433.It Sy zfs_zil_clean_taskq_maxalloc Ns = Ns Sy 1048576 Pq int
2434The maximum number of taskq entries that are allowed to be cached.
2435When this limit is exceeded transaction records (itxs)
2436will be cleaned synchronously.
2437.
2438.It Sy zfs_zil_clean_taskq_minalloc Ns = Ns Sy 1024 Pq int
2439The number of taskq entries that are pre-populated when the taskq is first
2440created and are immediately available for use.
2441.
2442.It Sy zfs_zil_clean_taskq_nthr_pct Ns = Ns Sy 100 Ns % Pq int
2443This controls the number of threads used by
2444.Sy dp_zil_clean_taskq .
2445The default value of
2446.Sy 100%
2447will create a maximum of one thread per CPU.
2448.
2449.It Sy zil_maxblocksize Ns = Ns Sy 131072 Ns B Po 128 KiB Pc Pq uint
2450This sets the maximum block size used by the ZIL.
2451On very fragmented pools, lowering this
2452.Pq typically to Sy 36 KiB
2453can improve performance.
2454.
2455.It Sy zil_maxcopied Ns = Ns Sy 7680 Ns B Po 7.5 KiB Pc Pq uint
2456This sets the maximum number of write bytes logged via WR_COPIED.
2457It tunes a tradeoff between additional memory copy and possibly worse log
2458space efficiency vs additional range lock/unlock.
2459.
2460.It Sy zil_nocacheflush Ns = Ns Sy 0 Ns | Ns 1 Pq int
2461Disable the cache flush commands that are normally sent to disk by
2462the ZIL after an LWB write has completed.
2463Setting this will cause ZIL corruption on power loss
2464if a volatile out-of-order write cache is enabled.
2465.
2466.It Sy zil_replay_disable Ns = Ns Sy 0 Ns | Ns 1 Pq int
2467Disable intent logging replay.
2468Can be disabled for recovery from corrupted ZIL.
2469.
2470.It Sy zil_slog_bulk Ns = Ns Sy 67108864 Ns B Po 64 MiB Pc Pq u64
2471Limit SLOG write size per commit executed with synchronous priority.
2472Any writes above that will be executed with lower (asynchronous) priority
2473to limit potential SLOG device abuse by single active ZIL writer.
2474.
2475.It Sy zfs_zil_saxattr Ns = Ns Sy 1 Ns | Ns 0 Pq int
2476Setting this tunable to zero disables ZIL logging of new
2477.Sy xattr Ns = Ns Sy sa
2478records if the
2479.Sy org.openzfs:zilsaxattr
2480feature is enabled on the pool.
2481This would only be necessary to work around bugs in the ZIL logging or replay
2482code for this record type.
2483The tunable has no effect if the feature is disabled.
2484.
2485.It Sy zfs_embedded_slog_min_ms Ns = Ns Sy 64 Pq uint
2486Usually, one metaslab from each normal and special class vdev is dedicated
2487for use by the ZIL to log synchronous writes.
2488However, if there are fewer than
2489.Sy zfs_embedded_slog_min_ms
2490metaslabs in the vdev, this functionality is disabled.
2491This ensures that we don't set aside an unreasonable amount of space for the
2492ZIL.
2493.
2494.It Sy zstd_earlyabort_pass Ns = Ns Sy 1 Pq uint
2495Whether heuristic for detection of incompressible data with zstd levels >= 3
2496using LZ4 and zstd-1 passes is enabled.
2497.
2498.It Sy zstd_abort_size Ns = Ns Sy 131072 Pq uint
2499Minimal uncompressed size (inclusive) of a record before the early abort
2500heuristic will be attempted.
2501.
2502.It Sy zio_deadman_log_all Ns = Ns Sy 0 Ns | Ns 1 Pq int
2503If non-zero, the zio deadman will produce debugging messages
2504.Pq see Sy zfs_dbgmsg_enable
2505for all zios, rather than only for leaf zios possessing a vdev.
2506This is meant to be used by developers to gain
2507diagnostic information for hang conditions which don't involve a mutex
2508or other locking primitive: typically conditions in which a thread in
2509the zio pipeline is looping indefinitely.
2510.
2511.It Sy zio_slow_io_ms Ns = Ns Sy 30000 Ns ms Po 30 s Pc Pq int
2512When an I/O operation takes more than this much time to complete,
2513it's marked as slow.
2514Each slow operation causes a delay zevent.
2515Slow I/O counters can be seen with
2516.Nm zpool Cm status Fl s .
2517.
2518.It Sy zio_dva_throttle_enabled Ns = Ns Sy 1 Ns | Ns 0 Pq int
2519Throttle block allocations in the I/O pipeline.
2520This allows for dynamic allocation distribution based on device performance.
2521.
2522.It Sy zfs_xattr_compat Ns = Ns 0 Ns | Ns 1 Pq int
2523Control the naming scheme used when setting new xattrs in the user namespace.
2524If
2525.Sy 0
2526.Pq the default on Linux ,
2527user namespace xattr names are prefixed with the namespace, to be backwards
2528compatible with previous versions of ZFS on Linux.
2529If
2530.Sy 1
2531.Pq the default on Fx ,
2532user namespace xattr names are not prefixed, to be backwards compatible with
2533previous versions of ZFS on illumos and
2534.Fx .
2535.Pp
2536Either naming scheme can be read on this and future versions of ZFS, regardless
2537of this tunable, but legacy ZFS on illumos or
2538.Fx
2539are unable to read user namespace xattrs written in the Linux format, and
2540legacy versions of ZFS on Linux are unable to read user namespace xattrs written
2541in the legacy ZFS format.
2542.Pp
2543An existing xattr with the alternate naming scheme is removed when overwriting
2544the xattr so as to not accumulate duplicates.
2545.
2546.It Sy zio_requeue_io_start_cut_in_line Ns = Ns Sy 0 Ns | Ns 1 Pq int
2547Prioritize requeued I/O.
2548.
2549.It Sy zio_taskq_batch_pct Ns = Ns Sy 80 Ns % Pq uint
2550Percentage of online CPUs which will run a worker thread for I/O.
2551These workers are responsible for I/O work such as compression, encryption,
2552checksum and parity calculations.
2553Fractional number of CPUs will be rounded down.
2554.Pp
2555The default value of
2556.Sy 80%
2557was chosen to avoid using all CPUs which can result in
2558latency issues and inconsistent application performance,
2559especially when slower compression and/or checksumming is enabled.
2560Set value only applies to pools imported/created after that.
2561.
2562.It Sy zio_taskq_batch_tpq Ns = Ns Sy 0 Pq uint
2563Number of worker threads per taskq.
2564Higher values improve I/O ordering and CPU utilization,
2565while lower reduce lock contention.
2566Set value only applies to pools imported/created after that.
2567.Pp
2568If
2569.Sy 0 ,
2570generate a system-dependent value close to 6 threads per taskq.
2571Set value only applies to pools imported/created after that.
2572.
2573.It Sy zio_taskq_write_tpq Ns = Ns Sy 16 Pq uint
2574Determines the minimum number of threads per write issue taskq.
2575Higher values improve CPU utilization on high throughput,
2576while lower reduce taskq locks contention on high IOPS.
2577Set value only applies to pools imported/created after that.
2578.
2579.It Sy zio_taskq_read Ns = Ns Sy fixed,1,8 null scale null Pq charp
2580Set the queue and thread configuration for the IO read queues.
2581This is an advanced debugging parameter.
2582Don't change this unless you understand what it does.
2583Set values only apply to pools imported/created after that.
2584.
2585.It Sy zio_taskq_write Ns = Ns Sy sync null scale null Pq charp
2586Set the queue and thread configuration for the IO write queues.
2587This is an advanced debugging parameter.
2588Don't change this unless you understand what it does.
2589Set values only apply to pools imported/created after that.
2590.
2591.It Sy zvol_inhibit_dev Ns = Ns Sy 0 Ns | Ns 1 Pq uint
2592Do not create zvol device nodes.
2593This may slightly improve startup time on
2594systems with a very large number of zvols.
2595.
2596.It Sy zvol_major Ns = Ns Sy 230 Pq uint
2597Major number for zvol block devices.
2598.
2599.It Sy zvol_max_discard_blocks Ns = Ns Sy 16384 Pq long
2600Discard (TRIM) operations done on zvols will be done in batches of this
2601many blocks, where block size is determined by the
2602.Sy volblocksize
2603property of a zvol.
2604.
2605.It Sy zvol_prefetch_bytes Ns = Ns Sy 131072 Ns B Po 128 KiB Pc Pq uint
2606When adding a zvol to the system, prefetch this many bytes
2607from the start and end of the volume.
2608Prefetching these regions of the volume is desirable,
2609because they are likely to be accessed immediately by
2610.Xr blkid 8
2611or the kernel partitioner.
2612.
2613.It Sy zvol_request_sync Ns = Ns Sy 0 Ns | Ns 1 Pq uint
2614When processing I/O requests for a zvol, submit them synchronously.
2615This effectively limits the queue depth to
2616.Em 1
2617for each I/O submitter.
2618When unset, requests are handled asynchronously by a thread pool.
2619The number of requests which can be handled concurrently is controlled by
2620.Sy zvol_threads .
2621.Sy zvol_request_sync
2622is ignored when running on a kernel that supports block multiqueue
2623.Pq Li blk-mq .
2624.
2625.It Sy zvol_num_taskqs Ns = Ns Sy 0 Pq uint
2626Number of zvol taskqs.
2627If
2628.Sy 0
2629(the default) then scaling is done internally to prefer 6 threads per taskq.
2630This only applies on Linux.
2631.
2632.It Sy zvol_threads Ns = Ns Sy 0 Pq uint
2633The number of system wide threads to use for processing zvol block IOs.
2634If
2635.Sy 0
2636(the default) then internally set
2637.Sy zvol_threads
2638to the number of CPUs present or 32 (whichever is greater).
2639.
2640.It Sy zvol_blk_mq_threads Ns = Ns Sy 0 Pq uint
2641The number of threads per zvol to use for queuing IO requests.
2642This parameter will only appear if your kernel supports
2643.Li blk-mq
2644and is only read and assigned to a zvol at zvol load time.
2645If
2646.Sy 0
2647(the default) then internally set
2648.Sy zvol_blk_mq_threads
2649to the number of CPUs present.
2650.
2651.It Sy zvol_use_blk_mq Ns = Ns Sy 0 Ns | Ns 1 Pq uint
2652Set to
2653.Sy 1
2654to use the
2655.Li blk-mq
2656API for zvols.
2657Set to
2658.Sy 0
2659(the default) to use the legacy zvol APIs.
2660This setting can give better or worse zvol performance depending on
2661the workload.
2662This parameter will only appear if your kernel supports
2663.Li blk-mq
2664and is only read and assigned to a zvol at zvol load time.
2665.
2666.It Sy zvol_blk_mq_blocks_per_thread Ns = Ns Sy 8 Pq uint
2667If
2668.Sy zvol_use_blk_mq
2669is enabled, then process this number of
2670.Sy volblocksize Ns -sized blocks per zvol thread.
2671This tunable can be use to favor better performance for zvol reads (lower
2672values) or writes (higher values).
2673If set to
2674.Sy 0 ,
2675then the zvol layer will process the maximum number of blocks
2676per thread that it can.
2677This parameter will only appear if your kernel supports
2678.Li blk-mq
2679and is only applied at each zvol's load time.
2680.
2681.It Sy zvol_blk_mq_queue_depth Ns = Ns Sy 0 Pq uint
2682The queue_depth value for the zvol
2683.Li blk-mq
2684interface.
2685This parameter will only appear if your kernel supports
2686.Li blk-mq
2687and is only applied at each zvol's load time.
2688If
2689.Sy 0
2690(the default) then use the kernel's default queue depth.
2691Values are clamped to the kernel's
2692.Dv BLKDEV_MIN_RQ
2693and
2694.Dv BLKDEV_MAX_RQ Ns / Ns Dv BLKDEV_DEFAULT_RQ
2695limits.
2696.
2697.It Sy zvol_volmode Ns = Ns Sy 1 Pq uint
2698Defines zvol block devices behavior when
2699.Sy volmode Ns = Ns Sy default :
2700.Bl -tag -compact -offset 4n -width "a"
2701.It Sy 1
2702.No equivalent to Sy full
2703.It Sy 2
2704.No equivalent to Sy dev
2705.It Sy 3
2706.No equivalent to Sy none
2707.El
2708.
2709.It Sy zvol_enforce_quotas Ns = Ns Sy 0 Ns | Ns 1 Pq uint
2710Enable strict ZVOL quota enforcement.
2711The strict quota enforcement may have a performance impact.
2712.El
2713.
2714.Sh ZFS I/O SCHEDULER
2715ZFS issues I/O operations to leaf vdevs to satisfy and complete I/O operations.
2716The scheduler determines when and in what order those operations are issued.
2717The scheduler divides operations into five I/O classes,
2718prioritized in the following order: sync read, sync write, async read,
2719async write, and scrub/resilver.
2720Each queue defines the minimum and maximum number of concurrent operations
2721that may be issued to the device.
2722In addition, the device has an aggregate maximum,
2723.Sy zfs_vdev_max_active .
2724Note that the sum of the per-queue minima must not exceed the aggregate maximum.
2725If the sum of the per-queue maxima exceeds the aggregate maximum,
2726then the number of active operations may reach
2727.Sy zfs_vdev_max_active ,
2728in which case no further operations will be issued,
2729regardless of whether all per-queue minima have been met.
2730.Pp
2731For many physical devices, throughput increases with the number of
2732concurrent operations, but latency typically suffers.
2733Furthermore, physical devices typically have a limit
2734at which more concurrent operations have no
2735effect on throughput or can actually cause it to decrease.
2736.Pp
2737The scheduler selects the next operation to issue by first looking for an
2738I/O class whose minimum has not been satisfied.
2739Once all are satisfied and the aggregate maximum has not been hit,
2740the scheduler looks for classes whose maximum has not been satisfied.
2741Iteration through the I/O classes is done in the order specified above.
2742No further operations are issued
2743if the aggregate maximum number of concurrent operations has been hit,
2744or if there are no operations queued for an I/O class that has not hit its
2745maximum.
2746Every time an I/O operation is queued or an operation completes,
2747the scheduler looks for new operations to issue.
2748.Pp
2749In general, smaller
2750.Sy max_active Ns s
2751will lead to lower latency of synchronous operations.
2752Larger
2753.Sy max_active Ns s
2754may lead to higher overall throughput, depending on underlying storage.
2755.Pp
2756The ratio of the queues'
2757.Sy max_active Ns s
2758determines the balance of performance between reads, writes, and scrubs.
2759For example, increasing
2760.Sy zfs_vdev_scrub_max_active
2761will cause the scrub or resilver to complete more quickly,
2762but reads and writes to have higher latency and lower throughput.
2763.Pp
2764All I/O classes have a fixed maximum number of outstanding operations,
2765except for the async write class.
2766Asynchronous writes represent the data that is committed to stable storage
2767during the syncing stage for transaction groups.
2768Transaction groups enter the syncing state periodically,
2769so the number of queued async writes will quickly burst up
2770and then bleed down to zero.
2771Rather than servicing them as quickly as possible,
2772the I/O scheduler changes the maximum number of active async write operations
2773according to the amount of dirty data in the pool.
2774Since both throughput and latency typically increase with the number of
2775concurrent operations issued to physical devices, reducing the
2776burstiness in the number of simultaneous operations also stabilizes the
2777response time of operations from other queues, in particular synchronous ones.
2778In broad strokes, the I/O scheduler will issue more concurrent operations
2779from the async write queue as there is more dirty data in the pool.
2780.
2781.Ss Async Writes
2782The number of concurrent operations issued for the async write I/O class
2783follows a piece-wise linear function defined by a few adjustable points:
2784.Bd -literal
2785       |              o---------| <-- \fBzfs_vdev_async_write_max_active\fP
2786  ^    |             /^         |
2787  |    |            / |         |
2788active |           /  |         |
2789 I/O   |          /   |         |
2790count  |         /    |         |
2791       |        /     |         |
2792       |-------o      |         | <-- \fBzfs_vdev_async_write_min_active\fP
2793      0|_______^______|_________|
2794       0%      |      |       100% of \fBzfs_dirty_data_max\fP
2795               |      |
2796               |      `-- \fBzfs_vdev_async_write_active_max_dirty_percent\fP
2797               `--------- \fBzfs_vdev_async_write_active_min_dirty_percent\fP
2798.Ed
2799.Pp
2800Until the amount of dirty data exceeds a minimum percentage of the dirty
2801data allowed in the pool, the I/O scheduler will limit the number of
2802concurrent operations to the minimum.
2803As that threshold is crossed, the number of concurrent operations issued
2804increases linearly to the maximum at the specified maximum percentage
2805of the dirty data allowed in the pool.
2806.Pp
2807Ideally, the amount of dirty data on a busy pool will stay in the sloped
2808part of the function between
2809.Sy zfs_vdev_async_write_active_min_dirty_percent
2810and
2811.Sy zfs_vdev_async_write_active_max_dirty_percent .
2812If it exceeds the maximum percentage,
2813this indicates that the rate of incoming data is
2814greater than the rate that the backend storage can handle.
2815In this case, we must further throttle incoming writes,
2816as described in the next section.
2817.
2818.Sh ZFS TRANSACTION DELAY
2819We delay transactions when we've determined that the backend storage
2820isn't able to accommodate the rate of incoming writes.
2821.Pp
2822If there is already a transaction waiting, we delay relative to when
2823that transaction will finish waiting.
2824This way the calculated delay time
2825is independent of the number of threads concurrently executing transactions.
2826.Pp
2827If we are the only waiter, wait relative to when the transaction started,
2828rather than the current time.
2829This credits the transaction for "time already served",
2830e.g. reading indirect blocks.
2831.Pp
2832The minimum time for a transaction to take is calculated as
2833.D1 min_time = min( Ns Sy zfs_delay_scale No \(mu Po Sy dirty No \- Sy min Pc / Po Sy max No \- Sy dirty Pc , 100ms)
2834.Pp
2835The delay has two degrees of freedom that can be adjusted via tunables.
2836The percentage of dirty data at which we start to delay is defined by
2837.Sy zfs_delay_min_dirty_percent .
2838This should typically be at or above
2839.Sy zfs_vdev_async_write_active_max_dirty_percent ,
2840so that we only start to delay after writing at full speed
2841has failed to keep up with the incoming write rate.
2842The scale of the curve is defined by
2843.Sy zfs_delay_scale .
2844Roughly speaking, this variable determines the amount of delay at the midpoint
2845of the curve.
2846.Bd -literal
2847delay
2848 10ms +-------------------------------------------------------------*+
2849      |                                                             *|
2850  9ms +                                                             *+
2851      |                                                             *|
2852  8ms +                                                             *+
2853      |                                                            * |
2854  7ms +                                                            * +
2855      |                                                            * |
2856  6ms +                                                            * +
2857      |                                                            * |
2858  5ms +                                                           *  +
2859      |                                                           *  |
2860  4ms +                                                           *  +
2861      |                                                           *  |
2862  3ms +                                                          *   +
2863      |                                                          *   |
2864  2ms +                                              (midpoint) *    +
2865      |                                                  |    **     |
2866  1ms +                                                  v ***       +
2867      |             \fBzfs_delay_scale\fP ---------->     ********         |
2868    0 +-------------------------------------*********----------------+
2869      0%                    <- \fBzfs_dirty_data_max\fP ->               100%
2870.Ed
2871.Pp
2872Note, that since the delay is added to the outstanding time remaining on the
2873most recent transaction it's effectively the inverse of IOPS.
2874Here, the midpoint of
2875.Em 500 us
2876translates to
2877.Em 2000 IOPS .
2878The shape of the curve
2879was chosen such that small changes in the amount of accumulated dirty data
2880in the first three quarters of the curve yield relatively small differences
2881in the amount of delay.
2882.Pp
2883The effects can be easier to understand when the amount of delay is
2884represented on a logarithmic scale:
2885.Bd -literal
2886delay
2887100ms +-------------------------------------------------------------++
2888      +                                                              +
2889      |                                                              |
2890      +                                                             *+
2891 10ms +                                                             *+
2892      +                                                           ** +
2893      |                                              (midpoint)  **  |
2894      +                                                  |     **    +
2895  1ms +                                                  v ****      +
2896      +             \fBzfs_delay_scale\fP ---------->        *****         +
2897      |                                             ****             |
2898      +                                          ****                +
2899100us +                                        **                    +
2900      +                                       *                      +
2901      |                                      *                       |
2902      +                                     *                        +
2903 10us +                                     *                        +
2904      +                                                              +
2905      |                                                              |
2906      +                                                              +
2907      +--------------------------------------------------------------+
2908      0%                    <- \fBzfs_dirty_data_max\fP ->               100%
2909.Ed
2910.Pp
2911Note here that only as the amount of dirty data approaches its limit does
2912the delay start to increase rapidly.
2913The goal of a properly tuned system should be to keep the amount of dirty data
2914out of that range by first ensuring that the appropriate limits are set
2915for the I/O scheduler to reach optimal throughput on the back-end storage,
2916and then by changing the value of
2917.Sy zfs_delay_scale
2918to increase the steepness of the curve.
2919