且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

[20131226]linux下使用pigz高效传输文件.txt

更新时间:2022-09-08 12:13:00

[20131226]linux下使用pigz高效传输文件.txt

http://zlib.net/pigz/

pigz, which stands for parallel implementation of gzip, is a fully functional replacement for gzip that exploits
multiple processors and multiple cores to the hilt when compressing data. pigz was written by Mark Adler, and uses the
zlib and pthread libraries. To compile and use pigz, please read the README file in the source code distribution. You
can read the pigz manual page here.

以前自己也测试过,tar+pigz确实非常快.

http://blog.itpub.net/267265/viewspace-752461/

今天要克隆机器,要传输文件从新机器,我使用如下:

我使用的linux版本是centos 6.2,pigz从这里下载:
http://pkgs.repoforge.org/pigz/

#  rpm -qa | grep pigz
pigz-2.1.6-1.el6.rf.x86_64


使用命令如下:
tar cvf - oracle -I pigz | ssh oracle@ip_address "( cd /u01/app/ ; tar xvf - -I pigz )"
or
tar cvf - oracle -I pigz | ssh oracle@ip_address tar xvf - -I pigz -C /u01/app/
--注意cvf 后面的-,千万不要忘记写!
--注意xvf 后面的-,千万不要忘记写!

--我拿pigz与lzop做了对比,明显pigz快许多.当然如果你网络不行,使用pigz会影响正常的业务.