I would like to test fake load on the server, I'm looking for some burn-in or benchmark command line utility that would generate CPU load on the system.
I would like to be able to burn-in only CPU (no harddisk load, network and co) and that I would be able to set the period in which the load will run. Meaning I want something that would be able to run: CPU load for 10min on the system.
Any ideas?
You can download and install the "stress" utility... It allows you generate CPU, Memory, Disk and IO load from the command line.
Homepage: http://people.seas.harvard.edu/~apw/stress/
FAQ: http://people.seas.harvard.edu/~apw/stress/FAQ
I prefere floating point ops:
Be aware of your CPU number :-)
This is something I frequently want to do. But I don't have a good way of doing it. I just write a small Perl script that will just loop for as many seconds as I want.
E.g. (for 10 minutes):
Of course if you have n processors you might want to add a bash loop to create that many processes:
cpuburn
"How do I run a command, and have it abort (timeout) after N seconds?"
I recommend using stress-ng, it has a lot more features than stress and can exercise far more of the operating system.
http://kernel.ubuntu.com/~cking/stress-ng/
Here is a pure shell (at least
bash
&ksh
) way that I already posted as a reply to a similar question here