Created
June 22, 2026 14:03
-
-
Save softins/15f2c51979cd3c75db4776ec62085177 to your computer and use it in GitHub Desktop.
Stress test Jamulus server with automated clients
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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