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