Skip to content

Instantly share code, notes, and snippets.

@softins
Created June 22, 2026 14:03
Show Gist options
  • Select an option

  • Save softins/15f2c51979cd3c75db4776ec62085177 to your computer and use it in GitHub Desktop.

Select an option

Save softins/15f2c51979cd3c75db4776ec62085177 to your computer and use it in GitHub Desktop.
Stress test Jamulus server with automated clients
#!/bin/bash
#set -x
case $# in
0) START=1; END=1 ;;
1) START=1; END=$1 ; shift ;;
2) START=$1; END=$2 ; shift; shift ;;
*) echo "unexpected argument" >&2 ; exit 1 ;;
esac
#echo CLIENTS=$CLIENTS
#exit
SERVER="31.134.204.77:22424"
function run_client {
local IDX=$1
local INI=$(mktemp)
for i in $(seq -f '%02.f' 0 99); do
NAME=$(echo -n "Test $IDX-$i" | base64)
echo "<client><name_base64>$NAME</name_base64></client>" >$INI
LOG=/tmp/jamulus-$$-$IDX-$i
TIM=$(( RANDOM % 15 + 3 ))
GAP=$(( RANDOM % 3 + 1 ))
echo $IDX-$i: TIM=$TIM GAP=$GAP
echo Starting $IDX-$i
timeout $TIM Jamulus -i $INI -c $SERVER -j -n >$LOG.log 2>$LOG.err
echo Finished $IDX-$i
sleep $GAP
done
rm $INI
}
for i in $(seq $START $END) ; do
run_client $i &
sleep 3
done
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment