From 8b7d29d5a030d8620ceefc7822b5226d9729c71a Mon Sep 17 00:00:00 2001 From: 0xFelix Date: Sat, 20 Apr 2024 18:41:43 +0200 Subject: [PATCH] syncoid: Add zstdmt compress options Add the zstdmt-fast and zstdmt-slow compress options to allow use of multithreading when using zstd compression. Signed-off-by: 0xFelix --- syncoid | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/syncoid b/syncoid index b57aa43d..9f9eb890 100755 --- a/syncoid +++ b/syncoid @@ -1114,12 +1114,24 @@ sub compressargset { decomrawcmd => 'zstd', decomargs => '-dc', }, + 'zstdmt-fast' => { + rawcmd => 'zstdmt', + args => '-3', + decomrawcmd => 'zstdmt', + decomargs => '-dc', + }, 'zstd-slow' => { rawcmd => 'zstd', args => '-19', decomrawcmd => 'zstd', decomargs => '-dc', }, + 'zstdmt-slow' => { + rawcmd => 'zstdmt', + args => '-19', + decomrawcmd => 'zstdmt', + decomargs => '-dc', + }, 'xz' => { rawcmd => 'xz', args => '', @@ -1142,7 +1154,7 @@ sub compressargset { if ($value eq 'default') { $value = $DEFAULT_COMPRESSION; - } elsif (!(grep $value eq $_, ('gzip', 'pigz-fast', 'pigz-slow', 'zstd-fast', 'zstd-slow', 'lz4', 'xz', 'lzo', 'default', 'none'))) { + } elsif (!(grep $value eq $_, ('gzip', 'pigz-fast', 'pigz-slow', 'zstd-fast', 'zstdmt-fast', 'zstd-slow', 'zstdmt-slow', 'lz4', 'xz', 'lzo', 'default', 'none'))) { writelog('WARN', "Unrecognised compression value $value, defaulting to $DEFAULT_COMPRESSION"); $value = $DEFAULT_COMPRESSION; } @@ -2255,7 +2267,7 @@ syncoid - ZFS snapshot replication tool Options: - --compress=FORMAT Compresses data during transfer. Currently accepted options are gzip, pigz-fast, pigz-slow, zstd-fast, zstd-slow, lz4, xz, lzo (default) & none + --compress=FORMAT Compresses data during transfer. Currently accepted options are gzip, pigz-fast, pigz-slow, zstd-fast, zstdmt-fast, zstd-slow, zstdmt-slow, lz4, xz, lzo (default) & none --identifier=EXTRA Extra identifier which is included in the snapshot name. Can be used for replicating to multiple targets. --recursive|r Also transfers child datasets --skip-parent Skips syncing of the parent dataset. Does nothing without '--recursive' option.