Wednesday, October 21, 2015

Parallel compression on Linux using pbzip2

11:02 AM Posted by Dilli Raj Maharjan No comments

Install pbzip2 in centos

Search and install pbzip2 package 

# yum search pbzip2
# yum -y install pbzip2


































Now select the file to compress.




Start compression with normal tar command. 

# time tar cjvf host01.vdi.tar.bz2 host01.vdi





We can notice only Single CPU is used and load never goes beyond 1.06














Finally it is completed with following statistics.









Now compress using same file with pbzip2 with DOP 4 command

time pbzip2 -p4  host01.vdi





It is noticeable that multiple CPU is used and CPU load reached around 4.0














Compression completed with following statistics








Compression is completed around 4 times faster than normal compression and compressed size is same.






Decompress compressed file with command below

time pbzip2 -d -p4 host01.vdi.bz2






0 comments:

Post a Comment