Linux - Multi-threaded compression log

There are 17 G log file, compression using multiple threads 2 minutes 23 seconds to complete the compression of the compression 3.2G, 6 times compression ratio, the compression will have to use ordinary 7 minutes and 50 seconds, three times a whole multiple, Us to see how to use.

Instructions

Installation pigz

yum install pigz -y
# 或者
apt-get install pigz

Compression (using eight CPU)

time tar -cf - logdir | pigz -p 8 > logdir.tgz

unzip

time pigz -p 8 -d logdir.tgz

Speed ​​is very fast, we can self-test.


9028759-07315bb8dadcd082.png

Reproduced in: https: //www.jianshu.com/p/a511bb6fc9bf

Guess you like

Origin blog.csdn.net/weixin_33853794/article/details/91059186