Skip to content

Instantly share code, notes, and snippets.

@nicolargo
Created January 11, 2015 13:24
Show Gist options
  • Save nicolargo/22662eb26ca590bea198 to your computer and use it in GitHub Desktop.
Save nicolargo/22662eb26ca590bea198 to your computer and use it in GitHub Desktop.
Stress script for Glances
NBCORE=`nproc`
FREEMEM=`free -th | grep "buffers/cache" | awk '{print $4}'`
TIME=30
echo "START CPU stress"
echo "$NBCORE logical core"
echo
echo "Stress CPU user - $TIME seconds"
stress --cpu $NBCORE -t $TIME
# echo
# echo "Stress CPU system - $TIME seconds"
# stress --io $NBCORE -t $TIME
echo
echo "Stress CPU iowait (disk) - $TIME seconds"
stress -d $NBCORE -t $TIME
echo "START MEM stress"
echo "$FREEMEM free memory"
echo
echo "Stress MEM - $TIME seconds"
stress --vm 1 --vm-bytes $FREEMEM -t $TIME
# echo "START LOAD stress"
# echo
# echo "Stress LOAD - 5 minutes"
# stress --cpu $NBCORE --io $NBCORE --vm $NBCORE -t 300
# echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment