LinuxCommandLibrary

stress-ng

TLDR

Stress CPU

$ stress-ng --cpu [4] --timeout [60s]
copy
Stress memory
$ stress-ng --vm [2] --vm-bytes [1G] --timeout [60s]
copy
Stress disk I/O
$ stress-ng --io [4] --timeout [60s]
copy
Combined stress test
$ stress-ng --cpu [2] --vm [2] --io [2] --timeout [60s]
copy
Matrix operations (CPU intensive)
$ stress-ng --matrix [4] --timeout [60s]
copy
Show available stressors
$ stress-ng --stressors
copy
Metrics output
$ stress-ng --cpu [4] --metrics --timeout [60s]
copy
Limit CPU usage
$ stress-ng --cpu [4] --cpu-load [50] --timeout [60s]
copy

SYNOPSIS

stress-ng [--cpu n] [--vm n] [--io n] [--timeout t] [options]

DESCRIPTION

stress-ng tests system stability under various loads. It exercises CPU, memory, I/O, and other subsystems to find hardware or software issues.
CPU stressors include integer, floating-point, matrix operations, and cryptographic algorithms. Different stressors stress different CPU components.
Memory tests allocate, write, and verify RAM. They can uncover bad memory, cooling issues, and memory controller problems.
I/O stressors exercise filesystem and block device operations. They reveal disk, controller, and driver problems.
Metrics show operations per second and system statistics. These help quantify performance and identify bottlenecks.
Combined workloads simulate realistic multi-component stress. Thermal and power issues often appear only under mixed loads.

PARAMETERS

--cpu N

CPU stress workers.
--cpu-load PERCENT
Target CPU load.
--vm N
Memory stress workers.
--vm-bytes SIZE
Memory per worker.
--io N
I/O stress workers.
--hdd N
Disk write workers.
--matrix N
Matrix computation.
--timeout TIME
Test duration.
--metrics
Show statistics.
--verbose
Verbose output.
--stressors
List stressors.
--class CLASS
Run stressor class.
--sequential N
Run stressors sequentially.
--all N
Run all stressors.

CAVEATS

Can damage unstable hardware. High temperatures possible. May trigger OOM killer. Use with cooling monitoring.

HISTORY

stress-ng was written by Colin Ian King at Canonical as an enhanced version of stress. It provides many more stressor types and is used for kernel and hardware testing.

SEE ALSO

stress(1), sysbench(1), memtester(8), fio(1)

Copied to clipboard