One way command to achieve a CPU usage 100%

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 The number of CPUs can be obtained,   we will express it as N.

seq 1 N is used to generate numbers between 1 and N

for i in `seq 1 N`; is to execute commands in a loop, from 1 to N

dd if=/dev/zero of=/dev/null execute dd command,   output to /dev/null , Actually only occupies the CPU, “no IO operation.

Since N (N is the number of CPUs) dd commands are executed continuously, and the utilization rate is 100%, the scheduler will schedule Each dd command is processed on a different CPU.

Eventually realize 100% of all CPU occupancy rate

In addition, the end of the above program can be used:

1. Press ctrl + C after fg (because the command is executed in the background)

2. pkill -9 dd

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5331 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.