Deploying Linux servers into production or overclocking workstation hardware demands rigorous thermal, power, and kernel subsystem validation. While standard benchmarking applications calculate abstract computational scores, systems engineers require purpose-built stress testing tools that deliberately push hardware components, kernel virtual memory managers, and file systems to their architectural failure limits.
The stress-ng suite is an enterprise-grade stress testing framework designed for the Linux kernel. With over 300 dedicated stressor modules spanning CPU arithmetic, POSIX threads, memory page fault handlers, disk I/O schedulers, and socket buffers, stress-ng enables system administrators to uncover thermal throttling issues, detect memory leaks, and verify server hardware reliability under sustained artificial workloads.
Installing stress-ng Across Linux Distributions
The stress-ng utility is maintained in the standard software repositories of all major Linux distributions:
- On Ubuntu, Debian, and Linux Mint:
sudo apt update && sudo apt install -y stress-ng
- On Fedora, RHEL, and Rocky Linux:
sudo dnf install -y stress-ng
- On Arch Linux:
sudo pacman -S stress-ng
Stressing Processor Cores and Evaluating Floating-Point Math
To push CPU cores to maximum power consumption and test cooling performance:
- Determine the physical and logical core count of your processor:
nproc
- Launch a 60-second stress test utilizing 4 CPU worker threads executing mixed computational workloads:
stress-ng --cpu 4 --timeout 60s --metrics-brief
- To evaluate floating-point math units specifically (ideal for testing thermal dissipation under AVX/AVX-512 vector instructions):
stress-ng --cpu 8 --cpu-method matrixprod --timeout 120s --metrics-brief
The --metrics-brief flag outputs an operational summary displaying bogo operations per second, letting you verify whether thermal throttling degraded processing throughput over the test window.
Stressing System RAM and Virtual Memory Subsystems
Faulty DRAM chips or poorly configured swap spaces frequently trigger kernel panics only when memory pressure reaches critical thresholds:
- Spawn 2 virtual memory worker threads allocating and thrashing 80% of available physical memory for 3 minutes:
stress-ng --vm 2 --vm-bytes 80% --vm-method all --timeout 180s --metrics-brief
- To evaluate memory allocation, zeroing, and page unmapping operations simultaneously:
stress-ng --malloc 4 --zombie 2 --timeout 60s
Benchmarking Storage I/O and File System Thrashing
Storage subsystem bottlenecks can severely compromise database performance. You can use disk stressors to evaluate sequential and random write queues:
- Spawn 2 I/O stressors writing, reading, and flushing temporary files to the disk:
stress-ng --hdd 2 --hdd-opts direct --timeout 60s --metrics-brief
- To stress file system directory metadata creation and removal operations:
stress-ng --dentry 4 --timeout 60s --metrics-brief
Running Combined Multi-Subsystem Stress Tests
To simulate severe system-wide resource contention across processing, memory, and disk channels concurrently:
stress-ng --cpu 4 --io 2 --vm 2 --vm-bytes 4G --hdd 1 --timeout 120s --metrics-brief
During the stress run, monitor your system using a secondary terminal running htop, iostat -xz 1, or sensors to observe core temperatures, voltage droop, and throttling behaviors under maximum sustained load.