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