In order to test how a program reacts when system resources become scarce (mainly the CPU but I'm interested in disk I/O too), I'd like to put an arbitrary load on the system.
Currently I'm doing something like this:
#!/bin/bash
while true
do
echo "a" >> a.txt
md5 a.txt
done
I could also start mp3-encoding audio files, or whatever.
What would be an easy and small Bash script that could be used to simulate an arbitrary load, ideally configurable using parameter(s)?