DEV Community

Ashen Chathuranga
Ashen Chathuranga

Posted on

CPU Stress Test on Arch Linux

This guide explains how to load your CPU to 100% to test cooling, thermal throttling, or stability.

⚠️ Warning

  • This will heat up your CPU significantly.
  • Monitor temperatures with lm_sensors.
  • Ensure your cooling system is working properly.
  • Do not leave unattended.

1. Install Required Tools

sudo pacman -Syu stress-ng lm_sensors
Enter fullscreen mode Exit fullscreen mode
  • stress-ng → main stress-testing tool
  • lm_sensors → CPU temperature monitoring

Set up sensors:

sudo sensors-detect
sensors
Enter fullscreen mode Exit fullscreen mode

2. Stress Test CPU

Option A: stress-ng (recommended)

Run all CPU cores at 100%:

stress-ng --cpu 0 --cpu-method matrixprod
Enter fullscreen mode Exit fullscreen mode
  • --cpu 0 → use all cores
  • --cpu-method matrixprod → heavy floating-point load

Optional: stop automatically after 5 minutes:

stress-ng --cpu 0 --cpu-method matrixprod --timeout 5m
Enter fullscreen mode Exit fullscreen mode

Option B: yes command (quick & dirty)

Each yes > /dev/null & consumes one core:

yes > /dev/null &
yes > /dev/null &
yes > /dev/null &
yes > /dev/null &
# Add one per CPU core
Enter fullscreen mode Exit fullscreen mode

Stop all processes with:

killall yes
Enter fullscreen mode Exit fullscreen mode

Option C: Compile Test (optional)

If you have source code:

make -j$(nproc)
Enter fullscreen mode Exit fullscreen mode
  • -j$(nproc) → uses all CPU cores

3. Monitor CPU Temperature

watch -n 1 sensors
Enter fullscreen mode Exit fullscreen mode
  • Updates every second
  • Check for thermal throttling warnings

4. Stop Stress Test

  • Ctrl + C if running in terminal
  • killall stress-ng or killall yes for background processes

Top comments (0)