Linux system CPU uses the 100% command

Source: Internet
Author: User
Tags cpu usage

For i in ' SEQ 1 $ (cat/proc/cpuinfo |grep "Physical id" |wc-l) '; Do DD If=/dev/zero Of=/dev/null & Done

Description

Cat/proc/cpuinfo |grep "Physical ID" | Wc-l can get the number of CPUs, which we represent as N.

SEQ 1 n is used to generate numbers between 1 and N

For i in ' seq 1 N '; is the loop execution command, from 1 to n

DD If=/dev/zero Of=/dev/null Executes the DD command, output to/dev/null, actually consumes only CPU, no IO operation.

Due to the continuous execution of n (n is the number of CPUs) of the DD command, and the usage rate is 100%, then the scheduler will dispatch each DD command on a different CPU processing.

Finally, all CPU usage 100%

Linux system CPU uses the 100% command

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.