This may seem weird, but is there a way to make the machine(linux/unix flavours - preferably RHEL). I need to control the speed of the machine to make sure the code works on very slow systems and identify the right break point (in terms of time)..
One way i can do it is to run some heavy background process. Any other smarter way?
Thanks
How to produce high CPU load, memory, I/O or stress test Linux server
Install some prerequisites
On CentOS/RHEL
yum install gcc gcc-c++ autoconf automake
On Debian, Ubuntu
sudo su -
apt-get update
apt-get install build-essential
Download the latest tarball and run configure, make, make install
wget http://pkgs.fedoraproject.org/repo/pkgs/stress/stress1.0.4.tar.gz/a607afa695a511765b40993a64c6e2f4/stress-1.0.4.tar.gz
tar zxvf stress-1.0.4.tar.gz
cd stress-1.0.4
./configure
make
make install
The binary gets installed under /usr/local/bin
To start stress run stress followed by the -c flag for load stress, -m for memory stress, -i for io and -d for HDD. For example to stress cpu execute
stress -c 5
Execution of the command above will hog all available cpu power and create a load five times a single core would happily handle.
Similarly to stress some memory you can execute
stress -m 512M
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With