Skip to main content

How to Use STRESS command in Linux/Ubuntu

One can check CPU on Linux other subsystem. Instances within which this can be useful include those during which a computer user wishes to perform tuning activities, a kernel or libc programmer wishes to judge denial of service possibilities, test your systems entirely on high load and monitoring the health and more. this is often also useful for sysadmin, system builders, and overclockers who want to check their hardware under high load and monitor stability and thermal environment.



Stress Test CPU and Memory (VM) On a Linux / Unix

stress : it's a straightforward workload generator for POSIX systems. It imposes to be configurable number of CPU, memory, I/O, and disk stress on the system. it's written in C, and is free software licensed under the GPLv2. it's not a benchmark, but is very a tool designed

stress-ng : it's an updated version of stress tool and it'll check a server for the subsequent features:

  • CPU compute

  • Cache thrashing

  • Drive stress

  • I/O syncs

  • VM stress

  • Socket stressing

  • Context switching

  • Process creation and termination
It includes over 60 different stress tests, over 50 CPU specific stress tests that exercise floating point, integer, bit manipulation and control flow, over 20 computer storage stress tests.


This program is meant to be easy to use and recommended for brand spanking new sysadmins. The tool is thought to figure on x86 Linux and FreeBSD/OpenBSD, powerpc AIX and Linux, SPARC Solaris, Compaq Alpha Tru64 UNIX, and plenty of others.

Install stress package on a Linux
You can install stress as a part of the Linux or Unix distribution.

Just same as below Install stress on a CentOS, RHEL, and Fedora Linux


sudo yum install stress

As per below Install stress on a Debian and Ubuntu Linux

apt-get install stress

According to below step you can Install stress on a FreeBSD Unix system
Type the following pkg command to install the stress tool using binary method:


pkg install stress
## OR ##
pkg install sysutils/stress


Install stress on a OpenBSD Unix system
Type the following pkg_add command to install the stress tool using binary method:


## if installpath not set in  /etc/pkg.conf as follow ##
## installpath =   http://mirror.esc7.net/pub/OpenBSD/%c/packages/%a/ use ##
## PKG_PATH  ##
export PKG_PATH=http://ftp.usa.openbsd.org/pub/OpenBSD/`uname -r`/packages/`arch -s` 
pkg_add stress


How do I use stress tool on Linux?
First, note down the current system load averages by typing the following command:


# uptime

Next, run any one of the following command to see load on screen:

# watch uptime

OR you can use tload command:

# tload

The syntax is as follows:

stress [OPTION]
## Stress using CPU-bound task
stress -c 4
## Stress using IO-bound task 
stress -i 2


For example, a load average of four is imposed on the system by specifying two CPU-bound processes, one I/O-bound process, and one memory allocator process as follows:

# uptime
# stress -c 2 -i 1 -m 1 --vm-bytes 128M -t 10s
# uptime


stress [OPTION]
## Stress using CPU-bound task

stress -c 4
## Stress using IO-bound task
stress -i 2

For example, a load average of four is imposed on the system by specifying two CPU-bound processes, one I/O-bound process, and one memory allocator process as follows:

# uptime
# stress -c 2 -i 1 -m 1 --vm-bytes 128M -t 10s
# uptime

While,

-c 2 : Spawn two workers spinning on sqrt()
-i 1 : Spawn one worker spinning on sync()
-m 1 : Spawn one worker spinning on malloc()/free()
--vm-bytes 128M : Malloc 128MB per vm worker (default is 256MB)
-t 10s : Timeout after ten seconds
-v : Be verbose

Comments

Popular posts from this blog

What is STP? - Explain Advantages and Disadvantages

The Spanning Tree Protocol is a network protocol that builds a loop-free logical topology for Ethernet networks. The basic function of STP is to prevent bridge loops and the broadcast radiation that results from them. STP is a protocol. It actively monitors all links of the network. To finds a redundant link, it uses an algorithm, known as the STA (spanning-tree algorithm). The STA algorithm first creates a topology database then it finds and disables the redundant links. Once redundant links are disabled, only the STP-chosen links remain active. If a new link is added or an existing link is removed, the STP re-runs the STA algorithm and re-adjusts all links to reflect the change. STP (Spanning Tree Protocol) automatically removes layer 2 switching loops by shutting down the redundant links. A redundant link is an additional link between two switches. A redundant link is usually created for backup purposes. Just like every coin has two sides, a redundant link, along with

What are the Advantages and Disadvantages of TCP/UDP ?? Difference between TCP and UDP

As in previous blog we have define and explain about what is TCP and UDP and from now we are moving ahead with Advantages, Disadvantages and Difference of TCP and UDP but for this you have to know about TCP and UDP hence to understand it go for a What is TCP and UDP . Advantage of TCP Here, are pros/benefits of TCP: It helps you to establish/set up a connection between different types of computers. It operates independently of the operating system. It supports many routing-protocols. It enables the internetworking between the organizations. TCP/IP model has a highly scalable client-server architecture. It can be operated independently. Supports several routing protocols. It can be used to establish a connection between two computers. Disadvantages of TCP Here, are disadvantage of using TCP: TCP never conclude a transmission without all data in motion being explicitly asked. You can't use for broadcast or multicast transmission. TCP has no block boundaries, so you