Backup Compression
Question
What is backup compression and how can I compress backups?
Environment
CentOS 6/7
Answer
Backup compression allows you to reduce the storage space used by your backup files and thus increase the backup speed. The most common tool to compress backups on the backup server is gzip, but it does not develop the data compression full potential. To increase your backup speed, it is recommended to compress backups using pigz instead of gzip. Pigz or parallel implementation of gzip is a functional replacement that uses multiple cores that significantly reduces the time needed for the backup creation.
Enable Pigz Instead of Gzip
To enable pigz and force its usage across the whole server:
Download and install EPEL repository files:
• RHEL/CentOS 6# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
CODE• RHEL/CentOS 7
# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
CODEInstall
pigz
from the EPEL repository:# yum install pigz
CODEMake a copy by renaming
gzip
togzip.bin
:# mv /bin/gzip /bin/gzip.bin
CODECreate a link pointing to
pigz
:# ln -s /usr/bin/pigz /bin/gzip
CODE
After the backup compression is enabled, pigz will be overlayed by the gzip RPM package reinstall or update.
Enable pigz on CloudBoot Compute Resources
To use pigz and unpigz on CloudBoot compute resources:
Download these two files to your Control Panel:
• CentOS 6http://rpm.repo.onapp.com/utils/pigz-2.2.5-2.1.x86_64.tar.gz
CODE• CentOS 7
http://rpm.repo.onapp.com/utils/pigz-2.3.3-1.el7.centos.x86_64.tar.gz
CODEDistribute the files to your CloudBoot compute resources with
scp
to the/tmp/
folder:scp /root/pigz-2.2.5-2.1.x86_64.tar.gz root@192.168.1.31:/tmp/
CODELog in to the compute resource with ssh:
cd /tmp/;tar xzvpf pigz-2.2.5-2.1.x86_64.tar.gz -C /
CODEMake a copy by renaming
gzip
togzip.bin
:mv /usr/bin/gzip /usr/bin/gzip.bin
CODECreate a link pointing to
pigz
:ln -s /bin/pigz /usr/bin/gzip
CODEMake a copy by renaming
unzip
tounzip.bin
:mv /usr/bin/unzip /usr/bin/unzip.bin
CODECreate a link pointing to
unpigz
:ln -s /bin/unpigz /usr/bin/unzip
CODE