]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - man/man5/zfs-module-parameters.5
Make metaslab_aliquot a module parameter.
[FreeBSD/FreeBSD.git] / man / man5 / zfs-module-parameters.5
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]
15 .TH ZFS-MODULE-PARAMETERS 5 "Nov 16, 2013"
16 .SH NAME
17 zfs\-module\-parameters \- ZFS module parameters
18 .SH DESCRIPTION
19 .sp
20 .LP
21 Description of the different parameters to the ZFS module.
22
23 .SS "Module parameters"
24 .sp
25 .LP
26
27 .sp
28 .ne 2
29 .na
30 \fBl2arc_feed_again\fR (int)
31 .ad
32 .RS 12n
33 Turbo L2ARC warmup
34 .sp
35 Use \fB1\fR for yes (default) and \fB0\fR to disable.
36 .RE
37
38 .sp
39 .ne 2
40 .na
41 \fBl2arc_feed_min_ms\fR (ulong)
42 .ad
43 .RS 12n
44 Min feed interval in milliseconds
45 .sp
46 Default value: \fB200\fR.
47 .RE
48
49 .sp
50 .ne 2
51 .na
52 \fBl2arc_feed_secs\fR (ulong)
53 .ad
54 .RS 12n
55 Seconds between L2ARC writing
56 .sp
57 Default value: \fB1\fR.
58 .RE
59
60 .sp
61 .ne 2
62 .na
63 \fBl2arc_headroom\fR (ulong)
64 .ad
65 .RS 12n
66 Number of max device writes to precache
67 .sp
68 Default value: \fB2\fR.
69 .RE
70
71 .sp
72 .ne 2
73 .na
74 \fBl2arc_headroom_boost\fR (ulong)
75 .ad
76 .RS 12n
77 Compressed l2arc_headroom multiplier
78 .sp
79 Default value: \fB200\fR.
80 .RE
81
82 .sp
83 .ne 2
84 .na
85 \fBl2arc_nocompress\fR (int)
86 .ad
87 .RS 12n
88 Skip compressing L2ARC buffers
89 .sp
90 Use \fB1\fR for yes and \fB0\fR for no (default).
91 .RE
92
93 .sp
94 .ne 2
95 .na
96 \fBl2arc_noprefetch\fR (int)
97 .ad
98 .RS 12n
99 Skip caching prefetched buffers
100 .sp
101 Use \fB1\fR for yes (default) and \fB0\fR to disable.
102 .RE
103
104 .sp
105 .ne 2
106 .na
107 \fBl2arc_norw\fR (int)
108 .ad
109 .RS 12n
110 No reads during writes
111 .sp
112 Use \fB1\fR for yes and \fB0\fR for no (default).
113 .RE
114
115 .sp
116 .ne 2
117 .na
118 \fBl2arc_write_boost\fR (ulong)
119 .ad
120 .RS 12n
121 Extra write bytes during device warmup
122 .sp
123 Default value: \fB8,388,608\fR.
124 .RE
125
126 .sp
127 .ne 2
128 .na
129 \fBl2arc_write_max\fR (ulong)
130 .ad
131 .RS 12n
132 Max write bytes per interval
133 .sp
134 Default value: \fB8,388,608\fR.
135 .RE
136
137 .sp
138 .ne 2
139 .na
140 \fBmetaslab_aliquot\fR (ulong)
141 .ad
142 .RS 12n
143 Metaslab granularity, in bytes. This is roughly similar to what would be
144 referred to as the "stripe size" in traditional RAID arrays. In normal
145 operation, ZFS will try to write this amount of data to a top-level vdev
146 before moving on to the next one.
147 .sp
148 Default value: \fB524,288\fR.
149 .RE
150
151 .sp
152 .ne 2
153 .na
154 \fBmetaslab_bias_enabled\fR (int)
155 .ad
156 .RS 12n
157 Enable metaslab group biasing based on its vdev's over- or under-utilization
158 relative to the pool.
159 .sp
160 Use \fB1\fR for yes (default) and \fB0\fR for no.
161 .RE
162
163 .sp
164 .ne 2
165 .na
166 \fBmetaslab_debug_load\fR (int)
167 .ad
168 .RS 12n
169 Load all metaslabs during pool import.
170 .sp
171 Use \fB1\fR for yes and \fB0\fR for no (default).
172 .RE
173
174 .sp
175 .ne 2
176 .na
177 \fBmetaslab_debug_unload\fR (int)
178 .ad
179 .RS 12n
180 Prevent metaslabs from being unloaded.
181 .sp
182 Use \fB1\fR for yes and \fB0\fR for no (default).
183 .RE
184
185 .sp
186 .ne 2
187 .na
188 \fBmetaslab_fragmentation_factor_enabled\fR (int)
189 .ad
190 .RS 12n
191 Enable use of the fragmentation metric in computing metaslab weights.
192 .sp
193 Use \fB1\fR for yes (default) and \fB0\fR for no.
194 .RE
195
196 .sp
197 .ne 2
198 .na
199 \fBmetaslabs_per_vdev\fR (int)
200 .ad
201 .RS 12n
202 When a vdev is added, it will be divided into approximately (but no more than) this number of metaslabs.
203 .sp
204 Default value: \fB200\fR.
205 .RE
206
207 .sp
208 .ne 2
209 .na
210 \fBmetaslab_preload_enabled\fR (int)
211 .ad
212 .RS 12n
213 Enable metaslab group preloading.
214 .sp
215 Use \fB1\fR for yes (default) and \fB0\fR for no.
216 .RE
217
218 .sp
219 .ne 2
220 .na
221 \fBmetaslab_lba_weighting_enabled\fR (int)
222 .ad
223 .RS 12n
224 Give more weight to metaslabs with lower LBAs, assuming they have
225 greater bandwidth as is typically the case on a modern constant
226 angular velocity disk drive.
227 .sp
228 Use \fB1\fR for yes (default) and \fB0\fR for no.
229 .RE
230
231 .sp
232 .ne 2
233 .na
234 \fBspa_config_path\fR (charp)
235 .ad
236 .RS 12n
237 SPA config file
238 .sp
239 Default value: \fB/etc/zfs/zpool.cache\fR.
240 .RE
241
242 .sp
243 .ne 2
244 .na
245 \fBspa_asize_inflation\fR (int)
246 .ad
247 .RS 12n
248 Multiplication factor used to estimate actual disk consumption from the
249 size of data being written. The default value is a worst case estimate,
250 but lower values may be valid for a given pool depending on its
251 configuration.  Pool administrators who understand the factors involved
252 may wish to specify a more realistic inflation factor, particularly if
253 they operate close to quota or capacity limits.
254 .sp
255 Default value: 24
256 .RE
257
258 .sp
259 .ne 2
260 .na
261 \fBspa_load_verify_data\fR (int)
262 .ad
263 .RS 12n
264 Whether to traverse data blocks during an "extreme rewind" (\fB-X\fR)
265 import.  Use 0 to disable and 1 to enable.
266
267 An extreme rewind import normally performs a full traversal of all
268 blocks in the pool for verification.  If this parameter is set to 0,
269 the traversal skips non-metadata blocks.  It can be toggled once the
270 import has started to stop or start the traversal of non-metadata blocks.
271 .sp
272 Default value: 1
273 .RE
274
275 .sp
276 .ne 2
277 .na
278 \fBspa_load_verify_metadata\fR (int)
279 .ad
280 .RS 12n
281 Whether to traverse blocks during an "extreme rewind" (\fB-X\fR)
282 pool import.  Use 0 to disable and 1 to enable.
283
284 An extreme rewind import normally performs a full traversal of all
285 blocks in the pool for verification.  If this parameter is set to 1,
286 the traversal is not performed.  It can be toggled once the import has
287 started to stop or start the traversal.
288 .sp
289 Default value: 1
290 .RE
291
292 .sp
293 .ne 2
294 .na
295 \fBspa_load_verify_maxinflight\fR (int)
296 .ad
297 .RS 12n
298 Maximum concurrent I/Os during the traversal performed during an "extreme
299 rewind" (\fB-X\fR) pool import.
300 .sp
301 Default value: 10000
302 .RE
303
304 .sp
305 .ne 2
306 .na
307 \fBzfetch_array_rd_sz\fR (ulong)
308 .ad
309 .RS 12n
310 If prefetching is enabled, disable prefetching for reads larger than this size.
311 .sp
312 Default value: \fB1,048,576\fR.
313 .RE
314
315 .sp
316 .ne 2
317 .na
318 \fBzfetch_block_cap\fR (uint)
319 .ad
320 .RS 12n
321 Max number of blocks to prefetch at a time
322 .sp
323 Default value: \fB256\fR.
324 .RE
325
326 .sp
327 .ne 2
328 .na
329 \fBzfetch_max_streams\fR (uint)
330 .ad
331 .RS 12n
332 Max number of streams per zfetch (prefetch streams per file).
333 .sp
334 Default value: \fB8\fR.
335 .RE
336
337 .sp
338 .ne 2
339 .na
340 \fBzfetch_min_sec_reap\fR (uint)
341 .ad
342 .RS 12n
343 Min time before an active prefetch stream can be reclaimed
344 .sp
345 Default value: \fB2\fR.
346 .RE
347
348 .sp
349 .ne 2
350 .na
351 \fBzfs_arc_average_blocksize\fR (int)
352 .ad
353 .RS 12n
354 The ARC's buffer hash table is sized based on the assumption of an average
355 block size of \fBzfs_arc_average_blocksize\fR (default 8K).  This works out
356 to roughly 1MB of hash table per 1GB of physical memory with 8-byte pointers.
357 For configurations with a known larger average block size this value can be
358 increased to reduce the memory footprint.
359
360 .sp
361 Default value: \fB8192\fR.
362 .RE
363
364 .sp
365 .ne 2
366 .na
367 \fBzfs_arc_evict_batch_limit\fR (int)
368 .ad
369 .RS 12n
370 Number ARC headers to evict per sub-list before proceding to another sub-list.
371 This batch-style operation prevents entire sub-lists from being evicted at once
372 but comes at a cost of additional unlocking and locking.
373 .sp
374 Default value: \fB10\fR.
375 .RE
376
377 .sp
378 .ne 2
379 .na
380 \fBzfs_arc_grow_retry\fR (int)
381 .ad
382 .RS 12n
383 Seconds before growing arc size
384 .sp
385 Default value: \fB5\fR.
386 .RE
387
388 .sp
389 .ne 2
390 .na
391 \fBzfs_arc_max\fR (ulong)
392 .ad
393 .RS 12n
394 Max arc size
395 .sp
396 Default value: \fB0\fR.
397 .RE
398
399 .sp
400 .ne 2
401 .na
402 \fBzfs_arc_memory_throttle_disable\fR (int)
403 .ad
404 .RS 12n
405 Disable memory throttle
406 .sp
407 Use \fB1\fR for yes (default) and \fB0\fR to disable.
408 .RE
409
410 .sp
411 .ne 2
412 .na
413 \fBzfs_arc_meta_limit\fR (ulong)
414 .ad
415 .RS 12n
416 The maximum allowed size in bytes that meta data buffers are allowed to
417 consume in the ARC.  When this limit is reached meta data buffers will
418 be reclaimed even if the overall arc_c_max has not been reached.  This
419 value defaults to 0 which indicates that 3/4 of the ARC may be used
420 for meta data.
421 .sp
422 Default value: \fB0\fR.
423 .RE
424
425 .sp
426 .ne 2
427 .na
428 \fBzfs_arc_meta_min\fR (ulong)
429 .ad
430 .RS 12n
431 The minimum allowed size in bytes that meta data buffers may consume in
432 the ARC.  This value defaults to 0 which disables a floor on the amount
433 of the ARC devoted meta data.
434 .sp
435 Default value: \fB0\fR.
436 .RE
437
438 .sp
439 .ne 2
440 .na
441 \fBzfs_arc_meta_prune\fR (int)
442 .ad
443 .RS 12n
444 The number of dentries and inodes to be scanned looking for entries
445 which can be dropped.  This may be required when the ARC reaches the
446 \fBzfs_arc_meta_limit\fR because dentries and inodes can pin buffers
447 in the ARC.  Increasing this value will cause to dentry and inode caches
448 to be pruned more aggressively.  Setting this value to 0 will disable
449 pruning the inode and dentry caches.
450 .sp
451 Default value: \fB10,000\fR.
452 .RE
453
454 .sp
455 .ne 2
456 .na
457 \fBzfs_arc_meta_adjust_restarts\fR (ulong)
458 .ad
459 .RS 12n
460 The number of restart passes to make while scanning the ARC attempting
461 the free buffers in order to stay below the \fBzfs_arc_meta_limit\fR.
462 This value should not need to be tuned but is available to facilitate
463 performance analysis.
464 .sp
465 Default value: \fB4096\fR.
466 .RE
467
468 .sp
469 .ne 2
470 .na
471 \fBzfs_arc_min\fR (ulong)
472 .ad
473 .RS 12n
474 Min arc size
475 .sp
476 Default value: \fB100\fR.
477 .RE
478
479 .sp
480 .ne 2
481 .na
482 \fBzfs_arc_min_prefetch_lifespan\fR (int)
483 .ad
484 .RS 12n
485 Min life of prefetch block
486 .sp
487 Default value: \fB100\fR.
488 .RE
489
490 .sp
491 .ne 2
492 .na
493 \fBzfs_arc_num_sublists_per_state\fR (int)
494 .ad
495 .RS 12n
496 To allow more fine-grained locking, each ARC state contains a series
497 of lists for both data and meta data objects.  Locking is performed at
498 the level of these "sub-lists".  This parameters controls the number of
499 sub-lists per ARC state.
500 .sp
501 Default value: 1 or the number of on-online CPUs, whichever is greater
502 .RE
503
504 .sp
505 .ne 2
506 .na
507 \fBzfs_arc_overflow_shift\fR (int)
508 .ad
509 .RS 12n
510 The ARC size is considered to be overflowing if it exceeds the current
511 ARC target size (arc_c) by a threshold determined by this parameter.
512 The threshold is calculated as a fraction of arc_c using the formula
513 "arc_c >> \fBzfs_arc_overflow_shift\fR".
514
515 The default value of 8 causes the ARC to be considered to be overflowing
516 if it exceeds the target size by 1/256th (0.3%) of the target size.
517
518 When the ARC is overflowing, new buffer allocations are stalled until
519 the reclaim thread catches up and the overflow condition no longer exists.
520 .sp
521 Default value: \fB8\fR.
522 .RE
523
524 .sp
525 .ne 2
526 .na
527 \fBzfs_arc_p_aggressive_disable\fR (int)
528 .ad
529 .RS 12n
530 Disable aggressive arc_p growth
531 .sp
532 Use \fB1\fR for yes (default) and \fB0\fR to disable.
533 .RE
534
535 .sp
536 .ne 2
537 .na
538 \fBzfs_arc_p_dampener_disable\fR (int)
539 .ad
540 .RS 12n
541 Disable arc_p adapt dampener
542 .sp
543 Use \fB1\fR for yes (default) and \fB0\fR to disable.
544 .RE
545
546 .sp
547 .ne 2
548 .na
549 \fBzfs_arc_shrink_shift\fR (int)
550 .ad
551 .RS 12n
552 log2(fraction of arc to reclaim)
553 .sp
554 Default value: \fB5\fR.
555 .RE
556
557 .sp
558 .ne 2
559 .na
560 \fBzfs_autoimport_disable\fR (int)
561 .ad
562 .RS 12n
563 Disable pool import at module load by ignoring the cache file (typically \fB/etc/zfs/zpool.cache\fR).
564 .sp
565 Use \fB1\fR for yes (default) and \fB0\fR for no.
566 .RE
567
568 .sp
569 .ne 2
570 .na
571 \fBzfs_dbuf_state_index\fR (int)
572 .ad
573 .RS 12n
574 Calculate arc header index
575 .sp
576 Default value: \fB0\fR.
577 .RE
578
579 .sp
580 .ne 2
581 .na
582 \fBzfs_deadman_enabled\fR (int)
583 .ad
584 .RS 12n
585 Enable deadman timer
586 .sp
587 Use \fB1\fR for yes (default) and \fB0\fR to disable.
588 .RE
589
590 .sp
591 .ne 2
592 .na
593 \fBzfs_deadman_synctime_ms\fR (ulong)
594 .ad
595 .RS 12n
596 Expiration time in milliseconds. This value has two meanings. First it is
597 used to determine when the spa_deadman() logic should fire. By default the
598 spa_deadman() will fire if spa_sync() has not completed in 1000 seconds.
599 Secondly, the value determines if an I/O is considered "hung". Any I/O that
600 has not completed in zfs_deadman_synctime_ms is considered "hung" resulting
601 in a zevent being logged.
602 .sp
603 Default value: \fB1,000,000\fR.
604 .RE
605
606 .sp
607 .ne 2
608 .na
609 \fBzfs_dedup_prefetch\fR (int)
610 .ad
611 .RS 12n
612 Enable prefetching dedup-ed blks
613 .sp
614 Use \fB1\fR for yes and \fB0\fR to disable (default).
615 .RE
616
617 .sp
618 .ne 2
619 .na
620 \fBzfs_delay_min_dirty_percent\fR (int)
621 .ad
622 .RS 12n
623 Start to delay each transaction once there is this amount of dirty data,
624 expressed as a percentage of \fBzfs_dirty_data_max\fR.
625 This value should be >= zfs_vdev_async_write_active_max_dirty_percent.
626 See the section "ZFS TRANSACTION DELAY".
627 .sp
628 Default value: \fB60\fR.
629 .RE
630
631 .sp
632 .ne 2
633 .na
634 \fBzfs_delay_scale\fR (int)
635 .ad
636 .RS 12n
637 This controls how quickly the transaction delay approaches infinity.
638 Larger values cause longer delays for a given amount of dirty data.
639 .sp
640 For the smoothest delay, this value should be about 1 billion divided
641 by the maximum number of operations per second.  This will smoothly
642 handle between 10x and 1/10th this number.
643 .sp
644 See the section "ZFS TRANSACTION DELAY".
645 .sp
646 Note: \fBzfs_delay_scale\fR * \fBzfs_dirty_data_max\fR must be < 2^64.
647 .sp
648 Default value: \fB500,000\fR.
649 .RE
650
651 .sp
652 .ne 2
653 .na
654 \fBzfs_dirty_data_max\fR (int)
655 .ad
656 .RS 12n
657 Determines the dirty space limit in bytes.  Once this limit is exceeded, new
658 writes are halted until space frees up. This parameter takes precedence
659 over \fBzfs_dirty_data_max_percent\fR.
660 See the section "ZFS TRANSACTION DELAY".
661 .sp
662 Default value: 10 percent of all memory, capped at \fBzfs_dirty_data_max_max\fR.
663 .RE
664
665 .sp
666 .ne 2
667 .na
668 \fBzfs_dirty_data_max_max\fR (int)
669 .ad
670 .RS 12n
671 Maximum allowable value of \fBzfs_dirty_data_max\fR, expressed in bytes.
672 This limit is only enforced at module load time, and will be ignored if
673 \fBzfs_dirty_data_max\fR is later changed.  This parameter takes
674 precedence over \fBzfs_dirty_data_max_max_percent\fR. See the section
675 "ZFS TRANSACTION DELAY".
676 .sp
677 Default value: 25% of physical RAM.
678 .RE
679
680 .sp
681 .ne 2
682 .na
683 \fBzfs_dirty_data_max_max_percent\fR (int)
684 .ad
685 .RS 12n
686 Maximum allowable value of \fBzfs_dirty_data_max\fR, expressed as a
687 percentage of physical RAM.  This limit is only enforced at module load
688 time, and will be ignored if \fBzfs_dirty_data_max\fR is later changed.
689 The parameter \fBzfs_dirty_data_max_max\fR takes precedence over this
690 one. See the section "ZFS TRANSACTION DELAY".
691 .sp
692 Default value: 25
693 .RE
694
695 .sp
696 .ne 2
697 .na
698 \fBzfs_dirty_data_max_percent\fR (int)
699 .ad
700 .RS 12n
701 Determines the dirty space limit, expressed as a percentage of all
702 memory.  Once this limit is exceeded, new writes are halted until space frees
703 up.  The parameter \fBzfs_dirty_data_max\fR takes precedence over this
704 one.  See the section "ZFS TRANSACTION DELAY".
705 .sp
706 Default value: 10%, subject to \fBzfs_dirty_data_max_max\fR.
707 .RE
708
709 .sp
710 .ne 2
711 .na
712 \fBzfs_dirty_data_sync\fR (int)
713 .ad
714 .RS 12n
715 Start syncing out a transaction group if there is at least this much dirty data.
716 .sp
717 Default value: \fB67,108,864\fR.
718 .RE
719
720 .sp
721 .ne 2
722 .na
723 \fBzfs_free_max_blocks\fR (ulong)
724 .ad
725 .RS 12n
726 Maximum number of blocks freed in a single txg.
727 .sp
728 Default value: \fB100,000\fR.
729 .RE
730
731 .sp
732 .ne 2
733 .na
734 \fBzfs_vdev_async_read_max_active\fR (int)
735 .ad
736 .RS 12n
737 Maxium asynchronous read I/Os active to each device.
738 See the section "ZFS I/O SCHEDULER".
739 .sp
740 Default value: \fB3\fR.
741 .RE
742
743 .sp
744 .ne 2
745 .na
746 \fBzfs_vdev_async_read_min_active\fR (int)
747 .ad
748 .RS 12n
749 Minimum asynchronous read I/Os active to each device.
750 See the section "ZFS I/O SCHEDULER".
751 .sp
752 Default value: \fB1\fR.
753 .RE
754
755 .sp
756 .ne 2
757 .na
758 \fBzfs_vdev_async_write_active_max_dirty_percent\fR (int)
759 .ad
760 .RS 12n
761 When the pool has more than
762 \fBzfs_vdev_async_write_active_max_dirty_percent\fR dirty data, use
763 \fBzfs_vdev_async_write_max_active\fR to limit active async writes.  If
764 the dirty data is between min and max, the active I/O limit is linearly
765 interpolated. See the section "ZFS I/O SCHEDULER".
766 .sp
767 Default value: \fB60\fR.
768 .RE
769
770 .sp
771 .ne 2
772 .na
773 \fBzfs_vdev_async_write_active_min_dirty_percent\fR (int)
774 .ad
775 .RS 12n
776 When the pool has less than
777 \fBzfs_vdev_async_write_active_min_dirty_percent\fR dirty data, use
778 \fBzfs_vdev_async_write_min_active\fR to limit active async writes.  If
779 the dirty data is between min and max, the active I/O limit is linearly
780 interpolated. See the section "ZFS I/O SCHEDULER".
781 .sp
782 Default value: \fB30\fR.
783 .RE
784
785 .sp
786 .ne 2
787 .na
788 \fBzfs_vdev_async_write_max_active\fR (int)
789 .ad
790 .RS 12n
791 Maxium asynchronous write I/Os active to each device.
792 See the section "ZFS I/O SCHEDULER".
793 .sp
794 Default value: \fB10\fR.
795 .RE
796
797 .sp
798 .ne 2
799 .na
800 \fBzfs_vdev_async_write_min_active\fR (int)
801 .ad
802 .RS 12n
803 Minimum asynchronous write I/Os active to each device.
804 See the section "ZFS I/O SCHEDULER".
805 .sp
806 Default value: \fB1\fR.
807 .RE
808
809 .sp
810 .ne 2
811 .na
812 \fBzfs_vdev_max_active\fR (int)
813 .ad
814 .RS 12n
815 The maximum number of I/Os active to each device.  Ideally, this will be >=
816 the sum of each queue's max_active.  It must be at least the sum of each
817 queue's min_active.  See the section "ZFS I/O SCHEDULER".
818 .sp
819 Default value: \fB1,000\fR.
820 .RE
821
822 .sp
823 .ne 2
824 .na
825 \fBzfs_vdev_scrub_max_active\fR (int)
826 .ad
827 .RS 12n
828 Maxium scrub I/Os active to each device.
829 See the section "ZFS I/O SCHEDULER".
830 .sp
831 Default value: \fB2\fR.
832 .RE
833
834 .sp
835 .ne 2
836 .na
837 \fBzfs_vdev_scrub_min_active\fR (int)
838 .ad
839 .RS 12n
840 Minimum scrub I/Os active to each device.
841 See the section "ZFS I/O SCHEDULER".
842 .sp
843 Default value: \fB1\fR.
844 .RE
845
846 .sp
847 .ne 2
848 .na
849 \fBzfs_vdev_sync_read_max_active\fR (int)
850 .ad
851 .RS 12n
852 Maxium synchronous read I/Os active to each device.
853 See the section "ZFS I/O SCHEDULER".
854 .sp
855 Default value: \fB10\fR.
856 .RE
857
858 .sp
859 .ne 2
860 .na
861 \fBzfs_vdev_sync_read_min_active\fR (int)
862 .ad
863 .RS 12n
864 Minimum synchronous read I/Os active to each device.
865 See the section "ZFS I/O SCHEDULER".
866 .sp
867 Default value: \fB10\fR.
868 .RE
869
870 .sp
871 .ne 2
872 .na
873 \fBzfs_vdev_sync_write_max_active\fR (int)
874 .ad
875 .RS 12n
876 Maxium synchronous write I/Os active to each device.
877 See the section "ZFS I/O SCHEDULER".
878 .sp
879 Default value: \fB10\fR.
880 .RE
881
882 .sp
883 .ne 2
884 .na
885 \fBzfs_vdev_sync_write_min_active\fR (int)
886 .ad
887 .RS 12n
888 Minimum synchronous write I/Os active to each device.
889 See the section "ZFS I/O SCHEDULER".
890 .sp
891 Default value: \fB10\fR.
892 .RE
893
894 .sp
895 .ne 2
896 .na
897 \fBzfs_disable_dup_eviction\fR (int)
898 .ad
899 .RS 12n
900 Disable duplicate buffer eviction
901 .sp
902 Use \fB1\fR for yes and \fB0\fR for no (default).
903 .RE
904
905 .sp
906 .ne 2
907 .na
908 \fBzfs_expire_snapshot\fR (int)
909 .ad
910 .RS 12n
911 Seconds to expire .zfs/snapshot
912 .sp
913 Default value: \fB300\fR.
914 .RE
915
916 .sp
917 .ne 2
918 .na
919 \fBzfs_flags\fR (int)
920 .ad
921 .RS 12n
922 Set additional debugging flags. The following flags may be bitwise-or'd
923 together.
924 .sp
925 .TS
926 box;
927 rB lB
928 lB lB
929 r l.
930 Value   Symbolic Name
931         Description
932 _
933 1       ZFS_DEBUG_DPRINTF
934         Enable dprintf entries in the debug log.
935 _
936 2       ZFS_DEBUG_DBUF_VERIFY *
937         Enable extra dbuf verifications.
938 _
939 4       ZFS_DEBUG_DNODE_VERIFY *
940         Enable extra dnode verifications.
941 _
942 8       ZFS_DEBUG_SNAPNAMES
943         Enable snapshot name verification.
944 _
945 16      ZFS_DEBUG_MODIFY
946         Check for illegally modified ARC buffers.
947 _
948 32      ZFS_DEBUG_SPA
949         Enable spa_dbgmsg entries in the debug log.
950 _
951 64      ZFS_DEBUG_ZIO_FREE
952         Enable verification of block frees.
953 _
954 128     ZFS_DEBUG_HISTOGRAM_VERIFY
955         Enable extra spacemap histogram verifications.
956 .TE
957 .sp
958 * Requires debug build.
959 .sp
960 Default value: \fB0\fR.
961 .RE
962
963 .sp
964 .ne 2
965 .na
966 \fBzfs_free_leak_on_eio\fR (int)
967 .ad
968 .RS 12n
969 If destroy encounters an EIO while reading metadata (e.g. indirect
970 blocks), space referenced by the missing metadata can not be freed.
971 Normally this causes the background destroy to become "stalled", as
972 it is unable to make forward progress.  While in this stalled state,
973 all remaining space to free from the error-encountering filesystem is
974 "temporarily leaked".  Set this flag to cause it to ignore the EIO,
975 permanently leak the space from indirect blocks that can not be read,
976 and continue to free everything else that it can.
977
978 The default, "stalling" behavior is useful if the storage partially
979 fails (i.e. some but not all i/os fail), and then later recovers.  In
980 this case, we will be able to continue pool operations while it is
981 partially failed, and when it recovers, we can continue to free the
982 space, with no leaks.  However, note that this case is actually
983 fairly rare.
984
985 Typically pools either (a) fail completely (but perhaps temporarily,
986 e.g. a top-level vdev going offline), or (b) have localized,
987 permanent errors (e.g. disk returns the wrong data due to bit flip or
988 firmware bug).  In case (a), this setting does not matter because the
989 pool will be suspended and the sync thread will not be able to make
990 forward progress regardless.  In case (b), because the error is
991 permanent, the best we can do is leak the minimum amount of space,
992 which is what setting this flag will do.  Therefore, it is reasonable
993 for this flag to normally be set, but we chose the more conservative
994 approach of not setting it, so that there is no possibility of
995 leaking space in the "partial temporary" failure case.
996 .sp
997 Default value: \fB0\fR.
998 .RE
999
1000 .sp
1001 .ne 2
1002 .na
1003 \fBzfs_free_min_time_ms\fR (int)
1004 .ad
1005 .RS 12n
1006 Min millisecs to free per txg
1007 .sp
1008 Default value: \fB1,000\fR.
1009 .RE
1010
1011 .sp
1012 .ne 2
1013 .na
1014 \fBzfs_immediate_write_sz\fR (long)
1015 .ad
1016 .RS 12n
1017 Largest data block to write to zil
1018 .sp
1019 Default value: \fB32,768\fR.
1020 .RE
1021
1022 .sp
1023 .ne 2
1024 .na
1025 \fBzfs_max_recordsize\fR (int)
1026 .ad
1027 .RS 12n
1028 We currently support block sizes from 512 bytes to 16MB.  The benefits of
1029 larger blocks, and thus larger IO, need to be weighed against the cost of
1030 COWing a giant block to modify one byte.  Additionally, very large blocks
1031 can have an impact on i/o latency, and also potentially on the memory
1032 allocator.  Therefore, we do not allow the recordsize to be set larger than
1033 zfs_max_recordsize (default 1MB).  Larger blocks can be created by changing
1034 this tunable, and pools with larger blocks can always be imported and used,
1035 regardless of this setting.
1036 .sp
1037 Default value: \fB1,048,576\fR.
1038 .RE
1039
1040 .sp
1041 .ne 2
1042 .na
1043 \fBzfs_mdcomp_disable\fR (int)
1044 .ad
1045 .RS 12n
1046 Disable meta data compression
1047 .sp
1048 Use \fB1\fR for yes and \fB0\fR for no (default).
1049 .RE
1050
1051 .sp
1052 .ne 2
1053 .na
1054 \fBzfs_metaslab_fragmentation_threshold\fR (int)
1055 .ad
1056 .RS 12n
1057 Allow metaslabs to keep their active state as long as their fragmentation
1058 percentage is less than or equal to this value. An active metaslab that
1059 exceeds this threshold will no longer keep its active status allowing
1060 better metaslabs to be selected.
1061 .sp
1062 Default value: \fB70\fR.
1063 .RE
1064
1065 .sp
1066 .ne 2
1067 .na
1068 \fBzfs_mg_fragmentation_threshold\fR (int)
1069 .ad
1070 .RS 12n
1071 Metaslab groups are considered eligible for allocations if their
1072 fragmenation metric (measured as a percentage) is less than or equal to
1073 this value. If a metaslab group exceeds this threshold then it will be
1074 skipped unless all metaslab groups within the metaslab class have also
1075 crossed this threshold.
1076 .sp
1077 Default value: \fB85\fR.
1078 .RE
1079
1080 .sp
1081 .ne 2
1082 .na
1083 \fBzfs_mg_noalloc_threshold\fR (int)
1084 .ad
1085 .RS 12n
1086 Defines a threshold at which metaslab groups should be eligible for
1087 allocations.  The value is expressed as a percentage of free space
1088 beyond which a metaslab group is always eligible for allocations.
1089 If a metaslab group's free space is less than or equal to the
1090 the threshold, the allocator will avoid allocating to that group
1091 unless all groups in the pool have reached the threshold.  Once all
1092 groups have reached the threshold, all groups are allowed to accept
1093 allocations.  The default value of 0 disables the feature and causes
1094 all metaslab groups to be eligible for allocations.
1095
1096 This parameter allows to deal with pools having heavily imbalanced
1097 vdevs such as would be the case when a new vdev has been added.
1098 Setting the threshold to a non-zero percentage will stop allocations
1099 from being made to vdevs that aren't filled to the specified percentage
1100 and allow lesser filled vdevs to acquire more allocations than they
1101 otherwise would under the old \fBzfs_mg_alloc_failures\fR facility.
1102 .sp
1103 Default value: \fB0\fR.
1104 .RE
1105
1106 .sp
1107 .ne 2
1108 .na
1109 \fBzfs_no_scrub_io\fR (int)
1110 .ad
1111 .RS 12n
1112 Set for no scrub I/O
1113 .sp
1114 Use \fB1\fR for yes and \fB0\fR for no (default).
1115 .RE
1116
1117 .sp
1118 .ne 2
1119 .na
1120 \fBzfs_no_scrub_prefetch\fR (int)
1121 .ad
1122 .RS 12n
1123 Set for no scrub prefetching
1124 .sp
1125 Use \fB1\fR for yes and \fB0\fR for no (default).
1126 .RE
1127
1128 .sp
1129 .ne 2
1130 .na
1131 \fBzfs_nocacheflush\fR (int)
1132 .ad
1133 .RS 12n
1134 Disable cache flushes
1135 .sp
1136 Use \fB1\fR for yes and \fB0\fR for no (default).
1137 .RE
1138
1139 .sp
1140 .ne 2
1141 .na
1142 \fBzfs_nopwrite_enabled\fR (int)
1143 .ad
1144 .RS 12n
1145 Enable NOP writes
1146 .sp
1147 Use \fB1\fR for yes (default) and \fB0\fR to disable.
1148 .RE
1149
1150 .sp
1151 .ne 2
1152 .na
1153 \fBzfs_pd_bytes_max\fR (int)
1154 .ad
1155 .RS 12n
1156 The number of bytes which should be prefetched.
1157 .sp
1158 Default value: \fB52,428,800\fR.
1159 .RE
1160
1161 .sp
1162 .ne 2
1163 .na
1164 \fBzfs_prefetch_disable\fR (int)
1165 .ad
1166 .RS 12n
1167 Disable all ZFS prefetching
1168 .sp
1169 Use \fB1\fR for yes and \fB0\fR for no (default).
1170 .RE
1171
1172 .sp
1173 .ne 2
1174 .na
1175 \fBzfs_read_chunk_size\fR (long)
1176 .ad
1177 .RS 12n
1178 Bytes to read per chunk
1179 .sp
1180 Default value: \fB1,048,576\fR.
1181 .RE
1182
1183 .sp
1184 .ne 2
1185 .na
1186 \fBzfs_read_history\fR (int)
1187 .ad
1188 .RS 12n
1189 Historic statistics for the last N reads
1190 .sp
1191 Default value: \fB0\fR.
1192 .RE
1193
1194 .sp
1195 .ne 2
1196 .na
1197 \fBzfs_read_history_hits\fR (int)
1198 .ad
1199 .RS 12n
1200 Include cache hits in read history
1201 .sp
1202 Use \fB1\fR for yes and \fB0\fR for no (default).
1203 .RE
1204
1205 .sp
1206 .ne 2
1207 .na
1208 \fBzfs_recover\fR (int)
1209 .ad
1210 .RS 12n
1211 Set to attempt to recover from fatal errors. This should only be used as a
1212 last resort, as it typically results in leaked space, or worse.
1213 .sp
1214 Use \fB1\fR for yes and \fB0\fR for no (default).
1215 .RE
1216
1217 .sp
1218 .ne 2
1219 .na
1220 \fBzfs_resilver_delay\fR (int)
1221 .ad
1222 .RS 12n
1223 Number of ticks to delay prior to issuing a resilver I/O operation when
1224 a non-resilver or non-scrub I/O operation has occurred within the past
1225 \fBzfs_scan_idle\fR ticks.
1226 .sp
1227 Default value: \fB2\fR.
1228 .RE
1229
1230 .sp
1231 .ne 2
1232 .na
1233 \fBzfs_resilver_min_time_ms\fR (int)
1234 .ad
1235 .RS 12n
1236 Min millisecs to resilver per txg
1237 .sp
1238 Default value: \fB3,000\fR.
1239 .RE
1240
1241 .sp
1242 .ne 2
1243 .na
1244 \fBzfs_scan_idle\fR (int)
1245 .ad
1246 .RS 12n
1247 Idle window in clock ticks.  During a scrub or a resilver, if
1248 a non-scrub or non-resilver I/O operation has occurred during this
1249 window, the next scrub or resilver operation is delayed by, respectively
1250 \fBzfs_scrub_delay\fR or \fBzfs_resilver_delay\fR ticks.
1251 .sp
1252 Default value: \fB50\fR.
1253 .RE
1254
1255 .sp
1256 .ne 2
1257 .na
1258 \fBzfs_scan_min_time_ms\fR (int)
1259 .ad
1260 .RS 12n
1261 Min millisecs to scrub per txg
1262 .sp
1263 Default value: \fB1,000\fR.
1264 .RE
1265
1266 .sp
1267 .ne 2
1268 .na
1269 \fBzfs_scrub_delay\fR (int)
1270 .ad
1271 .RS 12n
1272 Number of ticks to delay prior to issuing a scrub I/O operation when
1273 a non-scrub or non-resilver I/O operation has occurred within the past
1274 \fBzfs_scan_idle\fR ticks.
1275 .sp
1276 Default value: \fB4\fR.
1277 .RE
1278
1279 .sp
1280 .ne 2
1281 .na
1282 \fBzfs_send_corrupt_data\fR (int)
1283 .ad
1284 .RS 12n
1285 Allow to send corrupt data (ignore read/checksum errors when sending data)
1286 .sp
1287 Use \fB1\fR for yes and \fB0\fR for no (default).
1288 .RE
1289
1290 .sp
1291 .ne 2
1292 .na
1293 \fBzfs_sync_pass_deferred_free\fR (int)
1294 .ad
1295 .RS 12n
1296 Defer frees starting in this pass
1297 .sp
1298 Default value: \fB2\fR.
1299 .RE
1300
1301 .sp
1302 .ne 2
1303 .na
1304 \fBzfs_sync_pass_dont_compress\fR (int)
1305 .ad
1306 .RS 12n
1307 Don't compress starting in this pass
1308 .sp
1309 Default value: \fB5\fR.
1310 .RE
1311
1312 .sp
1313 .ne 2
1314 .na
1315 \fBzfs_sync_pass_rewrite\fR (int)
1316 .ad
1317 .RS 12n
1318 Rewrite new bps starting in this pass
1319 .sp
1320 Default value: \fB2\fR.
1321 .RE
1322
1323 .sp
1324 .ne 2
1325 .na
1326 \fBzfs_top_maxinflight\fR (int)
1327 .ad
1328 .RS 12n
1329 Max I/Os per top-level vdev during scrub or resilver operations.
1330 .sp
1331 Default value: \fB32\fR.
1332 .RE
1333
1334 .sp
1335 .ne 2
1336 .na
1337 \fBzfs_txg_history\fR (int)
1338 .ad
1339 .RS 12n
1340 Historic statistics for the last N txgs
1341 .sp
1342 Default value: \fB0\fR.
1343 .RE
1344
1345 .sp
1346 .ne 2
1347 .na
1348 \fBzfs_txg_timeout\fR (int)
1349 .ad
1350 .RS 12n
1351 Max seconds worth of delta per txg
1352 .sp
1353 Default value: \fB5\fR.
1354 .RE
1355
1356 .sp
1357 .ne 2
1358 .na
1359 \fBzfs_vdev_aggregation_limit\fR (int)
1360 .ad
1361 .RS 12n
1362 Max vdev I/O aggregation size
1363 .sp
1364 Default value: \fB131,072\fR.
1365 .RE
1366
1367 .sp
1368 .ne 2
1369 .na
1370 \fBzfs_vdev_cache_bshift\fR (int)
1371 .ad
1372 .RS 12n
1373 Shift size to inflate reads too
1374 .sp
1375 Default value: \fB16\fR.
1376 .RE
1377
1378 .sp
1379 .ne 2
1380 .na
1381 \fBzfs_vdev_cache_max\fR (int)
1382 .ad
1383 .RS 12n
1384 Inflate reads small than max
1385 .RE
1386
1387 .sp
1388 .ne 2
1389 .na
1390 \fBzfs_vdev_cache_size\fR (int)
1391 .ad
1392 .RS 12n
1393 Total size of the per-disk cache
1394 .sp
1395 Default value: \fB0\fR.
1396 .RE
1397
1398 .sp
1399 .ne 2
1400 .na
1401 \fBzfs_vdev_mirror_switch_us\fR (int)
1402 .ad
1403 .RS 12n
1404 Switch mirrors every N usecs
1405 .sp
1406 Default value: \fB10,000\fR.
1407 .RE
1408
1409 .sp
1410 .ne 2
1411 .na
1412 \fBzfs_vdev_read_gap_limit\fR (int)
1413 .ad
1414 .RS 12n
1415 Aggregate read I/O over gap
1416 .sp
1417 Default value: \fB32,768\fR.
1418 .RE
1419
1420 .sp
1421 .ne 2
1422 .na
1423 \fBzfs_vdev_scheduler\fR (charp)
1424 .ad
1425 .RS 12n
1426 I/O scheduler
1427 .sp
1428 Default value: \fBnoop\fR.
1429 .RE
1430
1431 .sp
1432 .ne 2
1433 .na
1434 \fBzfs_vdev_write_gap_limit\fR (int)
1435 .ad
1436 .RS 12n
1437 Aggregate write I/O over gap
1438 .sp
1439 Default value: \fB4,096\fR.
1440 .RE
1441
1442 .sp
1443 .ne 2
1444 .na
1445 \fBzfs_zevent_cols\fR (int)
1446 .ad
1447 .RS 12n
1448 Max event column width
1449 .sp
1450 Default value: \fB80\fR.
1451 .RE
1452
1453 .sp
1454 .ne 2
1455 .na
1456 \fBzfs_zevent_console\fR (int)
1457 .ad
1458 .RS 12n
1459 Log events to the console
1460 .sp
1461 Use \fB1\fR for yes and \fB0\fR for no (default).
1462 .RE
1463
1464 .sp
1465 .ne 2
1466 .na
1467 \fBzfs_zevent_len_max\fR (int)
1468 .ad
1469 .RS 12n
1470 Max event queue length
1471 .sp
1472 Default value: \fB0\fR.
1473 .RE
1474
1475 .sp
1476 .ne 2
1477 .na
1478 \fBzil_replay_disable\fR (int)
1479 .ad
1480 .RS 12n
1481 Disable intent logging replay
1482 .sp
1483 Use \fB1\fR for yes and \fB0\fR for no (default).
1484 .RE
1485
1486 .sp
1487 .ne 2
1488 .na
1489 \fBzil_slog_limit\fR (ulong)
1490 .ad
1491 .RS 12n
1492 Max commit bytes to separate log device
1493 .sp
1494 Default value: \fB1,048,576\fR.
1495 .RE
1496
1497 .sp
1498 .ne 2
1499 .na
1500 \fBzio_delay_max\fR (int)
1501 .ad
1502 .RS 12n
1503 Max zio millisec delay before posting event
1504 .sp
1505 Default value: \fB30,000\fR.
1506 .RE
1507
1508 .sp
1509 .ne 2
1510 .na
1511 \fBzio_requeue_io_start_cut_in_line\fR (int)
1512 .ad
1513 .RS 12n
1514 Prioritize requeued I/O
1515 .sp
1516 Default value: \fB0\fR.
1517 .RE
1518
1519 .sp
1520 .ne 2
1521 .na
1522 \fBzvol_inhibit_dev\fR (uint)
1523 .ad
1524 .RS 12n
1525 Do not create zvol device nodes
1526 .sp
1527 Use \fB1\fR for yes and \fB0\fR for no (default).
1528 .RE
1529
1530 .sp
1531 .ne 2
1532 .na
1533 \fBzvol_major\fR (uint)
1534 .ad
1535 .RS 12n
1536 Major number for zvol device
1537 .sp
1538 Default value: \fB230\fR.
1539 .RE
1540
1541 .sp
1542 .ne 2
1543 .na
1544 \fBzvol_max_discard_blocks\fR (ulong)
1545 .ad
1546 .RS 12n
1547 Max number of blocks to discard at once
1548 .sp
1549 Default value: \fB16,384\fR.
1550 .RE
1551
1552 .sp
1553 .ne 2
1554 .na
1555 \fBzvol_threads\fR (uint)
1556 .ad
1557 .RS 12n
1558 Number of threads for zvol device
1559 .sp
1560 Default value: \fB32\fR.
1561 .RE
1562
1563 .SH ZFS I/O SCHEDULER
1564 ZFS issues I/O operations to leaf vdevs to satisfy and complete I/Os.
1565 The I/O scheduler determines when and in what order those operations are
1566 issued.  The I/O scheduler divides operations into five I/O classes
1567 prioritized in the following order: sync read, sync write, async read,
1568 async write, and scrub/resilver.  Each queue defines the minimum and
1569 maximum number of concurrent operations that may be issued to the
1570 device.  In addition, the device has an aggregate maximum,
1571 \fBzfs_vdev_max_active\fR. Note that the sum of the per-queue minimums
1572 must not exceed the aggregate maximum.  If the sum of the per-queue
1573 maximums exceeds the aggregate maximum, then the number of active I/Os
1574 may reach \fBzfs_vdev_max_active\fR, in which case no further I/Os will
1575 be issued regardless of whether all per-queue minimums have been met.
1576 .sp
1577 For many physical devices, throughput increases with the number of
1578 concurrent operations, but latency typically suffers. Further, physical
1579 devices typically have a limit at which more concurrent operations have no
1580 effect on throughput or can actually cause it to decrease.
1581 .sp
1582 The scheduler selects the next operation to issue by first looking for an
1583 I/O class whose minimum has not been satisfied. Once all are satisfied and
1584 the aggregate maximum has not been hit, the scheduler looks for classes
1585 whose maximum has not been satisfied. Iteration through the I/O classes is
1586 done in the order specified above. No further operations are issued if the
1587 aggregate maximum number of concurrent operations has been hit or if there
1588 are no operations queued for an I/O class that has not hit its maximum.
1589 Every time an I/O is queued or an operation completes, the I/O scheduler
1590 looks for new operations to issue.
1591 .sp
1592 In general, smaller max_active's will lead to lower latency of synchronous
1593 operations.  Larger max_active's may lead to higher overall throughput,
1594 depending on underlying storage.
1595 .sp
1596 The ratio of the queues' max_actives determines the balance of performance
1597 between reads, writes, and scrubs.  E.g., increasing
1598 \fBzfs_vdev_scrub_max_active\fR will cause the scrub or resilver to complete
1599 more quickly, but reads and writes to have higher latency and lower throughput.
1600 .sp
1601 All I/O classes have a fixed maximum number of outstanding operations
1602 except for the async write class. Asynchronous writes represent the data
1603 that is committed to stable storage during the syncing stage for
1604 transaction groups. Transaction groups enter the syncing state
1605 periodically so the number of queued async writes will quickly burst up
1606 and then bleed down to zero. Rather than servicing them as quickly as
1607 possible, the I/O scheduler changes the maximum number of active async
1608 write I/Os according to the amount of dirty data in the pool.  Since
1609 both throughput and latency typically increase with the number of
1610 concurrent operations issued to physical devices, reducing the
1611 burstiness in the number of concurrent operations also stabilizes the
1612 response time of operations from other -- and in particular synchronous
1613 -- queues. In broad strokes, the I/O scheduler will issue more
1614 concurrent operations from the async write queue as there's more dirty
1615 data in the pool.
1616 .sp
1617 Async Writes
1618 .sp
1619 The number of concurrent operations issued for the async write I/O class
1620 follows a piece-wise linear function defined by a few adjustable points.
1621 .nf
1622
1623        |              o---------| <-- zfs_vdev_async_write_max_active
1624   ^    |             /^         |
1625   |    |            / |         |
1626 active |           /  |         |
1627  I/O   |          /   |         |
1628 count  |         /    |         |
1629        |        /     |         |
1630        |-------o      |         | <-- zfs_vdev_async_write_min_active
1631       0|_______^______|_________|
1632        0%      |      |       100% of zfs_dirty_data_max
1633                |      |
1634                |      `-- zfs_vdev_async_write_active_max_dirty_percent
1635                `--------- zfs_vdev_async_write_active_min_dirty_percent
1636
1637 .fi
1638 Until the amount of dirty data exceeds a minimum percentage of the dirty
1639 data allowed in the pool, the I/O scheduler will limit the number of
1640 concurrent operations to the minimum. As that threshold is crossed, the
1641 number of concurrent operations issued increases linearly to the maximum at
1642 the specified maximum percentage of the dirty data allowed in the pool.
1643 .sp
1644 Ideally, the amount of dirty data on a busy pool will stay in the sloped
1645 part of the function between \fBzfs_vdev_async_write_active_min_dirty_percent\fR
1646 and \fBzfs_vdev_async_write_active_max_dirty_percent\fR. If it exceeds the
1647 maximum percentage, this indicates that the rate of incoming data is
1648 greater than the rate that the backend storage can handle. In this case, we
1649 must further throttle incoming writes, as described in the next section.
1650
1651 .SH ZFS TRANSACTION DELAY
1652 We delay transactions when we've determined that the backend storage
1653 isn't able to accommodate the rate of incoming writes.
1654 .sp
1655 If there is already a transaction waiting, we delay relative to when
1656 that transaction will finish waiting.  This way the calculated delay time
1657 is independent of the number of threads concurrently executing
1658 transactions.
1659 .sp
1660 If we are the only waiter, wait relative to when the transaction
1661 started, rather than the current time.  This credits the transaction for
1662 "time already served", e.g. reading indirect blocks.
1663 .sp
1664 The minimum time for a transaction to take is calculated as:
1665 .nf
1666     min_time = zfs_delay_scale * (dirty - min) / (max - dirty)
1667     min_time is then capped at 100 milliseconds.
1668 .fi
1669 .sp
1670 The delay has two degrees of freedom that can be adjusted via tunables.  The
1671 percentage of dirty data at which we start to delay is defined by
1672 \fBzfs_delay_min_dirty_percent\fR. This should typically be at or above
1673 \fBzfs_vdev_async_write_active_max_dirty_percent\fR so that we only start to
1674 delay after writing at full speed has failed to keep up with the incoming write
1675 rate. The scale of the curve is defined by \fBzfs_delay_scale\fR. Roughly speaking,
1676 this variable determines the amount of delay at the midpoint of the curve.
1677 .sp
1678 .nf
1679 delay
1680  10ms +-------------------------------------------------------------*+
1681       |                                                             *|
1682   9ms +                                                             *+
1683       |                                                             *|
1684   8ms +                                                             *+
1685       |                                                            * |
1686   7ms +                                                            * +
1687       |                                                            * |
1688   6ms +                                                            * +
1689       |                                                            * |
1690   5ms +                                                           *  +
1691       |                                                           *  |
1692   4ms +                                                           *  +
1693       |                                                           *  |
1694   3ms +                                                          *   +
1695       |                                                          *   |
1696   2ms +                                              (midpoint) *    +
1697       |                                                  |    **     |
1698   1ms +                                                  v ***       +
1699       |             zfs_delay_scale ---------->     ********         |
1700     0 +-------------------------------------*********----------------+
1701       0%                    <- zfs_dirty_data_max ->               100%
1702 .fi
1703 .sp
1704 Note that since the delay is added to the outstanding time remaining on the
1705 most recent transaction, the delay is effectively the inverse of IOPS.
1706 Here the midpoint of 500us translates to 2000 IOPS. The shape of the curve
1707 was chosen such that small changes in the amount of accumulated dirty data
1708 in the first 3/4 of the curve yield relatively small differences in the
1709 amount of delay.
1710 .sp
1711 The effects can be easier to understand when the amount of delay is
1712 represented on a log scale:
1713 .sp
1714 .nf
1715 delay
1716 100ms +-------------------------------------------------------------++
1717       +                                                              +
1718       |                                                              |
1719       +                                                             *+
1720  10ms +                                                             *+
1721       +                                                           ** +
1722       |                                              (midpoint)  **  |
1723       +                                                  |     **    +
1724   1ms +                                                  v ****      +
1725       +             zfs_delay_scale ---------->        *****         +
1726       |                                             ****             |
1727       +                                          ****                +
1728 100us +                                        **                    +
1729       +                                       *                      +
1730       |                                      *                       |
1731       +                                     *                        +
1732  10us +                                     *                        +
1733       +                                                              +
1734       |                                                              |
1735       +                                                              +
1736       +--------------------------------------------------------------+
1737       0%                    <- zfs_dirty_data_max ->               100%
1738 .fi
1739 .sp
1740 Note here that only as the amount of dirty data approaches its limit does
1741 the delay start to increase rapidly. The goal of a properly tuned system
1742 should be to keep the amount of dirty data out of that range by first
1743 ensuring that the appropriate limits are set for the I/O scheduler to reach
1744 optimal throughput on the backend storage, and then by changing the value
1745 of \fBzfs_delay_scale\fR to increase the steepness of the curve.