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