Here's a simplistic stress tester that bursts a given service multiple times in parallel.
Disclaimer: This script was designed to be a stress test tool and must be used with extreme care. Use it at your own discretion but warned that the author won't be responsible for any damage it might cause your targetted service. Therefore, be conservative with the numbers or you might put your services down.
Copy the below script into your Mac or Linux machine and save it as deny-the-service.sh
.
(Yeah, you might not have the tools available on your Windows, but you can give it a try if you want.)
#!/bin/sh
# FUNCTIONS
burst() {
C=0
while [ $C -lt $1 ]
do
curl -s "$2" > /dev/null
printf '.'
((C++))
done
}
# VARIABLES
MACHINES=${MACHINES:-1}
BURST_SIZE=${BURST_SIZE:-10}
URL=${URL?Variable not set}
# MAIN
echo "Bursting $URL"
echo "It will simulate $MACHINES machines performing $BURST_SIZE requests"
echo "Do you wish to continue? [Ctrl+C to abort, ENTER to continue]"
read
I=0
while [ $I -lt $MACHINES ]; do
burst $BURST_SIZE $URL &
((I++))
done
Open the Terminal and type the following command in the folder in which you saved the file.
chmod +x deny-the-service.sh
URL=https://google.com MACHINES=10 BURST_SIZE=100 ./deny-the-service.sh