Introduction
What if you would be able to perform a data compression four times faster, with the same compression ratio as you normally do. Pbzip2 command line utility can easily accomplish this as it gives you an option to select number CPU and amount of RAM to be used during the compression process.
Regular tar and bzip2 compression
We all know the regular command to perform tar and bzip2 directory compression. The below command will tar
and compress our sandbox directory FOOBAR
. We are also prefixing the below command to get exact time for how long will it take to output compressed file FOOBAR.tar.Bbz2
from 242MB FOOBAR directory:
# time tar cjf FOOBAR1.tar.bz2 FOOBAR/
real 0m20.030s
user 0m19.828s
sys 0m0.304s
From the above time output we can see that it took about 20 seconds to create following compressed file:
# ls -lh FOOBAR1.tar.bz2
-rw-r--r-- 1 root root 54M Mar 10 20:25 FOOBAR1.tar.bz2
Read more