Parallel Compression With pigz

Speed up gzip using multiple cores while keeping gzip compatibility.

LinuxperformancearchivecompressLow risk
Run pigz -k -p 8 archive.tar to compress it in parallel, keeping the original.

01Command

Command
$ pigz -k -p 8 archive.tar

02What it does

gzip is single-threaded, so compressing a multi-gigabyte backup leaves cores idle; pigz splits the stream across threads and produces standard .gz output that gunzip reads. The -k flag keeps the input file, which is safer for backups.

03Risk

RiskLow risk
Requirementssudo apt install pigz
!Warning: Parallel compression uses more memory per core; reduce -p on memory-constrained machines.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-10-13 · Category: Developer

06Related solutions