Skip to content

Instantly share code, notes, and snippets.

View angelgcuartero's full-sized avatar

Angel García Cuartero angelgcuartero

View GitHub Profile
@drconopoima
drconopoima / recursion_loadtest.sh
Created March 24, 2021 23:45
System loadtest bash shell script that recursively forks itself. Generate CPU/memory/swap stress.
#!/bin/bash
script_name=$(basename $0)
script_version='0.1.0'
printf "* %s (%s)\n" "${script_name}" "${script_version}"
printf "System loadtest script that recursively forks itself\n"
printf "For maximum load:\n"
printf "\t * Raise maximum number of open files fs.file-max\n"
printf "\t * Raise user number of files soft/hard limits in /etc/security/limits.conf\n"
printf "**** CTRL + C to stop ****\n"
parent_process=${1:-$$}