Compare commits

...

4 Commits

Author SHA1 Message Date
Orsiris de Jong f2aa40212d
Merge 0f98814efd into 8d4abf14b2 2025-06-11 14:16:05 +02:00
Orsiris de Jong 0f98814efd
Improve comment about zstd core limit 2025-04-29 16:52:38 +02:00
Orsiris de Jong 2c009be6ce
add zstd-medium compression parameter 2025-04-29 16:52:20 +02:00
Orsiris de Jong d3ad1caa15
Allow threaded zstd usage 2025-04-29 15:16:57 +02:00
1 changed files with 19 additions and 10 deletions

21
syncoid
View File

@ -17,6 +17,9 @@ use Capture::Tiny ':all';
my $mbuffer_size = "16M"; my $mbuffer_size = "16M";
my $pvoptions = "-p -t -e -r -b"; my $pvoptions = "-p -t -e -r -b";
# Get number of CPUs for zstd threading, but leave at least two cores empty for system responsiveness
my $ncpus = int(`nproc`);
if ($ncpus > 2) { $ncpus -= 2;}
# Blank defaults to use ssh client's default # Blank defaults to use ssh client's default
# TODO: Merge into a single "sshflags" option? # TODO: Merge into a single "sshflags" option?
@ -1142,9 +1145,15 @@ sub compressargset {
}, },
'zstd-fast' => { 'zstd-fast' => {
rawcmd => 'zstd', rawcmd => 'zstd',
args => '-3', args => "-T$ncpus -3",
decomrawcmd => 'zstd', decomrawcmd => 'zstd',
decomargs => '-dc', decomargs => "-T$ncpus -dc",
},
'zstd-medium' => {
rawcmd => 'zstd',
args => "-T$ncpus -8",
decomrawcmd => 'zstd',
decomargs => "-T$ncpus -dc",
}, },
'zstdmt-fast' => { 'zstdmt-fast' => {
rawcmd => 'zstdmt', rawcmd => 'zstdmt',
@ -1154,9 +1163,9 @@ sub compressargset {
}, },
'zstd-slow' => { 'zstd-slow' => {
rawcmd => 'zstd', rawcmd => 'zstd',
args => '-19', args => "-T$ncpus -19",
decomrawcmd => 'zstd', decomrawcmd => 'zstd',
decomargs => '-dc', decomargs => "-T$ncpus -dc",
}, },
'zstdmt-slow' => { 'zstdmt-slow' => {
rawcmd => 'zstdmt', rawcmd => 'zstdmt',
@ -1186,7 +1195,7 @@ sub compressargset {
if ($value eq 'default') { if ($value eq 'default') {
$value = $DEFAULT_COMPRESSION; $value = $DEFAULT_COMPRESSION;
} elsif (!(grep $value eq $_, ('gzip', 'pigz-fast', 'pigz-slow', 'zstd-fast', 'zstdmt-fast', 'zstd-slow', 'zstdmt-slow', 'lz4', 'xz', 'lzo', 'default', 'none'))) { } elsif (!(grep $value eq $_, ('gzip', 'pigz-fast', 'pigz-slow', 'zstd-fast', 'zstd-medium', 'zstdmt-fast', 'zstd-slow', 'zstdmt-slow', 'lz4', 'xz', 'lzo', 'default', 'none'))) {
writelog('WARN', "Unrecognised compression value $value, defaulting to $DEFAULT_COMPRESSION"); writelog('WARN', "Unrecognised compression value $value, defaulting to $DEFAULT_COMPRESSION");
$value = $DEFAULT_COMPRESSION; $value = $DEFAULT_COMPRESSION;
} }
@ -2400,7 +2409,7 @@ syncoid - ZFS snapshot replication tool
Options: Options:
--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 --compress=FORMAT Compresses data during transfer. Currently accepted options are gzip, pigz-fast, pigz-slow, zstd-fast, zstd-medium, 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. --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 --recursive|r Also transfers child datasets
--skip-parent Skips syncing of the parent dataset. Does nothing without '--recursive' option. --skip-parent Skips syncing of the parent dataset. Does nothing without '--recursive' option.