diff options
author | Matthew Ahrens <[email protected]> | 2020-03-16 11:51:56 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-16 11:51:56 -0700 |
commit | 7261fc2e8136f99b89851fa853f7862db45437c3 (patch) | |
tree | 3f0cc43fa090ad8ca1fbdadb1306f0d80ed2c2b8 /man | |
parent | c94fb10917c404ecdba53a46dd7d497cdeadbc30 (diff) |
Improve zfs receive performance by batching writes
For each WRITE record in the stream, `zfs receive` creates a DMU
transaction (`dmu_tx_create()`) and writes this block's data into the
object. If per-block overheads (as opposed to per-byte overheads)
dominate performance (as is often the case with small recordsize), the
per-dmu-transaction overheads can be significant. For example, in some
workloads the `receieve_writer` thread is 100% on CPU, and more than
half of its CPU time is in these per-tx routines (e.g.
dmu_tx_hold_write, dmu_tx_assign, dmu_tx_commit).
To improve performance of `zfs receive`, this commit batches WRITE
records which are to nearby offsets of the same object, and uses one DMU
transaction to write them all. By default the batch size is 1MB, which
for recordsize=8K reduces the number of DMU transactions by 128x for
full send streams (incrementals will depend on how "clumpy" the changed
blocks are).
This commit improves the performance of `dd if=stream | zfs recv`
from 78,800 blocks/sec to 98,100 blocks/sec (25% improvement).
Reviewed-by: Paul Dagnelie <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Matthew Ahrens <[email protected]>
Closes #10099
Diffstat (limited to 'man')
-rw-r--r-- | man/man5/zfs-module-parameters.5 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/man/man5/zfs-module-parameters.5 b/man/man5/zfs-module-parameters.5 index 311d898ff..3c61ac1a9 100644 --- a/man/man5/zfs-module-parameters.5 +++ b/man/man5/zfs-module-parameters.5 @@ -2998,6 +2998,20 @@ Default value: \fB16,777,216\fR. .sp .ne 2 .na +\fBzfs_recv_write_batch_size\fR (int) +.ad +.RS 12n +The maximum amount of data (in bytes) that \fBzfs receive\fR will write in +one DMU transaction. This is the uncompressed size, even when receiving a +compressed send stream. This setting will not reduce the write size below +a single block. Capped at a maximum of 32MB +.sp +Default value: \fB1MB\fR. +.RE + +.sp +.ne 2 +.na \fBzfs_override_estimate_recordsize\fR (ulong) .ad .RS 12n |