Stress testing Shoutcast Server

If you’re like me, you’ve got a shoutcast server configured to handle thousands of connections. I was pretty sure my setup could handle the load, but I wanted to actually find out. After looking around online, I found out an easy way to stress test the server using curl. Here’s a little script I wrote that will allow you to murder your server :D. Run this script on a test machine with a decent internet connection so you can really stress the server. This script should run on basically any linux operating system. I used Ubuntu as my test box.

Just a few things before you run the script.. You will need vnstat (or you’ll have to comment it out) to get the most of the script. Also, be careful with how many threads you run. If your server has the ulimit too low, you could lock up the shoutcast server.

echo "enter a URL to stress test. ex:"
read URL
echo "enter number of threads to run. ex: 50"

for ((N=0; N<$THREADS; N++))
	do  curl -o /dev/null $URL >> /dev/null 2>&1 &
echo "Created "$THREADS" threads connected to "$URL
echo "Live Bandwidth"
echo "hit ctrl-c when you are finished" 
vnstat -l 
echo "Press any button and hit enter to kill all curl processes! Thanks!"
read Q
killall -e curl

If you have any questions please leave a comment below. Thanks

Here’s an example of the script in action.

enter a URL to stress test. ex:
enter number of threads to run. ex: 50
Created 1500 threads connected to
Live Bandwidth
hit ctrl-c when you are finished
Monitoring em0... (press CTRL-C to stop)

 rx: 50.45 Mbit/s 4514 p/s tx: 2.48 Mbit/s 4503 p/s

And bandwidth usage on the server

 rx: 4.14 Mbit/s 7706 p/s tx: 66.88 Mbit/s 8105 p/s

And what Shoutcast looks like with 1500+ connections:

shoutcast stress

There’s a few glitches (backspace might now work when entering stream URL), but I think its a good tool.

2 thoughts on “Stress testing Shoutcast Server

    1. will Post author

      If you can run curl from a Windows machine you can script a similar stress test. Or are you talking about stress testing a Windows shoutcast server?


Leave a Reply

Your email address will not be published. Required fields are marked *