[pve-devel] [PATCH v2 manager 3/3] fix #2559: vzdump: handle pigz blocksize property

Moayad Almalat m.almalat at proxmox.com
Tue Feb 4 15:56:03 CET 2020


From: Moayad <m.almalat at proxmox.com>

potentially improves backup speed.

Signed-off-by: Moayad <m.almalat at proxmox.com>
---
 PVE/VZDump.pm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index 0f04d4db..232f0550 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -592,7 +592,12 @@ sub compressor_info {
 		my $cpuinfo = PVE::ProcFSTools::read_cpuinfo();
 		$pigz_threads = int(($cpuinfo->{cpus} + 1)/2);
 	    }
-	    return ("pigz -p ${pigz_threads} --rsyncable", 'gz');
+	    my $pigz_cmd = "pigz -p ${pigz_threads} --rsyncable";
+	    my $pigz_blocksize = $opts->{pigz}->{blocksize};
+	    if (defined($pigz_blocksize)) {
+	        $pigz_cmd .= " -b ${pigz_blocksize}";
+	    }
+	    return ($pigz_cmd, 'gz');
 	} else {
 	    return ('gzip --rsyncable', 'gz');
 	}
-- 
2.20.1



More information about the pve-devel mailing list