Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mperlet
Created August 18, 2017 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mperlet/29f2eb8d6b7b6d25aefae88e11dcdf8d to your computer and use it in GitHub Desktop.
Save mperlet/29f2eb8d6b7b6d25aefae88e11dcdf8d to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Start random stress"
while true; do
RANYES=$[ ( $RANDOM % 4 ) + 1 ]
RANSTR=$[ ( $RANDOM % 300 ) + 1 ]s
RANSLEEP=$[ ( $RANDOM % 3000 ) + 1 ]s
echo "Start $RANYES proccess for $RANSTR seconds"
c=1
while [[ $c -le $RANYES ]]; do
timeout $RANSTR yes > /dev/null &
let c=c+1
done
wait
echo "Sleep for $RANSLEEP"
sleep $RANSLEEP
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment