在linux下使用压缩文件的时候如果文件比较大,那 就会非常慢,虽然多核技术已经多年,但是bzip2使用的还是但和的
top - 11:48:25 up 14 days, 38 min, 3 users, load average: 1.30, 1.42, 1.53 Tasks: 178 total, 3 running, 175 sleeping, 0 stopped, 0 zombie Cpu0 : 0.7%us, 0.7%sy, 0.0%ni, 98.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Cpu1 : 99.7%us, 0.3%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Cpu2 : 2.7%us, 0.7%sy, 0.0%ni, 96.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Cpu3 : 0.3%us, 0.3%sy, 0.0%ni, 99.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 24597464k total, 24402084k used, 195380k free, 50596k buffers Swap: 24575992k total, 31348k used, 24544644k free, 22398336k cached
看看安装时候的 情况:
top - 12:32:55 up 14 days, 1:22, 3 users, load average: 0.35, 0.42, 0.92 Tasks: 173 total, 2 running, 171 sleeping, 0 stopped, 0 zombie Cpu0 : 25.2%us, 4.3%sy, 0.0%ni, 70.2%id, 0.0%wa, 0.0%hi, 0.3%si, 0.0%st Cpu1 : 24.8%us, 4.6%sy, 0.0%ni, 70.2%id, 0.0%wa, 0.0%hi, 0.3%si, 0.0%st Cpu2 : 24.7%us, 4.3%sy, 0.0%ni, 70.4%id, 0.0%wa, 0.0%hi, 0.7%si, 0.0%st Cpu3 : 15.8%us, 3.6%sy, 0.0%ni, 80.2%id, 0.0%wa, 0.0%hi, 0.3%si, 0.0%st Mem: 24597464k total, 23560772k used, 1036692k free, 55980k buffers Swap: 24575992k total, 31348k used, 24544644k free, 21388964k cached
安装包下载路径 ,官方网站有 :http://compression.ca/pbzip2/
但是我的 ubuntu 安装没问题,在centos上安装就有问题
我的是:
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch Distributor ID: CentOS Description: CentOS release 6.4 (Final) Release: 6.4 Codename: Final
附件是我安装 centos6.4上的 rpm包 ,仅供参考
安装方法:
写道
Debian/Ubuntu: 'apt-get update; apt-get install pbzip2' or get the Deb package
RedHat: 'yum install pbzip2'
或者下载安装包:
serial_cmd sudo rpm -ivh pbzip2-1.1.6-1.choon.centos6.x86_64.rpm
RedHat: 'yum install pbzip2'
或者下载安装包:
serial_cmd sudo rpm -ivh pbzip2-1.1.6-1.choon.centos6.x86_64.rpm
http://choonrpms.mirror.choon.net/centos/6.2/choonrpms/x86_64/
安装完成后 将 bzip2 的命令链接到 pbzip2
写道
1.首先删除原来 /usr/bin/bzip2
mv /usr/bin/bzip2 /usr/bin/bzip2.bak
2.将pbzip2 链接到 /usr/bin/bzip2
sudo ln -s /usr/bin/pbzip2 /usr/bin/bzip2
tar -jcf tt.tar.bz2 *
看看 cpu吧:
top - 13:05:39 up 14 days, 1:55, 3 users, load average: 6.51, 3.05, 2.04
Tasks: 175 total, 1 running, 174 sleeping, 0 stopped, 0 zombie
Cpu0 : 97.7%us, 2.3%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu1 : 76.1%us, 19.9%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 4.0%si, 0.0%st
Cpu2 : 74.7%us, 20.0%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 5.3%si, 0.0%st
Cpu3 : 82.3%us, 16.0%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 1.7%si, 0.0%st
Mem: 24597464k total, 24393740k used, 203724k free, 56256k buffers
Swap: 24575992k total, 31348k used, 24544644k free, 21631264k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
579 yoyosys 20 0 349m 34m 1008 S 252.8 0.1 7:42.06 bzip2
2744 yoyosys 20 0 7659m 1.0g 268m S 117.3 4.2 90:40.01 DataCell
14241 yoyosys 20 0 150m 9.8m 2004 S 24.6 0.0 137:03.82 agent
mv /usr/bin/bzip2 /usr/bin/bzip2.bak
2.将pbzip2 链接到 /usr/bin/bzip2
sudo ln -s /usr/bin/pbzip2 /usr/bin/bzip2
tar -jcf tt.tar.bz2 *
看看 cpu吧:
top - 13:05:39 up 14 days, 1:55, 3 users, load average: 6.51, 3.05, 2.04
Tasks: 175 total, 1 running, 174 sleeping, 0 stopped, 0 zombie
Cpu0 : 97.7%us, 2.3%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu1 : 76.1%us, 19.9%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 4.0%si, 0.0%st
Cpu2 : 74.7%us, 20.0%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 5.3%si, 0.0%st
Cpu3 : 82.3%us, 16.0%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 1.7%si, 0.0%st
Mem: 24597464k total, 24393740k used, 203724k free, 56256k buffers
Swap: 24575992k total, 31348k used, 24544644k free, 21631264k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
579 yoyosys 20 0 349m 34m 1008 S 252.8 0.1 7:42.06 bzip2
2744 yoyosys 20 0 7659m 1.0g 268m S 117.3 4.2 90:40.01 DataCell
14241 yoyosys 20 0 150m 9.8m 2004 S 24.6 0.0 137:03.82 agent