It is a simple workload generator for POSIX systems. It imposes a configurable amount of CPU, memory, I/O, and disk stress on the system. It will stress test a server for the following features:
CPU compute
Cache thrashing
VM stress
Drive stress
I/O syncs
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 virtual memory stress tests.
Lots of stressors
It is not a benchmark, but is rather a tool designed
Stressor
The stress-ng stressors are grouped together in different classes, each class may have many stressors or one stressor, when you start stress, you can run a class(all stressor in that class) or just a specific stressor or several stressors at a time.
Classes:
cpu - CPU intensive
cpu-cache - stress CPU instruction and/or data caches
-a N, --all N, --parallel N (mostly used combined with --class) start N instances of all stressors in parallel. If N is less than zero, then the number of CPUs online is used for the number of instances. If N is zero, then the number of CPUs in the system is used.
--sequential N sequentially run all the stressors one by one for a default of 60 seconds. The number of instances of each of the individual stressors to be started is N. If N is less than zero, then the number of CPUs online is used for the number of instances. If N is zero, then the number of CPUs in the system is used. Use the --timeout option to specify the duration to run each stressor.
--taskset list set CPU affinity based on the list of CPUs provided; stress-ng is bound to just use these CPUs (Linux only). The CPUs to be used are specified by a comma separated list of CPU (0 to N-1). One can specify a range of CPUs using '-', for example: --taskset 0,2-3,6,7-11
-t N, --timeout T stop stress test after T seconds. One can also specify the units of time in seconds, minutes, hours, days or years with the suffix s, m, h, d or y. Note: A timeout of 0 will run stress-ng without any timeouts (run forever).
--vm-keep don not continually unmap and map memory, just keep on re-writing to it.
--vm-populate populate (prefault) page tables for the memory mappings; this can stress swapping. Only available on systems that support MAP_POPULATE (since Linux 2.5.46).
# You can generate major page faults (by accessing a page is not loaded in memory at the time of the fault) and see the page fault rate using: $ stress-ng --fault 0 --perf -t 1m
# or with newer kernels use the userfaultfd stressor to force even more major faults: $ stress-ng --userfaultfd 0 --perf -t 1m