The following is the GNU All-permissive License as recommended in https://www.gnu.org/licenses/license-recommendations.en.html

Copyright (C) 2024 Free Software Foundation sysadmin@fsf.org

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.

Contributions are welcome. See https://savannah.gnu.org/maintenance/fsf/.

Stress Testing hardware

hwtest.sh

Michael has a generic script to test components individually one at a time: https://github.com/TechnologyClassroom/HardwareTest/blob/master/hwtest.sh This can be used as a base to build a custom stress test.

Preparation

Disable TTY blanking

setterm -blank 0 -powerdown 0 -powersave off

Custom monitor that can be run within tmux or a TTY

watch -n .7 'sensors | grep -e fan1 -e fan3 -e fan5 -e fan6 -e temp1 -e temp7 -e power1 && echo \ && iostat -ctd | grep -e avg -e Devic -e sd'

Stress the CPU(s)

stress

10 minutes with one worker per core.

stress --cpu $(cat /proc/cpuinfo | grep -e processor | wc -l) -t $((60*10)) &

stress-ng

Note that this doesn't seem to stress cores to the max, even if you specify double the machine's cores.

stress-ng -C 0 --cpu-method all

'yes' stress

This seems to get 95% of the cores going at full speed.

for x in {0..31} ; do yes > /dev/null & done

pkill -f yes

Stress the RAM

stress

10 minutes using 90% of RAM.

stress --vm-bytes $(cat /proc/meminfo | grep mF | awk '{printf "%d\n", $2 * 0.9}')k --vm-keep -m 1 -t $((60*10)) &

memtester

Test 90% of RAM.

memtester $(free -m | head -n 2 | tail -n 1 | awk '{print $7 * 0.9}') 1

Stress the storage

fio

sd[b-e] write example

fio --name=readwrite --ioengine=libaio --iodepth=128 --rw=readwrite --bs=8k --direct=1 --size=512M --numjobs=8 --filename=/dev/sdb:/dev/sdc:/dev/sdd:/dev/sde --time_based=7200 --runtime=7200 --filesize=990G --group_reporting | grep io > /tmp/storage/fiosdb &

You can enter configurations into a file and tell fio to use that file.

randread.fio content:

[global]
bs=8k
iodepth=128
direct=1
ioengine=libaio
randrepeat=0
group_reporting
time_based
runtime=90000
filesize=990G

[job1]
rw=randread
filename=/dev/sdc:/dev/sdd:/dev/sde:/dev/sdf:/dev/sda:/dev/sdb
name=random-read

Call randread.fio

fio randread.fio

Stress the network

iperf

On another machine, run an iperf server.

iperf -s

On the machine to stress, run iperf clients.

iperf -c 10.12.16.5 -d -t 3600 -p 5001

Run one client for each port.

Configure each port with a static IP so you can tell which NIC is being stressed.