[Use the linux concurrent command parallel to speed up text file processing]-it turned out to be a pitfall.

Source: Internet
Author: User
1, see an article above oschina how to use multi-core CPU to accelerate your Linux Command & mdash; awk, sed, bzip2, grep, wc and other http: wwwoschinanetnews45477use-cpu-cores-linux-commands systems use Redhat5parall 1. see an article on oschina.

How to use multi-core CPU to accelerate your Linux commands-awk, sed, bzip2, grep, wc, etc.

Http://www.oschina.net/news/45477/use-cpu-cores-linux-commands

The system uses Redhat 5.

Official website of parallel:

Http://www.gnu.org/software/parallel/

Use the source of opensuse for installation.

Http://software.opensuse.org/download.html? Project = home % 3 Atange & package = parallel

For CentOS CentOS-6, run the following command as root user root:

cd /etc/yum.repos.d/wget http://download.opensuse.org/repositories/home:tange/CentOS_CentOS-6/home:tange.repoyum install parallel

For CentOS CentOS-5, run the following command as root user root:

cd /etc/yum.repos.d/wget http://download.opensuse.org/repositories/home:tange/CentOS_CentOS-5/home:tange.repoyum install parallel

The wc-l command showed that the computing time was not increased when the number of CPUs was 4, but it was slow.

Calculates the number of lines in 1 GB of files. it takes 10 s to use wc-l and parallel.

The relationship between MB files is also 10 times.

Summary:

There is still a difference between theory and practice. There is no advantage in testing 4 cup machines.

It takes more than 10 times to slow down. It seems that hadoop is more reliable to process large files.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.