I found very simple methods to stress your CPU in Linux I know it’s not the requirement we are getting but sometimes for testing we can do that. yes and dd command can help to put the stress
I have one Linux VM hosted on VMware Workstation I allocated two CPU each with 2 cores.
“Yes > /dev/null &” Command
On First core of Second CPU :
On First Core of First CPU.
On Second core of each CPU it got distributed equally.
Now all cores are 100% utilized.
Issued kill command to kill the yes. Utilization came normal.
“dd if=/dev/zero of=/dev/null” command
Now using the dd command to put the stress on system. it also putting the load in single core only but it will put the load in system space not in user space.
I Opened another terminal and ran the dd command this time in background. Load came into CPU0.
Issued another dd command load is distributed now.
That’s it otherwise CPU is gonna come out and gonna kill me 🙂