Utilizing multi core for tar+gzip/bzip compression/decompression

user1118764 picture user1118764 · Sep 7, 2012 · Viewed 165k times · Source

I normally compress using tar zcvf and decompress using tar zxvf (using gzip due to habit).

I've recently gotten a quad core CPU with hyperthreading, so I have 8 logical cores, and I notice that many of the cores are unused during compression/decompression.

Is there any way I can utilize the unused cores to make it faster?

Answer

Jen picture Jen · Jun 14, 2013

You can also use the tar flag "--use-compress-program=" to tell tar what compression program to use.

For example use:

tar -c --use-compress-program=pigz -f tar.file dir_to_zip