]> git.proxmox.com Git - mirror_zfs-debian.git/blame - man/man5/zfs-module-parameters.5
New upstream version 0.7.9
[mirror_zfs-debian.git] / man / man5 / zfs-module-parameters.5
CommitLineData
a08ee875
LG
1'\" te
2.\" Copyright (c) 2013 by Turbo Fredriksson <turbo@bayour.com>. All rights reserved.
3.\" The contents of this file are subject to the terms of the Common Development
4.\" and Distribution License (the "License"). You may not use this file except
5.\" in compliance with the License. You can obtain a copy of the license at
6.\" usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
7.\"
8.\" See the License for the specific language governing permissions and
9.\" limitations under the License. When distributing Covered Code, include this
10.\" CDDL HEADER in each file and include the License file at
11.\" usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this
12.\" CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your
13.\" own identifying information:
14.\" Portions Copyright [yyyy] [name of copyright owner]
41d74433 15.TH ZFS-MODULE-PARAMETERS 5 "Oct 28, 2017"
a08ee875
LG
16.SH NAME
17zfs\-module\-parameters \- ZFS module parameters
18.SH DESCRIPTION
19.sp
20.LP
21Description of the different parameters to the ZFS module.
22
23.SS "Module parameters"
24.sp
25.LP
26
87dac73d
AX
27.sp
28.ne 2
29.na
30\fBignore_hole_birth\fR (int)
31.ad
32.RS 12n
33When set, the hole_birth optimization will not be used, and all holes will
34always be sent on zfs send. Useful if you suspect your datasets are affected
35by a bug in hole_birth.
36.sp
cae5b340 37Use \fB1\fR for on (default) and \fB0\fR for off.
87dac73d
AX
38.RE
39
a08ee875
LG
40.sp
41.ne 2
42.na
43\fBl2arc_feed_again\fR (int)
44.ad
45.RS 12n
cae5b340
AX
46Turbo L2ARC warm-up. When the L2ARC is cold the fill interval will be set as
47fast as possible.
a08ee875
LG
48.sp
49Use \fB1\fR for yes (default) and \fB0\fR to disable.
50.RE
51
52.sp
53.ne 2
54.na
55\fBl2arc_feed_min_ms\fR (ulong)
56.ad
57.RS 12n
cae5b340
AX
58Min feed interval in milliseconds. Requires \fBl2arc_feed_again=1\fR and only
59applicable in related situations.
a08ee875
LG
60.sp
61Default value: \fB200\fR.
62.RE
63
64.sp
65.ne 2
66.na
67\fBl2arc_feed_secs\fR (ulong)
68.ad
69.RS 12n
70Seconds between L2ARC writing
71.sp
72Default value: \fB1\fR.
73.RE
74
75.sp
76.ne 2
77.na
78\fBl2arc_headroom\fR (ulong)
79.ad
80.RS 12n
cae5b340
AX
81How far through the ARC lists to search for L2ARC cacheable content, expressed
82as a multiplier of \fBl2arc_write_max\fR
a08ee875
LG
83.sp
84Default value: \fB2\fR.
85.RE
86
87.sp
88.ne 2
89.na
90\fBl2arc_headroom_boost\fR (ulong)
91.ad
92.RS 12n
cae5b340
AX
93Scales \fBl2arc_headroom\fR by this percentage when L2ARC contents are being
94successfully compressed before writing. A value of 100 disables this feature.
a08ee875
LG
95.sp
96Default value: \fB200\fR.
97.RE
98
a08ee875
LG
99.sp
100.ne 2
101.na
102\fBl2arc_noprefetch\fR (int)
103.ad
104.RS 12n
cae5b340
AX
105Do not write buffers to L2ARC if they were prefetched but not used by
106applications
a08ee875
LG
107.sp
108Use \fB1\fR for yes (default) and \fB0\fR to disable.
109.RE
110
111.sp
112.ne 2
113.na
114\fBl2arc_norw\fR (int)
115.ad
116.RS 12n
117No reads during writes
118.sp
119Use \fB1\fR for yes and \fB0\fR for no (default).
120.RE
121
122.sp
123.ne 2
124.na
125\fBl2arc_write_boost\fR (ulong)
126.ad
127.RS 12n
cae5b340
AX
128Cold L2ARC devices will have \fBl2arc_write_max\fR increased by this amount
129while they remain cold.
a08ee875
LG
130.sp
131Default value: \fB8,388,608\fR.
132.RE
133
134.sp
135.ne 2
136.na
137\fBl2arc_write_max\fR (ulong)
138.ad
139.RS 12n
140Max write bytes per interval
141.sp
142Default value: \fB8,388,608\fR.
143.RE
144
e10b0808
AX
145.sp
146.ne 2
147.na
148\fBmetaslab_aliquot\fR (ulong)
149.ad
150.RS 12n
151Metaslab granularity, in bytes. This is roughly similar to what would be
152referred to as the "stripe size" in traditional RAID arrays. In normal
153operation, ZFS will try to write this amount of data to a top-level vdev
154before moving on to the next one.
155.sp
156Default value: \fB524,288\fR.
157.RE
158
a08ee875
LG
159.sp
160.ne 2
161.na
ea04106b 162\fBmetaslab_bias_enabled\fR (int)
a08ee875
LG
163.ad
164.RS 12n
ea04106b
AX
165Enable metaslab group biasing based on its vdev's over- or under-utilization
166relative to the pool.
167.sp
168Use \fB1\fR for yes (default) and \fB0\fR for no.
169.RE
170
cae5b340
AX
171.sp
172.ne 2
173.na
174\fBzfs_metaslab_segment_weight_enabled\fR (int)
175.ad
176.RS 12n
177Enable/disable segment-based metaslab selection.
178.sp
179Use \fB1\fR for yes (default) and \fB0\fR for no.
180.RE
181
182.sp
183.ne 2
184.na
185\fBzfs_metaslab_switch_threshold\fR (int)
186.ad
187.RS 12n
188When using segment-based metaslab selection, continue allocating
189from the active metaslab until \fBzfs_metaslab_switch_threshold\fR
190worth of buckets have been exhausted.
191.sp
192Default value: \fB2\fR.
193.RE
194
ea04106b
AX
195.sp
196.ne 2
197.na
198\fBmetaslab_debug_load\fR (int)
199.ad
200.RS 12n
201Load all metaslabs during pool import.
202.sp
203Use \fB1\fR for yes and \fB0\fR for no (default).
204.RE
205
206.sp
207.ne 2
208.na
209\fBmetaslab_debug_unload\fR (int)
210.ad
211.RS 12n
212Prevent metaslabs from being unloaded.
a08ee875
LG
213.sp
214Use \fB1\fR for yes and \fB0\fR for no (default).
215.RE
216
ea04106b
AX
217.sp
218.ne 2
219.na
220\fBmetaslab_fragmentation_factor_enabled\fR (int)
221.ad
222.RS 12n
223Enable use of the fragmentation metric in computing metaslab weights.
224.sp
225Use \fB1\fR for yes (default) and \fB0\fR for no.
226.RE
227
228.sp
229.ne 2
230.na
231\fBmetaslabs_per_vdev\fR (int)
232.ad
233.RS 12n
234When a vdev is added, it will be divided into approximately (but no more than) this number of metaslabs.
235.sp
236Default value: \fB200\fR.
237.RE
238
239.sp
240.ne 2
241.na
242\fBmetaslab_preload_enabled\fR (int)
243.ad
244.RS 12n
245Enable metaslab group preloading.
246.sp
247Use \fB1\fR for yes (default) and \fB0\fR for no.
248.RE
249
250.sp
251.ne 2
252.na
253\fBmetaslab_lba_weighting_enabled\fR (int)
254.ad
255.RS 12n
256Give more weight to metaslabs with lower LBAs, assuming they have
257greater bandwidth as is typically the case on a modern constant
258angular velocity disk drive.
259.sp
260Use \fB1\fR for yes (default) and \fB0\fR for no.
261.RE
262
a08ee875
LG
263.sp
264.ne 2
265.na
266\fBspa_config_path\fR (charp)
267.ad
268.RS 12n
269SPA config file
270.sp
271Default value: \fB/etc/zfs/zpool.cache\fR.
272.RE
273
274.sp
275.ne 2
276.na
277\fBspa_asize_inflation\fR (int)
278.ad
279.RS 12n
280Multiplication factor used to estimate actual disk consumption from the
281size of data being written. The default value is a worst case estimate,
282but lower values may be valid for a given pool depending on its
283configuration. Pool administrators who understand the factors involved
284may wish to specify a more realistic inflation factor, particularly if
285they operate close to quota or capacity limits.
286.sp
cae5b340 287Default value: \fB24\fR.
a08ee875
LG
288.RE
289
ea04106b
AX
290.sp
291.ne 2
292.na
293\fBspa_load_verify_data\fR (int)
294.ad
295.RS 12n
296Whether to traverse data blocks during an "extreme rewind" (\fB-X\fR)
297import. Use 0 to disable and 1 to enable.
298
299An extreme rewind import normally performs a full traversal of all
300blocks in the pool for verification. If this parameter is set to 0,
301the traversal skips non-metadata blocks. It can be toggled once the
302import has started to stop or start the traversal of non-metadata blocks.
303.sp
cae5b340 304Default value: \fB1\fR.
ea04106b
AX
305.RE
306
307.sp
308.ne 2
309.na
310\fBspa_load_verify_metadata\fR (int)
311.ad
312.RS 12n
313Whether to traverse blocks during an "extreme rewind" (\fB-X\fR)
314pool import. Use 0 to disable and 1 to enable.
315
316An extreme rewind import normally performs a full traversal of all
cae5b340 317blocks in the pool for verification. If this parameter is set to 0,
ea04106b
AX
318the traversal is not performed. It can be toggled once the import has
319started to stop or start the traversal.
320.sp
cae5b340 321Default value: \fB1\fR.
ea04106b
AX
322.RE
323
324.sp
325.ne 2
326.na
327\fBspa_load_verify_maxinflight\fR (int)
328.ad
329.RS 12n
330Maximum concurrent I/Os during the traversal performed during an "extreme
331rewind" (\fB-X\fR) pool import.
332.sp
cae5b340 333Default value: \fB10000\fR.
ea04106b
AX
334.RE
335
e10b0808
AX
336.sp
337.ne 2
338.na
339\fBspa_slop_shift\fR (int)
340.ad
341.RS 12n
342Normally, we don't allow the last 3.2% (1/(2^spa_slop_shift)) of space
343in the pool to be consumed. This ensures that we don't run the pool
344completely out of space, due to unaccounted changes (e.g. to the MOS).
345It also limits the worst-case time to allocate space. If we have
346less than this amount of free space, most ZPL operations (e.g. write,
347create) will return ENOSPC.
348.sp
cae5b340 349Default value: \fB5\fR.
e10b0808
AX
350.RE
351
a08ee875
LG
352.sp
353.ne 2
354.na
355\fBzfetch_array_rd_sz\fR (ulong)
356.ad
357.RS 12n
ea04106b 358If prefetching is enabled, disable prefetching for reads larger than this size.
a08ee875
LG
359.sp
360Default value: \fB1,048,576\fR.
361.RE
362
363.sp
364.ne 2
365.na
cae5b340 366\fBzfetch_max_distance\fR (uint)
a08ee875
LG
367.ad
368.RS 12n
cae5b340 369Max bytes to prefetch per stream (default 8MB).
a08ee875 370.sp
cae5b340 371Default value: \fB8,388,608\fR.
a08ee875
LG
372.RE
373
374.sp
375.ne 2
376.na
377\fBzfetch_max_streams\fR (uint)
378.ad
379.RS 12n
ea04106b 380Max number of streams per zfetch (prefetch streams per file).
a08ee875
LG
381.sp
382Default value: \fB8\fR.
383.RE
384
385.sp
386.ne 2
387.na
388\fBzfetch_min_sec_reap\fR (uint)
389.ad
390.RS 12n
ea04106b 391Min time before an active prefetch stream can be reclaimed
a08ee875
LG
392.sp
393Default value: \fB2\fR.
394.RE
395
cae5b340
AX
396.sp
397.ne 2
398.na
399\fBzfs_arc_dnode_limit\fR (ulong)
400.ad
401.RS 12n
402When the number of bytes consumed by dnodes in the ARC exceeds this number of
403bytes, try to unpin some of it in response to demand for non-metadata. This
404value acts as a ceiling to the amount of dnode metadata, and defaults to 0 which
405indicates that a percent which is based on \fBzfs_arc_dnode_limit_percent\fR of
406the ARC meta buffers that may be used for dnodes.
407
408See also \fBzfs_arc_meta_prune\fR which serves a similar purpose but is used
409when the amount of metadata in the ARC exceeds \fBzfs_arc_meta_limit\fR rather
410than in response to overall demand for non-metadata.
411
412.sp
413Default value: \fB0\fR.
414.RE
415
416.sp
417.ne 2
418.na
419\fBzfs_arc_dnode_limit_percent\fR (ulong)
420.ad
421.RS 12n
422Percentage that can be consumed by dnodes of ARC meta buffers.
423.sp
424See also \fBzfs_arc_dnode_limit\fR which serves a similar purpose but has a
425higher priority if set to nonzero value.
426.sp
427Default value: \fB10\fR.
428.RE
429
430.sp
431.ne 2
432.na
433\fBzfs_arc_dnode_reduce_percent\fR (ulong)
434.ad
435.RS 12n
436Percentage of ARC dnodes to try to scan in response to demand for non-metadata
437when the number of bytes consumed by dnodes exceeds \fBzfs_arc_dnode_limit\fR.
438
439.sp
440Default value: \fB10% of the number of dnodes in the ARC\fR.
441.RE
442
ea04106b
AX
443.sp
444.ne 2
445.na
446\fBzfs_arc_average_blocksize\fR (int)
447.ad
448.RS 12n
449The ARC's buffer hash table is sized based on the assumption of an average
450block size of \fBzfs_arc_average_blocksize\fR (default 8K). This works out
451to roughly 1MB of hash table per 1GB of physical memory with 8-byte pointers.
452For configurations with a known larger average block size this value can be
453increased to reduce the memory footprint.
454
455.sp
456Default value: \fB8192\fR.
457.RE
458
e10b0808
AX
459.sp
460.ne 2
461.na
462\fBzfs_arc_evict_batch_limit\fR (int)
463.ad
464.RS 12n
465Number ARC headers to evict per sub-list before proceeding to another sub-list.
466This batch-style operation prevents entire sub-lists from being evicted at once
467but comes at a cost of additional unlocking and locking.
468.sp
469Default value: \fB10\fR.
470.RE
471
a08ee875
LG
472.sp
473.ne 2
474.na
475\fBzfs_arc_grow_retry\fR (int)
476.ad
477.RS 12n
41d74433
AX
478If set to a non zero value, it will replace the arc_grow_retry value with this value.
479The arc_grow_retry value (default 5) is the number of seconds the ARC will wait before
480trying to resume growth after a memory pressure event.
a08ee875 481.sp
41d74433 482Default value: \fB0\fR.
a08ee875
LG
483.RE
484
485.sp
486.ne 2
487.na
e10b0808 488\fBzfs_arc_lotsfree_percent\fR (int)
a08ee875
LG
489.ad
490.RS 12n
e10b0808
AX
491Throttle I/O when free system memory drops below this percentage of total
492system memory. Setting this value to 0 will disable the throttle.
a08ee875 493.sp
e10b0808 494Default value: \fB10\fR.
a08ee875
LG
495.RE
496
497.sp
498.ne 2
499.na
e10b0808 500\fBzfs_arc_max\fR (ulong)
a08ee875
LG
501.ad
502.RS 12n
cae5b340
AX
503Max arc size of ARC in bytes. If set to 0 then it will consume 1/2 of system
504RAM. This value must be at least 67108864 (64 megabytes).
505.sp
506This value can be changed dynamically with some caveats. It cannot be set back
507to 0 while running and reducing it below the current ARC size will not cause
508the ARC to shrink without memory pressure to induce shrinking.
a08ee875 509.sp
e10b0808 510Default value: \fB0\fR.
a08ee875
LG
511.RE
512
41d74433
AX
513.sp
514.ne 2
515.na
516\fBzfs_arc_meta_adjust_restarts\fR (ulong)
517.ad
518.RS 12n
519The number of restart passes to make while scanning the ARC attempting
520the free buffers in order to stay below the \fBzfs_arc_meta_limit\fR.
521This value should not need to be tuned but is available to facilitate
522performance analysis.
523.sp
524Default value: \fB4096\fR.
525.RE
526
a08ee875
LG
527.sp
528.ne 2
529.na
530\fBzfs_arc_meta_limit\fR (ulong)
531.ad
532.RS 12n
ea04106b
AX
533The maximum allowed size in bytes that meta data buffers are allowed to
534consume in the ARC. When this limit is reached meta data buffers will
535be reclaimed even if the overall arc_c_max has not been reached. This
cae5b340
AX
536value defaults to 0 which indicates that a percent which is based on
537\fBzfs_arc_meta_limit_percent\fR of the ARC may be used for meta data.
538.sp
539This value my be changed dynamically except that it cannot be set back to 0
540for a specific percent of the ARC; it must be set to an explicit value.
a08ee875
LG
541.sp
542Default value: \fB0\fR.
543.RE
544
cae5b340
AX
545.sp
546.ne 2
547.na
548\fBzfs_arc_meta_limit_percent\fR (ulong)
549.ad
550.RS 12n
551Percentage of ARC buffers that can be used for meta data.
552
553See also \fBzfs_arc_meta_limit\fR which serves a similar purpose but has a
554higher priority if set to nonzero value.
555
556.sp
557Default value: \fB75\fR.
558.RE
559
e10b0808
AX
560.sp
561.ne 2
562.na
563\fBzfs_arc_meta_min\fR (ulong)
564.ad
565.RS 12n
566The minimum allowed size in bytes that meta data buffers may consume in
567the ARC. This value defaults to 0 which disables a floor on the amount
568of the ARC devoted meta data.
569.sp
570Default value: \fB0\fR.
571.RE
572
a08ee875
LG
573.sp
574.ne 2
575.na
576\fBzfs_arc_meta_prune\fR (int)
577.ad
578.RS 12n
ea04106b
AX
579The number of dentries and inodes to be scanned looking for entries
580which can be dropped. This may be required when the ARC reaches the
581\fBzfs_arc_meta_limit\fR because dentries and inodes can pin buffers
582in the ARC. Increasing this value will cause to dentry and inode caches
583to be pruned more aggressively. Setting this value to 0 will disable
584pruning the inode and dentry caches.
a08ee875 585.sp
ea04106b
AX
586Default value: \fB10,000\fR.
587.RE
588
589.sp
590.ne 2
591.na
41d74433 592\fBzfs_arc_meta_strategy\fR (int)
ea04106b
AX
593.ad
594.RS 12n
41d74433
AX
595Define the strategy for ARC meta data buffer eviction (meta reclaim strategy).
596A value of 0 (META_ONLY) will evict only the ARC meta data buffers.
597A value of 1 (BALANCED) indicates that additional data buffers may be evicted if
598that is required to in order to evict the required number of meta data buffers.
ea04106b 599.sp
41d74433 600Default value: \fB1\fR.
a08ee875
LG
601.RE
602
603.sp
604.ne 2
605.na
606\fBzfs_arc_min\fR (ulong)
607.ad
608.RS 12n
41d74433
AX
609Min arc size of ARC in bytes. If set to 0 then arc_c_min will default to
610consuming the larger of 32M or 1/32 of total system memory.
a08ee875 611.sp
41d74433 612Default value: \fB0\fR.
a08ee875
LG
613.RE
614
615.sp
616.ne 2
617.na
618\fBzfs_arc_min_prefetch_lifespan\fR (int)
619.ad
620.RS 12n
cae5b340
AX
621Minimum time prefetched blocks are locked in the ARC, specified in jiffies.
622A value of 0 will default to 1 second.
a08ee875 623.sp
cae5b340 624Default value: \fB0\fR.
a08ee875
LG
625.RE
626
e10b0808
AX
627.sp
628.ne 2
629.na
cae5b340 630\fBzfs_multilist_num_sublists\fR (int)
e10b0808
AX
631.ad
632.RS 12n
633To allow more fine-grained locking, each ARC state contains a series
634of lists for both data and meta data objects. Locking is performed at
635the level of these "sub-lists". This parameters controls the number of
cae5b340
AX
636sub-lists per ARC state, and also applies to other uses of the
637multilist data structure.
e10b0808 638.sp
cae5b340 639Default value: \fB4\fR or the number of online CPUs, whichever is greater
e10b0808
AX
640.RE
641
642.sp
643.ne 2
644.na
645\fBzfs_arc_overflow_shift\fR (int)
646.ad
647.RS 12n
648The ARC size is considered to be overflowing if it exceeds the current
649ARC target size (arc_c) by a threshold determined by this parameter.
650The threshold is calculated as a fraction of arc_c using the formula
651"arc_c >> \fBzfs_arc_overflow_shift\fR".
652
653The default value of 8 causes the ARC to be considered to be overflowing
654if it exceeds the target size by 1/256th (0.3%) of the target size.
655
656When the ARC is overflowing, new buffer allocations are stalled until
657the reclaim thread catches up and the overflow condition no longer exists.
658.sp
659Default value: \fB8\fR.
660.RE
661
662.sp
663.ne 2
664.na
665
666\fBzfs_arc_p_min_shift\fR (int)
667.ad
668.RS 12n
41d74433
AX
669If set to a non zero value, this will update arc_p_min_shift (default 4)
670with the new value.
671arc_p_min_shift is used to shift of arc_c for calculating both min and max
672max arc_p
e10b0808 673.sp
41d74433 674Default value: \fB0\fR.
e10b0808
AX
675.RE
676
ea04106b
AX
677.sp
678.ne 2
679.na
680\fBzfs_arc_p_dampener_disable\fR (int)
681.ad
682.RS 12n
683Disable arc_p adapt dampener
684.sp
685Use \fB1\fR for yes (default) and \fB0\fR to disable.
a08ee875
LG
686.RE
687
688.sp
689.ne 2
690.na
691\fBzfs_arc_shrink_shift\fR (int)
692.ad
693.RS 12n
41d74433
AX
694If set to a non zero value, this will update arc_shrink_shift (default 7)
695with the new value.
a08ee875 696.sp
41d74433 697Default value: \fB0\fR.
a08ee875
LG
698.RE
699
cae5b340
AX
700.sp
701.ne 2
702.na
703\fBzfs_arc_pc_percent\fR (uint)
704.ad
705.RS 12n
706Percent of pagecache to reclaim arc to
707
708This tunable allows ZFS arc to play more nicely with the kernel's LRU
709pagecache. It can guarantee that the arc size won't collapse under scanning
710pressure on the pagecache, yet still allows arc to be reclaimed down to
711zfs_arc_min if necessary. This value is specified as percent of pagecache
712size (as measured by NR_FILE_PAGES) where that percent may exceed 100. This
713only operates during memory pressure/reclaim.
714.sp
715Default value: \fB0\fR (disabled).
716.RE
717
e10b0808
AX
718.sp
719.ne 2
720.na
721\fBzfs_arc_sys_free\fR (ulong)
722.ad
723.RS 12n
724The target number of bytes the ARC should leave as free memory on the system.
725Defaults to the larger of 1/64 of physical memory or 512K. Setting this
726option to a non-zero value will override the default.
727.sp
728Default value: \fB0\fR.
729.RE
730
a08ee875
LG
731.sp
732.ne 2
733.na
734\fBzfs_autoimport_disable\fR (int)
735.ad
736.RS 12n
ea04106b 737Disable pool import at module load by ignoring the cache file (typically \fB/etc/zfs/zpool.cache\fR).
a08ee875 738.sp
e10b0808
AX
739Use \fB1\fR for yes (default) and \fB0\fR for no.
740.RE
741
42f7b73b
AX
742.sp
743.ne 2
744.na
745\fBzfs_checksums_per_second\fR (int)
746.ad
747.RS 12n
748Rate limit checksum events to this many per second. Note that this should
749not be set below the zed thresholds (currently 10 checksums over 10 sec)
750or else zed may not trigger any action.
751.sp
752Default value: 20
753.RE
754
755.sp
756.ne 2
757.na
758\fBzfs_commit_timeout_pct\fR (int)
759.ad
760.RS 12n
761This controls the amount of time that a ZIL block (lwb) will remain "open"
762when it isn't "full", and it has a thread waiting for it to be committed to
763stable storage. The timeout is scaled based on a percentage of the last lwb
764latency to avoid significantly impacting the latency of each individual
765transaction record (itx).
766.sp
767Default value: \fB5\fR%.
768.RE
769
e10b0808
AX
770.sp
771.ne 2
772.na
773\fBzfs_dbgmsg_enable\fR (int)
774.ad
775.RS 12n
776Internally ZFS keeps a small log to facilitate debugging. By default the log
777is disabled, to enable it set this option to 1. The contents of the log can
778be accessed by reading the /proc/spl/kstat/zfs/dbgmsg file. Writing 0 to
779this proc file clears the log.
780.sp
781Default value: \fB0\fR.
782.RE
783
784.sp
785.ne 2
786.na
787\fBzfs_dbgmsg_maxsize\fR (int)
788.ad
789.RS 12n
790The maximum size in bytes of the internal ZFS debug log.
791.sp
792Default value: \fB4M\fR.
a08ee875
LG
793.RE
794
795.sp
796.ne 2
797.na
798\fBzfs_dbuf_state_index\fR (int)
799.ad
800.RS 12n
cae5b340
AX
801This feature is currently unused. It is normally used for controlling what
802reporting is available under /proc/spl/kstat/zfs.
a08ee875
LG
803.sp
804Default value: \fB0\fR.
805.RE
806
807.sp
808.ne 2
809.na
810\fBzfs_deadman_enabled\fR (int)
811.ad
812.RS 12n
cae5b340
AX
813When a pool sync operation takes longer than \fBzfs_deadman_synctime_ms\fR
814milliseconds, a "slow spa_sync" message is logged to the debug log
815(see \fBzfs_dbgmsg_enable\fR). If \fBzfs_deadman_enabled\fR is set,
816all pending IO operations are also checked and if any haven't completed
817within \fBzfs_deadman_synctime_ms\fR milliseconds, a "SLOW IO" message
818is logged to the debug log and a "delay" system event with the details of
819the hung IO is posted.
a08ee875 820.sp
cae5b340
AX
821Use \fB1\fR (default) to enable the slow IO check and \fB0\fR to disable.
822.RE
823
824.sp
825.ne 2
826.na
827\fBzfs_deadman_checktime_ms\fR (int)
828.ad
829.RS 12n
830Once a pool sync operation has taken longer than
831\fBzfs_deadman_synctime_ms\fR milliseconds, continue to check for slow
832operations every \fBzfs_deadman_checktime_ms\fR milliseconds.
833.sp
834Default value: \fB5,000\fR.
a08ee875
LG
835.RE
836
837.sp
838.ne 2
839.na
840\fBzfs_deadman_synctime_ms\fR (ulong)
841.ad
842.RS 12n
cae5b340
AX
843Interval in milliseconds after which the deadman is triggered and also
844the interval after which an IO operation is considered to be "hung"
845if \fBzfs_deadman_enabled\fR is set.
846
847See \fBzfs_deadman_enabled\fR.
a08ee875
LG
848.sp
849Default value: \fB1,000,000\fR.
850.RE
851
852.sp
853.ne 2
854.na
855\fBzfs_dedup_prefetch\fR (int)
856.ad
857.RS 12n
858Enable prefetching dedup-ed blks
859.sp
ea04106b 860Use \fB1\fR for yes and \fB0\fR to disable (default).
a08ee875
LG
861.RE
862
863.sp
864.ne 2
865.na
866\fBzfs_delay_min_dirty_percent\fR (int)
867.ad
868.RS 12n
869Start to delay each transaction once there is this amount of dirty data,
870expressed as a percentage of \fBzfs_dirty_data_max\fR.
871This value should be >= zfs_vdev_async_write_active_max_dirty_percent.
872See the section "ZFS TRANSACTION DELAY".
873.sp
874Default value: \fB60\fR.
875.RE
876
877.sp
878.ne 2
879.na
880\fBzfs_delay_scale\fR (int)
881.ad
882.RS 12n
883This controls how quickly the transaction delay approaches infinity.
884Larger values cause longer delays for a given amount of dirty data.
885.sp
886For the smoothest delay, this value should be about 1 billion divided
887by the maximum number of operations per second. This will smoothly
888handle between 10x and 1/10th this number.
889.sp
890See the section "ZFS TRANSACTION DELAY".
891.sp
892Note: \fBzfs_delay_scale\fR * \fBzfs_dirty_data_max\fR must be < 2^64.
893.sp
894Default value: \fB500,000\fR.
895.RE
896
42f7b73b
AX
897.sp
898.ne 2
899.na
900\fBzfs_delays_per_second\fR (int)
901.ad
902.RS 12n
903Rate limit IO delay events to this many per second.
904.sp
905Default value: 20
906.RE
907
cae5b340
AX
908.sp
909.ne 2
910.na
911\fBzfs_delete_blocks\fR (ulong)
912.ad
913.RS 12n
914This is the used to define a large file for the purposes of delete. Files
915containing more than \fBzfs_delete_blocks\fR will be deleted asynchronously
916while smaller files are deleted synchronously. Decreasing this value will
917reduce the time spent in an unlink(2) system call at the expense of a longer
918delay before the freed space is available.
919.sp
920Default value: \fB20,480\fR.
921.RE
922
a08ee875
LG
923.sp
924.ne 2
925.na
926\fBzfs_dirty_data_max\fR (int)
927.ad
928.RS 12n
929Determines the dirty space limit in bytes. Once this limit is exceeded, new
930writes are halted until space frees up. This parameter takes precedence
931over \fBzfs_dirty_data_max_percent\fR.
932See the section "ZFS TRANSACTION DELAY".
933.sp
934Default value: 10 percent of all memory, capped at \fBzfs_dirty_data_max_max\fR.
935.RE
936
937.sp
938.ne 2
939.na
940\fBzfs_dirty_data_max_max\fR (int)
941.ad
942.RS 12n
943Maximum allowable value of \fBzfs_dirty_data_max\fR, expressed in bytes.
944This limit is only enforced at module load time, and will be ignored if
945\fBzfs_dirty_data_max\fR is later changed. This parameter takes
946precedence over \fBzfs_dirty_data_max_max_percent\fR. See the section
947"ZFS TRANSACTION DELAY".
948.sp
949Default value: 25% of physical RAM.
950.RE
951
952.sp
953.ne 2
954.na
955\fBzfs_dirty_data_max_max_percent\fR (int)
956.ad
957.RS 12n
958Maximum allowable value of \fBzfs_dirty_data_max\fR, expressed as a
959percentage of physical RAM. This limit is only enforced at module load
960time, and will be ignored if \fBzfs_dirty_data_max\fR is later changed.
961The parameter \fBzfs_dirty_data_max_max\fR takes precedence over this
962one. See the section "ZFS TRANSACTION DELAY".
963.sp
cae5b340 964Default value: \fB25\fR.
a08ee875
LG
965.RE
966
967.sp
968.ne 2
969.na
970\fBzfs_dirty_data_max_percent\fR (int)
971.ad
972.RS 12n
973Determines the dirty space limit, expressed as a percentage of all
974memory. Once this limit is exceeded, new writes are halted until space frees
975up. The parameter \fBzfs_dirty_data_max\fR takes precedence over this
976one. See the section "ZFS TRANSACTION DELAY".
977.sp
978Default value: 10%, subject to \fBzfs_dirty_data_max_max\fR.
979.RE
980
981.sp
982.ne 2
983.na
984\fBzfs_dirty_data_sync\fR (int)
985.ad
986.RS 12n
987Start syncing out a transaction group if there is at least this much dirty data.
988.sp
989Default value: \fB67,108,864\fR.
990.RE
991
cae5b340
AX
992.sp
993.ne 2
994.na
995\fBzfs_fletcher_4_impl\fR (string)
996.ad
997.RS 12n
998Select a fletcher 4 implementation.
999.sp
1000Supported selectors are: \fBfastest\fR, \fBscalar\fR, \fBsse2\fR, \fBssse3\fR,
1001\fBavx2\fR, \fBavx512f\fR, and \fBaarch64_neon\fR.
1002All of the selectors except \fBfastest\fR and \fBscalar\fR require instruction
1003set extensions to be available and will only appear if ZFS detects that they are
1004present at runtime. If multiple implementations of fletcher 4 are available,
1005the \fBfastest\fR will be chosen using a micro benchmark. Selecting \fBscalar\fR
1006results in the original, CPU based calculation, being used. Selecting any option
1007other than \fBfastest\fR and \fBscalar\fR results in vector instructions from
1008the respective CPU instruction set being used.
1009.sp
1010Default value: \fBfastest\fR.
1011.RE
1012
1013.sp
1014.ne 2
1015.na
1016\fBzfs_free_bpobj_enabled\fR (int)
1017.ad
1018.RS 12n
1019Enable/disable the processing of the free_bpobj object.
1020.sp
1021Default value: \fB1\fR.
1022.RE
1023
ea04106b
AX
1024.sp
1025.ne 2
1026.na
1027\fBzfs_free_max_blocks\fR (ulong)
1028.ad
1029.RS 12n
1030Maximum number of blocks freed in a single txg.
1031.sp
1032Default value: \fB100,000\fR.
1033.RE
1034
a08ee875
LG
1035.sp
1036.ne 2
1037.na
1038\fBzfs_vdev_async_read_max_active\fR (int)
1039.ad
1040.RS 12n
cae5b340 1041Maximum asynchronous read I/Os active to each device.
a08ee875
LG
1042See the section "ZFS I/O SCHEDULER".
1043.sp
1044Default value: \fB3\fR.
1045.RE
1046
1047.sp
1048.ne 2
1049.na
1050\fBzfs_vdev_async_read_min_active\fR (int)
1051.ad
1052.RS 12n
1053Minimum asynchronous read I/Os active to each device.
1054See the section "ZFS I/O SCHEDULER".
1055.sp
1056Default value: \fB1\fR.
1057.RE
1058
1059.sp
1060.ne 2
1061.na
1062\fBzfs_vdev_async_write_active_max_dirty_percent\fR (int)
1063.ad
1064.RS 12n
1065When the pool has more than
1066\fBzfs_vdev_async_write_active_max_dirty_percent\fR dirty data, use
1067\fBzfs_vdev_async_write_max_active\fR to limit active async writes. If
1068the dirty data is between min and max, the active I/O limit is linearly
1069interpolated. See the section "ZFS I/O SCHEDULER".
1070.sp
1071Default value: \fB60\fR.
1072.RE
1073
1074.sp
1075.ne 2
1076.na
1077\fBzfs_vdev_async_write_active_min_dirty_percent\fR (int)
1078.ad
1079.RS 12n
1080When the pool has less than
1081\fBzfs_vdev_async_write_active_min_dirty_percent\fR dirty data, use
1082\fBzfs_vdev_async_write_min_active\fR to limit active async writes. If
1083the dirty data is between min and max, the active I/O limit is linearly
1084interpolated. See the section "ZFS I/O SCHEDULER".
1085.sp
1086Default value: \fB30\fR.
1087.RE
1088
1089.sp
1090.ne 2
1091.na
1092\fBzfs_vdev_async_write_max_active\fR (int)
1093.ad
1094.RS 12n
cae5b340 1095Maximum asynchronous write I/Os active to each device.
a08ee875
LG
1096See the section "ZFS I/O SCHEDULER".
1097.sp
1098Default value: \fB10\fR.
1099.RE
1100
1101.sp
1102.ne 2
1103.na
1104\fBzfs_vdev_async_write_min_active\fR (int)
1105.ad
1106.RS 12n
1107Minimum asynchronous write I/Os active to each device.
1108See the section "ZFS I/O SCHEDULER".
1109.sp
cae5b340
AX
1110Lower values are associated with better latency on rotational media but poorer
1111resilver performance. The default value of 2 was chosen as a compromise. A
1112value of 3 has been shown to improve resilver performance further at a cost of
1113further increasing latency.
1114.sp
1115Default value: \fB2\fR.
a08ee875
LG
1116.RE
1117
1118.sp
1119.ne 2
1120.na
1121\fBzfs_vdev_max_active\fR (int)
1122.ad
1123.RS 12n
1124The maximum number of I/Os active to each device. Ideally, this will be >=
1125the sum of each queue's max_active. It must be at least the sum of each
1126queue's min_active. See the section "ZFS I/O SCHEDULER".
1127.sp
1128Default value: \fB1,000\fR.
1129.RE
1130
1131.sp
1132.ne 2
1133.na
1134\fBzfs_vdev_scrub_max_active\fR (int)
1135.ad
1136.RS 12n
cae5b340 1137Maximum scrub I/Os active to each device.
a08ee875
LG
1138See the section "ZFS I/O SCHEDULER".
1139.sp
1140Default value: \fB2\fR.
1141.RE
1142
1143.sp
1144.ne 2
1145.na
1146\fBzfs_vdev_scrub_min_active\fR (int)
1147.ad
1148.RS 12n
1149Minimum scrub I/Os active to each device.
1150See the section "ZFS I/O SCHEDULER".
1151.sp
1152Default value: \fB1\fR.
1153.RE
1154
1155.sp
1156.ne 2
1157.na
1158\fBzfs_vdev_sync_read_max_active\fR (int)
1159.ad
1160.RS 12n
cae5b340 1161Maximum synchronous read I/Os active to each device.
a08ee875
LG
1162See the section "ZFS I/O SCHEDULER".
1163.sp
1164Default value: \fB10\fR.
1165.RE
1166
1167.sp
1168.ne 2
1169.na
1170\fBzfs_vdev_sync_read_min_active\fR (int)
1171.ad
1172.RS 12n
1173Minimum synchronous read I/Os active to each device.
1174See the section "ZFS I/O SCHEDULER".
1175.sp
1176Default value: \fB10\fR.
1177.RE
1178
1179.sp
1180.ne 2
1181.na
1182\fBzfs_vdev_sync_write_max_active\fR (int)
1183.ad
1184.RS 12n
cae5b340 1185Maximum synchronous write I/Os active to each device.
a08ee875
LG
1186See the section "ZFS I/O SCHEDULER".
1187.sp
1188Default value: \fB10\fR.
1189.RE
1190
1191.sp
1192.ne 2
1193.na
1194\fBzfs_vdev_sync_write_min_active\fR (int)
1195.ad
1196.RS 12n
1197Minimum synchronous write I/Os active to each device.
1198See the section "ZFS I/O SCHEDULER".
1199.sp
1200Default value: \fB10\fR.
1201.RE
1202
cae5b340
AX
1203.sp
1204.ne 2
1205.na
1206\fBzfs_vdev_queue_depth_pct\fR (int)
1207.ad
1208.RS 12n
1209Maximum number of queued allocations per top-level vdev expressed as
1210a percentage of \fBzfs_vdev_async_write_max_active\fR which allows the
1211system to detect devices that are more capable of handling allocations
1212and to allocate more blocks to those devices. It allows for dynamic
1213allocation distribution when devices are imbalanced as fuller devices
1214will tend to be slower than empty devices.
1215
1216See also \fBzio_dva_throttle_enabled\fR.
1217.sp
1218Default value: \fB1000\fR.
1219.RE
1220
a08ee875
LG
1221.sp
1222.ne 2
1223.na
1224\fBzfs_disable_dup_eviction\fR (int)
1225.ad
1226.RS 12n
1227Disable duplicate buffer eviction
1228.sp
1229Use \fB1\fR for yes and \fB0\fR for no (default).
1230.RE
1231
1232.sp
1233.ne 2
1234.na
1235\fBzfs_expire_snapshot\fR (int)
1236.ad
1237.RS 12n
1238Seconds to expire .zfs/snapshot
1239.sp
1240Default value: \fB300\fR.
1241.RE
1242
e10b0808
AX
1243.sp
1244.ne 2
1245.na
1246\fBzfs_admin_snapshot\fR (int)
1247.ad
1248.RS 12n
1249Allow the creation, removal, or renaming of entries in the .zfs/snapshot
1250directory to cause the creation, destruction, or renaming of snapshots.
1251When enabled this functionality works both locally and over NFS exports
1252which have the 'no_root_squash' option set. This functionality is disabled
1253by default.
1254.sp
1255Use \fB1\fR for yes and \fB0\fR for no (default).
1256.RE
1257
a08ee875
LG
1258.sp
1259.ne 2
1260.na
1261\fBzfs_flags\fR (int)
1262.ad
1263.RS 12n
ea04106b
AX
1264Set additional debugging flags. The following flags may be bitwise-or'd
1265together.
1266.sp
1267.TS
1268box;
1269rB lB
1270lB lB
1271r l.
1272Value Symbolic Name
1273 Description
1274_
12751 ZFS_DEBUG_DPRINTF
1276 Enable dprintf entries in the debug log.
1277_
12782 ZFS_DEBUG_DBUF_VERIFY *
1279 Enable extra dbuf verifications.
1280_
12814 ZFS_DEBUG_DNODE_VERIFY *
1282 Enable extra dnode verifications.
1283_
12848 ZFS_DEBUG_SNAPNAMES
1285 Enable snapshot name verification.
1286_
128716 ZFS_DEBUG_MODIFY
1288 Check for illegally modified ARC buffers.
1289_
129032 ZFS_DEBUG_SPA
1291 Enable spa_dbgmsg entries in the debug log.
1292_
129364 ZFS_DEBUG_ZIO_FREE
1294 Enable verification of block frees.
1295_
1296128 ZFS_DEBUG_HISTOGRAM_VERIFY
1297 Enable extra spacemap histogram verifications.
cae5b340
AX
1298_
1299256 ZFS_DEBUG_METASLAB_VERIFY
1300 Verify space accounting on disk matches in-core range_trees.
1301_
1302512 ZFS_DEBUG_SET_ERROR
1303 Enable SET_ERROR and dprintf entries in the debug log.
ea04106b
AX
1304.TE
1305.sp
1306* Requires debug build.
a08ee875 1307.sp
ea04106b
AX
1308Default value: \fB0\fR.
1309.RE
1310
1311.sp
1312.ne 2
1313.na
1314\fBzfs_free_leak_on_eio\fR (int)
1315.ad
1316.RS 12n
1317If destroy encounters an EIO while reading metadata (e.g. indirect
1318blocks), space referenced by the missing metadata can not be freed.
1319Normally this causes the background destroy to become "stalled", as
1320it is unable to make forward progress. While in this stalled state,
1321all remaining space to free from the error-encountering filesystem is
1322"temporarily leaked". Set this flag to cause it to ignore the EIO,
1323permanently leak the space from indirect blocks that can not be read,
1324and continue to free everything else that it can.
1325
1326The default, "stalling" behavior is useful if the storage partially
1327fails (i.e. some but not all i/os fail), and then later recovers. In
1328this case, we will be able to continue pool operations while it is
1329partially failed, and when it recovers, we can continue to free the
1330space, with no leaks. However, note that this case is actually
1331fairly rare.
1332
1333Typically pools either (a) fail completely (but perhaps temporarily,
1334e.g. a top-level vdev going offline), or (b) have localized,
1335permanent errors (e.g. disk returns the wrong data due to bit flip or
1336firmware bug). In case (a), this setting does not matter because the
1337pool will be suspended and the sync thread will not be able to make
1338forward progress regardless. In case (b), because the error is
1339permanent, the best we can do is leak the minimum amount of space,
1340which is what setting this flag will do. Therefore, it is reasonable
1341for this flag to normally be set, but we chose the more conservative
1342approach of not setting it, so that there is no possibility of
1343leaking space in the "partial temporary" failure case.
1344.sp
1345Default value: \fB0\fR.
a08ee875
LG
1346.RE
1347
1348.sp
1349.ne 2
1350.na
1351\fBzfs_free_min_time_ms\fR (int)
1352.ad
1353.RS 12n
cae5b340
AX
1354During a \fBzfs destroy\fR operation using \fBfeature@async_destroy\fR a minimum
1355of this much time will be spent working on freeing blocks per txg.
a08ee875
LG
1356.sp
1357Default value: \fB1,000\fR.
1358.RE
1359
1360.sp
1361.ne 2
1362.na
1363\fBzfs_immediate_write_sz\fR (long)
1364.ad
1365.RS 12n
cae5b340
AX
1366Largest data block to write to zil. Larger blocks will be treated as if the
1367dataset being written to had the property setting \fBlogbias=throughput\fR.
a08ee875
LG
1368.sp
1369Default value: \fB32,768\fR.
1370.RE
1371
e10b0808
AX
1372.sp
1373.ne 2
1374.na
1375\fBzfs_max_recordsize\fR (int)
1376.ad
1377.RS 12n
1378We currently support block sizes from 512 bytes to 16MB. The benefits of
1379larger blocks, and thus larger IO, need to be weighed against the cost of
1380COWing a giant block to modify one byte. Additionally, very large blocks
1381can have an impact on i/o latency, and also potentially on the memory
1382allocator. Therefore, we do not allow the recordsize to be set larger than
1383zfs_max_recordsize (default 1MB). Larger blocks can be created by changing
1384this tunable, and pools with larger blocks can always be imported and used,
1385regardless of this setting.
1386.sp
1387Default value: \fB1,048,576\fR.
1388.RE
1389
a08ee875
LG
1390.sp
1391.ne 2
1392.na
1393\fBzfs_mdcomp_disable\fR (int)
1394.ad
1395.RS 12n
1396Disable meta data compression
1397.sp
1398Use \fB1\fR for yes and \fB0\fR for no (default).
1399.RE
1400
ea04106b
AX
1401.sp
1402.ne 2
1403.na
1404\fBzfs_metaslab_fragmentation_threshold\fR (int)
1405.ad
1406.RS 12n
1407Allow metaslabs to keep their active state as long as their fragmentation
1408percentage is less than or equal to this value. An active metaslab that
1409exceeds this threshold will no longer keep its active status allowing
1410better metaslabs to be selected.
1411.sp
1412Default value: \fB70\fR.
1413.RE
1414
1415.sp
1416.ne 2
1417.na
1418\fBzfs_mg_fragmentation_threshold\fR (int)
1419.ad
1420.RS 12n
1421Metaslab groups are considered eligible for allocations if their
cae5b340 1422fragmentation metric (measured as a percentage) is less than or equal to
ea04106b
AX
1423this value. If a metaslab group exceeds this threshold then it will be
1424skipped unless all metaslab groups within the metaslab class have also
1425crossed this threshold.
1426.sp
1427Default value: \fB85\fR.
1428.RE
1429
1430.sp
1431.ne 2
1432.na
1433\fBzfs_mg_noalloc_threshold\fR (int)
1434.ad
1435.RS 12n
1436Defines a threshold at which metaslab groups should be eligible for
1437allocations. The value is expressed as a percentage of free space
1438beyond which a metaslab group is always eligible for allocations.
1439If a metaslab group's free space is less than or equal to the
cae5b340 1440threshold, the allocator will avoid allocating to that group
ea04106b
AX
1441unless all groups in the pool have reached the threshold. Once all
1442groups have reached the threshold, all groups are allowed to accept
1443allocations. The default value of 0 disables the feature and causes
1444all metaslab groups to be eligible for allocations.
1445
cae5b340 1446This parameter allows one to deal with pools having heavily imbalanced
ea04106b
AX
1447vdevs such as would be the case when a new vdev has been added.
1448Setting the threshold to a non-zero percentage will stop allocations
1449from being made to vdevs that aren't filled to the specified percentage
1450and allow lesser filled vdevs to acquire more allocations than they
1451otherwise would under the old \fBzfs_mg_alloc_failures\fR facility.
1452.sp
1453Default value: \fB0\fR.
1454.RE
1455
cae5b340
AX
1456.sp
1457.ne 2
1458.na
1459\fBzfs_multihost_history\fR (int)
1460.ad
1461.RS 12n
1462Historical statistics for the last N multihost updates will be available in
1463\fB/proc/spl/kstat/zfs/<pool>/multihost\fR
1464.sp
1465Default value: \fB0\fR.
1466.RE
1467
1468.sp
1469.ne 2
1470.na
1471\fBzfs_multihost_interval\fR (ulong)
1472.ad
1473.RS 12n
1474Used to control the frequency of multihost writes which are performed when the
1475\fBmultihost\fR pool property is on. This is one factor used to determine
1476the length of the activity check during import.
1477.sp
1478The multihost write period is \fBzfs_multihost_interval / leaf-vdevs\fR milliseconds.
1479This means that on average a multihost write will be issued for each leaf vdev every
1480\fBzfs_multihost_interval\fR milliseconds. In practice, the observed period can
1481vary with the I/O load and this observed value is the delay which is stored in
1482the uberblock.
1483.sp
1484On import the activity check waits a minimum amount of time determined by
1485\fBzfs_multihost_interval * zfs_multihost_import_intervals\fR. The activity
1486check time may be further extended if the value of mmp delay found in the best
1487uberblock indicates actual multihost updates happened at longer intervals than
1488\fBzfs_multihost_interval\fR. A minimum value of \fB100ms\fR is enforced.
1489.sp
1490Default value: \fB1000\fR.
1491.RE
1492
1493.sp
1494.ne 2
1495.na
1496\fBzfs_multihost_import_intervals\fR (uint)
1497.ad
1498.RS 12n
1499Used to control the duration of the activity test on import. Smaller values of
1500\fBzfs_multihost_import_intervals\fR will reduce the import time but increase
1501the risk of failing to detect an active pool. The total activity check time is
1502never allowed to drop below one second. A value of 0 is ignored and treated as
1503if it was set to 1
1504.sp
1505Default value: \fB10\fR.
1506.RE
1507
1508.sp
1509.ne 2
1510.na
1511\fBzfs_multihost_fail_intervals\fR (uint)
1512.ad
1513.RS 12n
1514Controls the behavior of the pool when multihost write failures are detected.
1515.sp
1516When \fBzfs_multihost_fail_intervals = 0\fR then multihost write failures are ignored.
1517The failures will still be reported to the ZED which depending on its
1518configuration may take action such as suspending the pool or offlining a device.
1519.sp
1520When \fBzfs_multihost_fail_intervals > 0\fR then sequential multihost write failures
1521will cause the pool to be suspended. This occurs when
1522\fBzfs_multihost_fail_intervals * zfs_multihost_interval\fR milliseconds have
1523passed since the last successful multihost write. This guarantees the activity test
1524will see multihost writes if the pool is imported.
1525.sp
1526Default value: \fB5\fR.
1527.RE
1528
a08ee875
LG
1529.sp
1530.ne 2
1531.na
1532\fBzfs_no_scrub_io\fR (int)
1533.ad
1534.RS 12n
cae5b340
AX
1535Set for no scrub I/O. This results in scrubs not actually scrubbing data and
1536simply doing a metadata crawl of the pool instead.
a08ee875
LG
1537.sp
1538Use \fB1\fR for yes and \fB0\fR for no (default).
1539.RE
1540
1541.sp
1542.ne 2
1543.na
1544\fBzfs_no_scrub_prefetch\fR (int)
1545.ad
1546.RS 12n
cae5b340 1547Set to disable block prefetching for scrubs.
a08ee875
LG
1548.sp
1549Use \fB1\fR for yes and \fB0\fR for no (default).
1550.RE
1551
1552.sp
1553.ne 2
1554.na
1555\fBzfs_nocacheflush\fR (int)
1556.ad
1557.RS 12n
cae5b340
AX
1558Disable cache flush operations on disks when writing. Beware, this may cause
1559corruption if disks re-order writes.
a08ee875
LG
1560.sp
1561Use \fB1\fR for yes and \fB0\fR for no (default).
1562.RE
1563
1564.sp
1565.ne 2
1566.na
1567\fBzfs_nopwrite_enabled\fR (int)
1568.ad
1569.RS 12n
1570Enable NOP writes
1571.sp
1572Use \fB1\fR for yes (default) and \fB0\fR to disable.
1573.RE
1574
cae5b340
AX
1575.sp
1576.ne 2
1577.na
1578\fBzfs_dmu_offset_next_sync\fR (int)
1579.ad
1580.RS 12n
1581Enable forcing txg sync to find holes. When enabled forces ZFS to act
1582like prior versions when SEEK_HOLE or SEEK_DATA flags are used, which
1583when a dnode is dirty causes txg's to be synced so that this data can be
1584found.
1585.sp
1586Use \fB1\fR for yes and \fB0\fR to disable (default).
1587.RE
1588
a08ee875
LG
1589.sp
1590.ne 2
1591.na
ea04106b 1592\fBzfs_pd_bytes_max\fR (int)
a08ee875
LG
1593.ad
1594.RS 12n
cae5b340
AX
1595The number of bytes which should be prefetched during a pool traversal
1596(eg: \fBzfs send\fR or other data crawling operations)
a08ee875 1597.sp
ea04106b 1598Default value: \fB52,428,800\fR.
a08ee875
LG
1599.RE
1600
cae5b340
AX
1601.sp
1602.ne 2
1603.na
1604\fBzfs_per_txg_dirty_frees_percent \fR (ulong)
1605.ad
1606.RS 12n
1607Tunable to control percentage of dirtied blocks from frees in one TXG.
1608After this threshold is crossed, additional dirty blocks from frees
1609wait until the next TXG.
1610A value of zero will disable this throttle.
1611.sp
1612Default value: \fB30\fR and \fB0\fR to disable.
1613.RE
1614
1615
1616
a08ee875
LG
1617.sp
1618.ne 2
1619.na
1620\fBzfs_prefetch_disable\fR (int)
1621.ad
1622.RS 12n
cae5b340
AX
1623This tunable disables predictive prefetch. Note that it leaves "prescient"
1624prefetch (e.g. prefetch for zfs send) intact. Unlike predictive prefetch,
1625prescient prefetch never issues i/os that end up not being needed, so it
1626can't hurt performance.
a08ee875
LG
1627.sp
1628Use \fB1\fR for yes and \fB0\fR for no (default).
1629.RE
1630
1631.sp
1632.ne 2
1633.na
1634\fBzfs_read_chunk_size\fR (long)
1635.ad
1636.RS 12n
1637Bytes to read per chunk
1638.sp
1639Default value: \fB1,048,576\fR.
1640.RE
1641
1642.sp
1643.ne 2
1644.na
1645\fBzfs_read_history\fR (int)
1646.ad
1647.RS 12n
cae5b340
AX
1648Historical statistics for the last N reads will be available in
1649\fB/proc/spl/kstat/zfs/<pool>/reads\fR
a08ee875 1650.sp
cae5b340 1651Default value: \fB0\fR (no data is kept).
a08ee875
LG
1652.RE
1653
1654.sp
1655.ne 2
1656.na
1657\fBzfs_read_history_hits\fR (int)
1658.ad
1659.RS 12n
1660Include cache hits in read history
1661.sp
1662Use \fB1\fR for yes and \fB0\fR for no (default).
1663.RE
1664
1665.sp
1666.ne 2
1667.na
1668\fBzfs_recover\fR (int)
1669.ad
1670.RS 12n
1671Set to attempt to recover from fatal errors. This should only be used as a
1672last resort, as it typically results in leaked space, or worse.
1673.sp
1674Use \fB1\fR for yes and \fB0\fR for no (default).
1675.RE
1676
1677.sp
1678.ne 2
1679.na
1680\fBzfs_resilver_delay\fR (int)
1681.ad
1682.RS 12n
ea04106b
AX
1683Number of ticks to delay prior to issuing a resilver I/O operation when
1684a non-resilver or non-scrub I/O operation has occurred within the past
1685\fBzfs_scan_idle\fR ticks.
a08ee875
LG
1686.sp
1687Default value: \fB2\fR.
1688.RE
1689
1690.sp
1691.ne 2
1692.na
1693\fBzfs_resilver_min_time_ms\fR (int)
1694.ad
1695.RS 12n
cae5b340
AX
1696Resilvers are processed by the sync thread. While resilvering it will spend
1697at least this much time working on a resilver between txg flushes.
a08ee875
LG
1698.sp
1699Default value: \fB3,000\fR.
1700.RE
1701
42f7b73b
AX
1702.sp
1703.ne 2
1704.na
1705\fBzfs_scan_ignore_errors\fR (int)
1706.ad
1707.RS 12n
1708If set to a nonzero value, remove the DTL (dirty time list) upon
1709completion of a pool scan (scrub) even if there were unrepairable
1710errors. It is intended to be used during pool repair or recovery to
1711stop resilvering when the pool is next imported.
1712.sp
1713Default value: \fB0\fR.
1714.RE
1715
a08ee875
LG
1716.sp
1717.ne 2
1718.na
1719\fBzfs_scan_idle\fR (int)
1720.ad
1721.RS 12n
ea04106b
AX
1722Idle window in clock ticks. During a scrub or a resilver, if
1723a non-scrub or non-resilver I/O operation has occurred during this
1724window, the next scrub or resilver operation is delayed by, respectively
1725\fBzfs_scrub_delay\fR or \fBzfs_resilver_delay\fR ticks.
a08ee875
LG
1726.sp
1727Default value: \fB50\fR.
1728.RE
1729
1730.sp
1731.ne 2
1732.na
1733\fBzfs_scan_min_time_ms\fR (int)
1734.ad
1735.RS 12n
cae5b340
AX
1736Scrubs are processed by the sync thread. While scrubbing it will spend
1737at least this much time working on a scrub between txg flushes.
a08ee875
LG
1738.sp
1739Default value: \fB1,000\fR.
1740.RE
1741
1742.sp
1743.ne 2
1744.na
1745\fBzfs_scrub_delay\fR (int)
1746.ad
1747.RS 12n
ea04106b
AX
1748Number of ticks to delay prior to issuing a scrub I/O operation when
1749a non-scrub or non-resilver I/O operation has occurred within the past
1750\fBzfs_scan_idle\fR ticks.
a08ee875
LG
1751.sp
1752Default value: \fB4\fR.
1753.RE
1754
1755.sp
1756.ne 2
1757.na
1758\fBzfs_send_corrupt_data\fR (int)
1759.ad
1760.RS 12n
cae5b340 1761Allow sending of corrupt data (ignore read/checksum errors when sending data)
a08ee875
LG
1762.sp
1763Use \fB1\fR for yes and \fB0\fR for no (default).
1764.RE
1765
42f7b73b
AX
1766.sp
1767.ne 2
1768.na
1769\fBzfs_send_queue_length\fR (int)
1770.ad
1771.RS 12n
1772The maximum number of bytes allowed in the \fBzfs send\fR queue. This value
1773must be at least twice the maximum block size in use.
1774.sp
1775Default value: \fB16,777,216\fR.
1776.RE
1777
1778.sp
1779.ne 2
1780.na
1781\fBzfs_recv_queue_length\fR (int)
1782.ad
1783.RS 12n
1784.sp
1785The maximum number of bytes allowed in the \fBzfs receive\fR queue. This value
1786must be at least twice the maximum block size in use.
1787.sp
1788Default value: \fB16,777,216\fR.
1789.RE
1790
a08ee875
LG
1791.sp
1792.ne 2
1793.na
1794\fBzfs_sync_pass_deferred_free\fR (int)
1795.ad
1796.RS 12n
cae5b340 1797Flushing of data to disk is done in passes. Defer frees starting in this pass
a08ee875
LG
1798.sp
1799Default value: \fB2\fR.
1800.RE
1801
1802.sp
1803.ne 2
1804.na
1805\fBzfs_sync_pass_dont_compress\fR (int)
1806.ad
1807.RS 12n
1808Don't compress starting in this pass
1809.sp
1810Default value: \fB5\fR.
1811.RE
1812
1813.sp
1814.ne 2
1815.na
1816\fBzfs_sync_pass_rewrite\fR (int)
1817.ad
1818.RS 12n
cae5b340 1819Rewrite new block pointers starting in this pass
a08ee875
LG
1820.sp
1821Default value: \fB2\fR.
1822.RE
1823
1824.sp
1825.ne 2
1826.na
1827\fBzfs_top_maxinflight\fR (int)
1828.ad
1829.RS 12n
cae5b340
AX
1830Max concurrent I/Os per top-level vdev (mirrors or raidz arrays) allowed during
1831scrub or resilver operations.
a08ee875
LG
1832.sp
1833Default value: \fB32\fR.
1834.RE
1835
1836.sp
1837.ne 2
1838.na
1839\fBzfs_txg_history\fR (int)
1840.ad
1841.RS 12n
cae5b340
AX
1842Historical statistics for the last N txgs will be available in
1843\fB/proc/spl/kstat/zfs/<pool>/txgs\fR
a08ee875
LG
1844.sp
1845Default value: \fB0\fR.
1846.RE
1847
1848.sp
1849.ne 2
1850.na
1851\fBzfs_txg_timeout\fR (int)
1852.ad
1853.RS 12n
cae5b340 1854Flush dirty data to disk at least every N seconds (maximum txg duration)
a08ee875
LG
1855.sp
1856Default value: \fB5\fR.
1857.RE
1858
1859.sp
1860.ne 2
1861.na
1862\fBzfs_vdev_aggregation_limit\fR (int)
1863.ad
1864.RS 12n
1865Max vdev I/O aggregation size
1866.sp
1867Default value: \fB131,072\fR.
1868.RE
1869
1870.sp
1871.ne 2
1872.na
1873\fBzfs_vdev_cache_bshift\fR (int)
1874.ad
1875.RS 12n
1876Shift size to inflate reads too
1877.sp
cae5b340 1878Default value: \fB16\fR (effectively 65536).
a08ee875
LG
1879.RE
1880
1881.sp
1882.ne 2
1883.na
1884\fBzfs_vdev_cache_max\fR (int)
1885.ad
1886.RS 12n
41d74433
AX
1887Inflate reads smaller than this value to meet the \fBzfs_vdev_cache_bshift\fR
1888size (default 64k).
cae5b340
AX
1889.sp
1890Default value: \fB16384\fR.
a08ee875
LG
1891.RE
1892
1893.sp
1894.ne 2
1895.na
1896\fBzfs_vdev_cache_size\fR (int)
1897.ad
1898.RS 12n
cae5b340
AX
1899Total size of the per-disk cache in bytes.
1900.sp
1901Currently this feature is disabled as it has been found to not be helpful
1902for performance and in some cases harmful.
a08ee875
LG
1903.sp
1904Default value: \fB0\fR.
1905.RE
1906
1907.sp
1908.ne 2
1909.na
cae5b340 1910\fBzfs_vdev_mirror_rotating_inc\fR (int)
a08ee875
LG
1911.ad
1912.RS 12n
cae5b340
AX
1913A number by which the balancing algorithm increments the load calculation for
1914the purpose of selecting the least busy mirror member when an I/O immediately
1915follows its predecessor on rotational vdevs for the purpose of making decisions
1916based on load.
a08ee875 1917.sp
cae5b340
AX
1918Default value: \fB0\fR.
1919.RE
1920
1921.sp
1922.ne 2
1923.na
1924\fBzfs_vdev_mirror_rotating_seek_inc\fR (int)
1925.ad
1926.RS 12n
1927A number by which the balancing algorithm increments the load calculation for
1928the purpose of selecting the least busy mirror member when an I/O lacks
1929locality as defined by the zfs_vdev_mirror_rotating_seek_offset. I/Os within
1930this that are not immediately following the previous I/O are incremented by
1931half.
1932.sp
1933Default value: \fB5\fR.
1934.RE
1935
1936.sp
1937.ne 2
1938.na
1939\fBzfs_vdev_mirror_rotating_seek_offset\fR (int)
1940.ad
1941.RS 12n
1942The maximum distance for the last queued I/O in which the balancing algorithm
1943considers an I/O to have locality.
1944See the section "ZFS I/O SCHEDULER".
1945.sp
1946Default value: \fB1048576\fR.
1947.RE
1948
1949.sp
1950.ne 2
1951.na
1952\fBzfs_vdev_mirror_non_rotating_inc\fR (int)
1953.ad
1954.RS 12n
1955A number by which the balancing algorithm increments the load calculation for
1956the purpose of selecting the least busy mirror member on non-rotational vdevs
1957when I/Os do not immediately follow one another.
1958.sp
1959Default value: \fB0\fR.
1960.RE
1961
1962.sp
1963.ne 2
1964.na
1965\fBzfs_vdev_mirror_non_rotating_seek_inc\fR (int)
1966.ad
1967.RS 12n
1968A number by which the balancing algorithm increments the load calculation for
1969the purpose of selecting the least busy mirror member when an I/O lacks
1970locality as defined by the zfs_vdev_mirror_rotating_seek_offset. I/Os within
1971this that are not immediately following the previous I/O are incremented by
1972half.
1973.sp
1974Default value: \fB1\fR.
a08ee875
LG
1975.RE
1976
1977.sp
1978.ne 2
1979.na
1980\fBzfs_vdev_read_gap_limit\fR (int)
1981.ad
1982.RS 12n
cae5b340
AX
1983Aggregate read I/O operations if the gap on-disk between them is within this
1984threshold.
a08ee875
LG
1985.sp
1986Default value: \fB32,768\fR.
1987.RE
1988
1989.sp
1990.ne 2
1991.na
1992\fBzfs_vdev_scheduler\fR (charp)
1993.ad
1994.RS 12n
41d74433
AX
1995Set the Linux I/O scheduler on whole disk vdevs to this scheduler. Valid options
1996are noop, cfq, bfq & deadline
a08ee875
LG
1997.sp
1998Default value: \fBnoop\fR.
1999.RE
2000
2001.sp
2002.ne 2
2003.na
2004\fBzfs_vdev_write_gap_limit\fR (int)
2005.ad
2006.RS 12n
2007Aggregate write I/O over gap
2008.sp
2009Default value: \fB4,096\fR.
2010.RE
2011
cae5b340
AX
2012.sp
2013.ne 2
2014.na
2015\fBzfs_vdev_raidz_impl\fR (string)
2016.ad
2017.RS 12n
2018Parameter for selecting raidz parity implementation to use.
2019
2020Options marked (always) below may be selected on module load as they are
2021supported on all systems.
2022The remaining options may only be set after the module is loaded, as they
2023are available only if the implementations are compiled in and supported
2024on the running system.
2025
2026Once the module is loaded, the content of
2027/sys/module/zfs/parameters/zfs_vdev_raidz_impl will show available options
2028with the currently selected one enclosed in [].
2029Possible options are:
2030 fastest - (always) implementation selected using built-in benchmark
2031 original - (always) original raidz implementation
2032 scalar - (always) scalar raidz implementation
2033 sse2 - implementation using SSE2 instruction set (64bit x86 only)
2034 ssse3 - implementation using SSSE3 instruction set (64bit x86 only)
2035 avx2 - implementation using AVX2 instruction set (64bit x86 only)
2036 avx512f - implementation using AVX512F instruction set (64bit x86 only)
2037 avx512bw - implementation using AVX512F & AVX512BW instruction sets (64bit x86 only)
2038 aarch64_neon - implementation using NEON (Aarch64/64 bit ARMv8 only)
2039 aarch64_neonx2 - implementation using NEON with more unrolling (Aarch64/64 bit ARMv8 only)
2040.sp
2041Default value: \fBfastest\fR.
2042.RE
2043
a08ee875
LG
2044.sp
2045.ne 2
2046.na
2047\fBzfs_zevent_cols\fR (int)
2048.ad
2049.RS 12n
cae5b340 2050When zevents are logged to the console use this as the word wrap width.
a08ee875
LG
2051.sp
2052Default value: \fB80\fR.
2053.RE
2054
2055.sp
2056.ne 2
2057.na
2058\fBzfs_zevent_console\fR (int)
2059.ad
2060.RS 12n
2061Log events to the console
2062.sp
2063Use \fB1\fR for yes and \fB0\fR for no (default).
2064.RE
2065
2066.sp
2067.ne 2
2068.na
2069\fBzfs_zevent_len_max\fR (int)
2070.ad
2071.RS 12n
cae5b340
AX
2072Max event queue length. A value of 0 will result in a calculated value which
2073increases with the number of CPUs in the system (minimum 64 events). Events
2074in the queue can be viewed with the \fBzpool events\fR command.
a08ee875
LG
2075.sp
2076Default value: \fB0\fR.
2077.RE
2078
2079.sp
2080.ne 2
2081.na
2082\fBzil_replay_disable\fR (int)
2083.ad
2084.RS 12n
cae5b340
AX
2085Disable intent logging replay. Can be disabled for recovery from corrupted
2086ZIL
a08ee875
LG
2087.sp
2088Use \fB1\fR for yes and \fB0\fR for no (default).
2089.RE
2090
2091.sp
2092.ne 2
2093.na
cae5b340 2094\fBzil_slog_bulk\fR (ulong)
a08ee875
LG
2095.ad
2096.RS 12n
cae5b340
AX
2097Limit SLOG write size per commit executed with synchronous priority.
2098Any writes above that will be executed with lower (asynchronous) priority
2099to limit potential SLOG device abuse by single active ZIL writer.
a08ee875 2100.sp
cae5b340 2101Default value: \fB786,432\fR.
a08ee875
LG
2102.RE
2103
a08ee875
LG
2104.sp
2105.ne 2
2106.na
2107\fBzio_delay_max\fR (int)
2108.ad
2109.RS 12n
cae5b340
AX
2110A zevent will be logged if a ZIO operation takes more than N milliseconds to
2111complete. Note that this is only a logging facility, not a timeout on
2112operations.
a08ee875
LG
2113.sp
2114Default value: \fB30,000\fR.
2115.RE
2116
cae5b340
AX
2117.sp
2118.ne 2
2119.na
2120\fBzio_dva_throttle_enabled\fR (int)
2121.ad
2122.RS 12n
2123Throttle block allocations in the ZIO pipeline. This allows for
2124dynamic allocation distribution when devices are imbalanced.
2125When enabled, the maximum number of pending allocations per top-level vdev
2126is limited by \fBzfs_vdev_queue_depth_pct\fR.
2127.sp
2128Default value: \fB1\fR.
2129.RE
2130
a08ee875
LG
2131.sp
2132.ne 2
2133.na
2134\fBzio_requeue_io_start_cut_in_line\fR (int)
2135.ad
2136.RS 12n
2137Prioritize requeued I/O
2138.sp
2139Default value: \fB0\fR.
2140.RE
2141
94a40997
AX
2142.sp
2143.ne 2
2144.na
2145\fBzio_taskq_batch_pct\fR (uint)
2146.ad
2147.RS 12n
2148Percentage of online CPUs (or CPU cores, etc) which will run a worker thread
2149for IO. These workers are responsible for IO work such as compression and
2150checksum calculations. Fractional number of CPUs will be rounded down.
2151.sp
2152The default value of 75 was chosen to avoid using all CPUs which can result in
2153latency issues and inconsistent application performance, especially when high
2154compression is enabled.
2155.sp
2156Default value: \fB75\fR.
2157.RE
2158
a08ee875
LG
2159.sp
2160.ne 2
2161.na
2162\fBzvol_inhibit_dev\fR (uint)
2163.ad
2164.RS 12n
cae5b340
AX
2165Do not create zvol device nodes. This may slightly improve startup time on
2166systems with a very large number of zvols.
a08ee875
LG
2167.sp
2168Use \fB1\fR for yes and \fB0\fR for no (default).
2169.RE
2170
2171.sp
2172.ne 2
2173.na
2174\fBzvol_major\fR (uint)
2175.ad
2176.RS 12n
cae5b340 2177Major number for zvol block devices
a08ee875
LG
2178.sp
2179Default value: \fB230\fR.
2180.RE
2181
2182.sp
2183.ne 2
2184.na
2185\fBzvol_max_discard_blocks\fR (ulong)
2186.ad
2187.RS 12n
cae5b340
AX
2188Discard (aka TRIM) operations done on zvols will be done in batches of this
2189many blocks, where block size is determined by the \fBvolblocksize\fR property
2190of a zvol.
a08ee875
LG
2191.sp
2192Default value: \fB16,384\fR.
2193.RE
2194
2195.sp
2196.ne 2
2197.na
e10b0808 2198\fBzvol_prefetch_bytes\fR (uint)
a08ee875
LG
2199.ad
2200.RS 12n
e10b0808
AX
2201When adding a zvol to the system prefetch \fBzvol_prefetch_bytes\fR
2202from the start and end of the volume. Prefetching these regions
2203of the volume is desirable because they are likely to be accessed
2204immediately by \fBblkid(8)\fR or by the kernel scanning for a partition
2205table.
a08ee875 2206.sp
e10b0808 2207Default value: \fB131,072\fR.
a08ee875
LG
2208.RE
2209
cae5b340
AX
2210.sp
2211.ne 2
2212.na
2213\fBzvol_request_sync\fR (uint)
2214.ad
2215.RS 12n
2216When processing I/O requests for a zvol submit them synchronously. This
2217effectively limits the queue depth to 1 for each I/O submitter. When set
2218to 0 requests are handled asynchronously by a thread pool. The number of
2219requests which can be handled concurrently is controller by \fBzvol_threads\fR.
2220.sp
2221Default value: \fB0\fR.
2222.RE
2223
2224.sp
2225.ne 2
2226.na
2227\fBzvol_threads\fR (uint)
2228.ad
2229.RS 12n
2230Max number of threads which can handle zvol I/O requests concurrently.
2231.sp
2232Default value: \fB32\fR.
2233.RE
2234
2235.sp
2236.ne 2
2237.na
2238\fBzvol_volmode\fR (uint)
2239.ad
2240.RS 12n
2241Defines zvol block devices behaviour when \fBvolmode\fR is set to \fBdefault\fR.
2242Valid values are \fB1\fR (full), \fB2\fR (dev) and \fB3\fR (none).
2243.sp
2244Default value: \fB1\fR.
2245.RE
2246
2247.sp
2248.ne 2
2249.na
2250\fBzfs_qat_disable\fR (int)
2251.ad
2252.RS 12n
2253This tunable disables qat hardware acceleration for gzip compression.
2254It is available only if qat acceleration is compiled in and qat driver
2255is present.
2256.sp
2257Use \fB1\fR for yes and \fB0\fR for no (default).
2258.RE
2259
a08ee875
LG
2260.SH ZFS I/O SCHEDULER
2261ZFS issues I/O operations to leaf vdevs to satisfy and complete I/Os.
2262The I/O scheduler determines when and in what order those operations are
2263issued. The I/O scheduler divides operations into five I/O classes
2264prioritized in the following order: sync read, sync write, async read,
2265async write, and scrub/resilver. Each queue defines the minimum and
2266maximum number of concurrent operations that may be issued to the
2267device. In addition, the device has an aggregate maximum,
2268\fBzfs_vdev_max_active\fR. Note that the sum of the per-queue minimums
2269must not exceed the aggregate maximum. If the sum of the per-queue
2270maximums exceeds the aggregate maximum, then the number of active I/Os
2271may reach \fBzfs_vdev_max_active\fR, in which case no further I/Os will
2272be issued regardless of whether all per-queue minimums have been met.
2273.sp
2274For many physical devices, throughput increases with the number of
2275concurrent operations, but latency typically suffers. Further, physical
2276devices typically have a limit at which more concurrent operations have no
2277effect on throughput or can actually cause it to decrease.
2278.sp
2279The scheduler selects the next operation to issue by first looking for an
2280I/O class whose minimum has not been satisfied. Once all are satisfied and
2281the aggregate maximum has not been hit, the scheduler looks for classes
2282whose maximum has not been satisfied. Iteration through the I/O classes is
2283done in the order specified above. No further operations are issued if the
2284aggregate maximum number of concurrent operations has been hit or if there
2285are no operations queued for an I/O class that has not hit its maximum.
2286Every time an I/O is queued or an operation completes, the I/O scheduler
2287looks for new operations to issue.
2288.sp
2289In general, smaller max_active's will lead to lower latency of synchronous
2290operations. Larger max_active's may lead to higher overall throughput,
2291depending on underlying storage.
2292.sp
2293The ratio of the queues' max_actives determines the balance of performance
2294between reads, writes, and scrubs. E.g., increasing
2295\fBzfs_vdev_scrub_max_active\fR will cause the scrub or resilver to complete
2296more quickly, but reads and writes to have higher latency and lower throughput.
2297.sp
2298All I/O classes have a fixed maximum number of outstanding operations
2299except for the async write class. Asynchronous writes represent the data
2300that is committed to stable storage during the syncing stage for
2301transaction groups. Transaction groups enter the syncing state
2302periodically so the number of queued async writes will quickly burst up
2303and then bleed down to zero. Rather than servicing them as quickly as
2304possible, the I/O scheduler changes the maximum number of active async
2305write I/Os according to the amount of dirty data in the pool. Since
2306both throughput and latency typically increase with the number of
2307concurrent operations issued to physical devices, reducing the
2308burstiness in the number of concurrent operations also stabilizes the
2309response time of operations from other -- and in particular synchronous
2310-- queues. In broad strokes, the I/O scheduler will issue more
2311concurrent operations from the async write queue as there's more dirty
2312data in the pool.
2313.sp
2314Async Writes
2315.sp
2316The number of concurrent operations issued for the async write I/O class
2317follows a piece-wise linear function defined by a few adjustable points.
2318.nf
2319
2320 | o---------| <-- zfs_vdev_async_write_max_active
2321 ^ | /^ |
2322 | | / | |
2323active | / | |
2324 I/O | / | |
2325count | / | |
2326 | / | |
2327 |-------o | | <-- zfs_vdev_async_write_min_active
2328 0|_______^______|_________|
2329 0% | | 100% of zfs_dirty_data_max
2330 | |
2331 | `-- zfs_vdev_async_write_active_max_dirty_percent
2332 `--------- zfs_vdev_async_write_active_min_dirty_percent
2333
2334.fi
2335Until the amount of dirty data exceeds a minimum percentage of the dirty
2336data allowed in the pool, the I/O scheduler will limit the number of
2337concurrent operations to the minimum. As that threshold is crossed, the
2338number of concurrent operations issued increases linearly to the maximum at
2339the specified maximum percentage of the dirty data allowed in the pool.
2340.sp
2341Ideally, the amount of dirty data on a busy pool will stay in the sloped
2342part of the function between \fBzfs_vdev_async_write_active_min_dirty_percent\fR
2343and \fBzfs_vdev_async_write_active_max_dirty_percent\fR. If it exceeds the
2344maximum percentage, this indicates that the rate of incoming data is
2345greater than the rate that the backend storage can handle. In this case, we
2346must further throttle incoming writes, as described in the next section.
2347
2348.SH ZFS TRANSACTION DELAY
2349We delay transactions when we've determined that the backend storage
2350isn't able to accommodate the rate of incoming writes.
2351.sp
2352If there is already a transaction waiting, we delay relative to when
2353that transaction will finish waiting. This way the calculated delay time
2354is independent of the number of threads concurrently executing
2355transactions.
2356.sp
2357If we are the only waiter, wait relative to when the transaction
2358started, rather than the current time. This credits the transaction for
2359"time already served", e.g. reading indirect blocks.
2360.sp
2361The minimum time for a transaction to take is calculated as:
2362.nf
2363 min_time = zfs_delay_scale * (dirty - min) / (max - dirty)
2364 min_time is then capped at 100 milliseconds.
2365.fi
2366.sp
2367The delay has two degrees of freedom that can be adjusted via tunables. The
2368percentage of dirty data at which we start to delay is defined by
2369\fBzfs_delay_min_dirty_percent\fR. This should typically be at or above
2370\fBzfs_vdev_async_write_active_max_dirty_percent\fR so that we only start to
2371delay after writing at full speed has failed to keep up with the incoming write
2372rate. The scale of the curve is defined by \fBzfs_delay_scale\fR. Roughly speaking,
2373this variable determines the amount of delay at the midpoint of the curve.
2374.sp
2375.nf
2376delay
2377 10ms +-------------------------------------------------------------*+
2378 | *|
2379 9ms + *+
2380 | *|
2381 8ms + *+
2382 | * |
2383 7ms + * +
2384 | * |
2385 6ms + * +
2386 | * |
2387 5ms + * +
2388 | * |
2389 4ms + * +
2390 | * |
2391 3ms + * +
2392 | * |
2393 2ms + (midpoint) * +
2394 | | ** |
2395 1ms + v *** +
2396 | zfs_delay_scale ----------> ******** |
2397 0 +-------------------------------------*********----------------+
2398 0% <- zfs_dirty_data_max -> 100%
2399.fi
2400.sp
2401Note that since the delay is added to the outstanding time remaining on the
2402most recent transaction, the delay is effectively the inverse of IOPS.
2403Here the midpoint of 500us translates to 2000 IOPS. The shape of the curve
2404was chosen such that small changes in the amount of accumulated dirty data
2405in the first 3/4 of the curve yield relatively small differences in the
2406amount of delay.
2407.sp
2408The effects can be easier to understand when the amount of delay is
2409represented on a log scale:
2410.sp
2411.nf
2412delay
2413100ms +-------------------------------------------------------------++
2414 + +
2415 | |
2416 + *+
2417 10ms + *+
2418 + ** +
2419 | (midpoint) ** |
2420 + | ** +
2421 1ms + v **** +
2422 + zfs_delay_scale ----------> ***** +
2423 | **** |
2424 + **** +
2425100us + ** +
2426 + * +
2427 | * |
2428 + * +
2429 10us + * +
2430 + +
2431 | |
2432 + +
2433 +--------------------------------------------------------------+
2434 0% <- zfs_dirty_data_max -> 100%
2435.fi
2436.sp
2437Note here that only as the amount of dirty data approaches its limit does
2438the delay start to increase rapidly. The goal of a properly tuned system
2439should be to keep the amount of dirty data out of that range by first
2440ensuring that the appropriate limits are set for the I/O scheduler to reach
2441optimal throughput on the backend storage, and then by changing the value
2442of \fBzfs_delay_scale\fR to increase the steepness of the curve.