Skip to content

Commit

Permalink
syncoid: Add zstdmt compress options
Browse files Browse the repository at this point in the history
Add the zstdmt-fast and zstdmt-slow compress options to allow use of
multithreading when using zstd compression.

Signed-off-by: 0xFelix <[email protected]>
  • Loading branch information
0xFelix committed Apr 20, 2024
1 parent 45b1ce9 commit 8b7d29d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions syncoid
Original file line number Diff line number Diff line change
Expand Up @@ -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 => '',
Expand All @@ -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;
}
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 8b7d29d

Please sign in to comment.