Efficient Compressed Archives with Tar Parallelism
Backup & Recovery (Rsync/Tar/Dd)
Efficient Compressed Archives with Tar Parallelism
🧩 The Challenge
Creating large compressed tarballs on multi-core systems is often slow because standard gzip is single-threaded. This creates a bottleneck during large-scale server backups.
💡 The Fix
Use the pigz utility as an external compressor for tar to leverage all available CPU cores during the archive process.
tar --use-compress-program="pigz -9" -cvf backup_archive.tar.gz /path/to/data
⚙️ Why It Works
By offloading the compression task to pigz, tar distributes the mathematical compression workload across all processor threads instead of relying on a single core.
🚀 Pro-Tip: If pigz is not installed, you can use the -I option in tar to specify any custom compression utility installed on your path.
Linux Tips & Tricks | © ngelinux.com | 7/7/2026
