Tuesday, March 10, 2015

How To Produce High CPU Load, Memory, I/O Or Stress Test Linux Server

On CentOS/RHEL
# yum install gcc gcc-c++ autoconf automake
Download the latest tarball and run configure, make, make install
# 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
To know about all available flags execute
# stress --help