User Tools

Site Tools


ubuntu:cpu:create_100_cpu_load

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ubuntu:cpu:create_100_cpu_load [2022/05/10 19:42] – created peterubuntu:cpu:create_100_cpu_load [2022/05/10 19:55] (current) peter
Line 5: Line 5:
 ---- ----
  
-===== Install Stress or Stress-ng in Linux =====+===== Install Stress or Stress-ng =====
  
 <code bash> <code bash>
Line 16: Line 16:
 sudo apt install stress-ng sudo apt install stress-ng
 </code> </code>
 +
 +<WRAP info>
 +**NOTE:**  **stress-ng** is a newer version of stress that ships in with extra features.
 +</WRAP>
 +
  
 ---- ----
Line 44: Line 49:
 </code> </code>
  
 +----
  
 +===== Other methods to create 100% CPU load =====
 +
 +<code bash>
 +yes > /dev/null &
 +</code>
 +
 +**NOTE:**  This only imposes 100% load on a single core.
 +
 +To impose this against multiple cores, then run the command multiple times to exhaust all the CPU power:
 +
 +<code bash>
 +yes > /dev/null &
 +yes > /dev/null &
 +yes > /dev/null &
 +yes > /dev/null &
 +</code>
 +
 +<WRAP info>
 +**NOTE:**  To terminate the Linux background jobs created by the above commands:
 +
 +<code bash>
 +killall yes
 +</code>
 +
 +</WRAP>
 +
 +----
 +
 +===== Another method to produce 100% CPU load usage =====
 +
 +<code bash>
 +dd if=/dev/zero of=/dev/null
 +</code>
 +
 +To fully utilize all the cores on your system, run the following command:
 +
 +<code bash>
 +fulload() { dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null & }; fulload; read; killall dd
 +</code>
 +
 +<WRAP info>
 +**NOTE:**  The number of the above command in the function should be equal to the number of cores (for example 4 in this case).
 +</WRAP>
 +
 +----
  
ubuntu/cpu/create_100_cpu_load.1652211760.txt.gz · Last modified: 2022/05/10 19:42 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki