{"id":353,"date":"2013-08-09T14:02:53","date_gmt":"2013-08-09T14:02:53","guid":{"rendered":"http:\/\/www.buildcube.com\/tech_blog\/?p=353"},"modified":"2025-12-26T15:34:38","modified_gmt":"2025-12-26T15:34:38","slug":"linux-pipe-bzip2-in-parallel-multiple-threads","status":"publish","type":"post","link":"https:\/\/www.voodoo.business\/blog\/2013\/08\/09\/linux-pipe-bzip2-in-parallel-multiple-threads\/","title":{"rendered":"Linux PIPE, BZIP2 in parallel, multiple threads"},"content":{"rendered":"<p>I am getting old, my brain aint all that bright no more, for example i am so used to using<\/p>\n<p>mysqldump &#8211;opt -u root &#8211;password=&#8221;LaooIa12@Hsu&#8221; mytodolist | gzip > mytodolist.bin.gz<\/p>\n<p>So to compress the database while dumping it without having it hit the disk first in what is called piping.<\/p>\n<p>the problem is that i didn&#8217;t think of checking whether pbzip2 supports this so that i can use all 6 CPU cores (12 vCPUs)<\/p>\n<p>So, turns out that pbzip2 (parallel BZIP) does work<\/p>\n<p>mysqldump &#8211;opt -u root &#8211;password=&#8221;LaooIa12@Hsu&#8221; mytodolist | pbzip2 -vc > mytodolist.bin.bz2<\/p>\n<p>Now, i can get it done much much faster, 6-12 times faster<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am getting old, my brain aint all that bright no more, for example i am so used to using mysqldump &#8211;opt -u root &#8211;password=&#8221;LaooIa12@Hsu&#8221; mytodolist | gzip > mytodolist.bin.gz So to compress the database while dumping it without having it hit the disk first in what is called piping. the problem is that i [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[219],"tags":[],"class_list":["post-353","post","type-post","status-publish","format-standard","hentry","category-file-compression"],"_links":{"self":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/353","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/comments?post=353"}],"version-history":[{"count":1,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/353\/revisions"}],"predecessor-version":[{"id":6101,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/353\/revisions\/6101"}],"wp:attachment":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/media?parent=353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/categories?post=353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/tags?post=353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}