Using pigz in place of gzip drastically increases the speed of my KVM backups(I do not use openvz)
I see supporting pigz is on the todo list, until then I used the method below.
vzdump passes the --rsyncable option to gzip, this is not supported by pigz.
Because of this you must edit vzdump to remove this option
I did not like having to edit vzdump because I wanted to avoid potential hassles with future updates so I choose to use a wrapper script to call pigz.
First you need pigz, I used pigz from Squeeze:
Next I created the wrapper script, edit the file:
vi /bin/pigzwrapper
I set GZIP="-1" to overwrite the --rsyncable option vzdump sets and to set the compression level lower so it compresses faster. You might choose a higher level of compression.
On the exec line change -p 4 to the number of processor cores you want pigz to use.
Save that edited file.
Make the file executable:
Rename gzip:
Copy wrapper into place:
Now when gzip is executed you get pigz instead.
I see supporting pigz is on the todo list, until then I used the method below.
vzdump passes the --rsyncable option to gzip, this is not supported by pigz.
Because of this you must edit vzdump to remove this option
I did not like having to edit vzdump because I wanted to avoid potential hassles with future updates so I choose to use a wrapper script to call pigz.
First you need pigz, I used pigz from Squeeze:
Code:
#wget http://ftp.us.debian.org/debian/pool/main/p/pigz/pigz_2.1.6-1_amd64.deb
#dpkg --install pigz_2.1.6-1_amd64.deb
vi /bin/pigzwrapper
Code:
#!/bin/sh
PATH=${GZIP_BINDIR-'/bin'}:$PATH
GZIP="-1"
exec /usr/bin/pigz -p 4 "$@"
On the exec line change -p 4 to the number of processor cores you want pigz to use.
Save that edited file.
Make the file executable:
Code:
#chmod 755 /bin/pigzwrapper
Code:
#mv /bin/gzip /bin/gzip.original
Code:
#cp /bin/pigzwrapper /bin/gzip