\begin{exe} {Using stress or stress-ng}

   \textbf{stress} is a \textbf{C} language program written
   by Amos Waterland at the University of Oklahoma, licensed
   under the \textbf{GPL v2}. It is designed to place a
   configurable amount of stress by generating various kinds
   of workloads on the system.

   \textbf{stress-ng} is  essentially an enhanced
   version of \textbf{stress}, which respects its symptoms and
   options. It is actively maintained: see
   \url{https://wiki.ubuntu.com/Kernel/Reference/stress-ng}

   All major distributions should have \textbf{stress-ng} in
   their packaging systems However, for \textbf{RHEL/CentOS}
   it needs to be obtained from the EPEL repository.  As of
   this writing there is no package in the EPEL 8
   repository, but you can install the one from EPEL 7
   without a problem.

   \begin{lfbox}[Installing from Source]
      If you are lucky you can install \textbf{stress} or
      \textbf{stress-ng} directly from your distribution's
      packaging system.

      Otherwise,  the source for \textbf{stress-ng} can be obtained using
      \textbf{git} from
      \url{https://kernel.ubuntu.com/git/cking/stress-ng.git/}.
      (Or you can download a tarball and use that.)  To download,
      compile, and install:
      \begin{cmd}
$ git clone git://kernel.ubuntu.com/cking/stress-ng.git
$ cd stress-ng
$ make
$ sudo make install
   \end{cmd}
   \end{lfbox}

   Once installed, you can do:

   \begin{cmd}
$ stress-ng --help
   \end{cmd}
   for a quick list of options, or

   \begin{cmd}
$ info stress-ng
   \end{cmd}
   for more detailed documentation.

   As an example, the command:

   \begin{cmd}
$ stress-ng -c 8 -i 4 -m 6 -t 20s
   \end{cmd}
   will:
   \begin{itemize}
      \item

      Fork off 8 CPU-intensive processes, each spinning on a
      \verb?sqrt()? calculation.

      \item

      Fork off 4 I/O-intensive processes, each spinning on
      \verb?sync()?.

      \item

      Fork off 6 memory-intensive processes, each spinning on
      \verb?malloc()?, allocating 256 MB by default.  The size
      can be changed as in \verb?--vm-bytes 128M?.

      \item

      Run the stress test for 20 seconds.

   \end{itemize}

   After installing \textbf{stress-ng}, you may want to start up
   your system's graphical system monitor, which you can find
   on your application menu, or run from the command line,
   which is probably \textbf{gnome-system-monitor} or
   \textbf{ksysguard}.

   Now begin to put stress on the system. The exact numbers
   you use will depend on your system's resources, such as
   the number of CPU's and \textbf{RAM} size.

   For example, doing

   \begin{cmd}
$ stress-ng -m 4 -t 20s
   \end{cmd}
   puts only a memory stressor on the system.

   Play with combinations of the switches and see how they
   impact each other. You may find the \textbf{stress-ng}
   program useful to simulate various high load conditions.
\end{exe}


