Skip to content

Instantly share code, notes, and snippets.

@eirenik0
Last active May 3, 2019 21:36
Show Gist options
  • Save eirenik0/6f699bdc853a9082fa1b501f891a01cf to your computer and use it in GitHub Desktop.
Save eirenik0/6f699bdc853a9082fa1b501f891a01cf to your computer and use it in GitHub Desktop.
This script was run on each of the 2 load driving nodes. This script will incrementally add listeners to the icecast server at regular intervals; 10 listeners would be added every 10 seconds (with 2 machines, that’s a total of 20 listeners every 10 seconds). http://icecast.org/loadtest/1/
#!/bin/sh
#
# run concurrent curls which download from URL to /dev/null. output total
# and average counts to results directory.
#
# max concurrent curls to kick off
max=600
# how long to stay connected (in seconds)
duration=99999999
# how long to sleep between each curl, can be decimal 0.5
delay=10
# url to request from
URL=http://dwrac1:8500/stream.ogg
#####
#mkdir -p results
echo > results
while /bin/true
do
count=1
while [ $count -le $max ]
do
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " "$URL" >> results &
[ "$delay" != "" ] && sleep $delay
let count=$count+10
echo "Connections: ${count}"
done
wait
done
echo "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment