Live data from Hacker News

pigz: A parallel implementation of gzip for multi-core machines

github.com

11–20 of 107 posts

Re: pigz: A parallel implementation of gzip for multi-core machines

#11

We used this to great effect at Facebook for MySQL backups in the early 2010s. The backup hosts had far more CPU than needed so it was a very nice speed-up over gzip. Eventually we switched to zstd, of course, but pigz never failed us.

Pretty similar to that, we used pigz and netcat to bring up new MySQL read replicas in a chain at line speeds.

I recall learning the technique from Tumblr's eng blog.

https://engineering.tumblr.com/post/7658008285/efficiently-c...

Re: pigz: A parallel implementation of gzip for multi-core machines

#13

I used this recently with -0 (no compression) to pack* billions of files into a tar file before sending them over the network. It worked amazing.

Maybe I’m missing something, but why send the tar generated stream through a non-compressing compressor when you could just send the tar directly?

Re: pigz: A parallel implementation of gzip for multi-core machines

#14

We used this to great effect at Facebook for MySQL backups in the early 2010s. The backup hosts had far more CPU than needed so it was a very nice speed-up over gzip. Eventually we switched to zstd, of course, but pigz never failed us.

Same, except we were at a small e-commerce boutique running Magento circa 2011-2013.

SQL backups were simply a bash script using Pigz, running on a cron job. Simple times!

Re: pigz: A parallel implementation of gzip for multi-core machines

#15

I used this recently with -0 (no compression) to pack* billions of files into a tar file before sending them over the network. It worked amazing.

Maybe I’m missing something, but why send the tar generated stream through a non-compressing compressor when you could just send the tar directly?

I didn't have the tar, I created it using:

tar --use-compress-program="pigz -0" ...

Re: pigz: A parallel implementation of gzip for multi-core machines

#16

I used this recently with -0 (no compression) to pack* billions of files into a tar file before sending them over the network. It worked amazing.

Why use tar | pigz -0 when you can just use tar?

I used tar --use-compress-program="pigz" to create the tar out of billions of files

Re: pigz: A parallel implementation of gzip for multi-core machines

#17
post #8

If you really want to enable all cores for compression and decompression, give pbzip2 a try. pigz isn't as parallel as pbzip2 http://compression.ca/pbzip2/ *edit, as ac29 mentions below, just use zstdmt. In my quick testing it is approximately 8x faster than pbzip2 and gives better compression ratios. Wall clock time went from 41s to 3.5s for a 3.6GB tar of source, pdfs and images AND the resulting file was smaller.…

bzip2 is very very slow though. Some types of data compress quite well with bzip, but if high compression is needed, xz is usually as good or better and natively has multithreading available.

For everything else, there's zstd (also natively multithread)

Re: pigz: A parallel implementation of gzip for multi-core machines

#19

Earlier quoted context omitted.

Why use tar | pigz -0 when you can just use tar?

I used tar --use-compress-program="pigz" to create the tar out of billions of files

Tar is the archiver here (putting multiple files into one file), pigz with no compression isnt doing anything besides wasting CPU time.
Post reply on HN