Created
August 29, 2017 19:02
-
-
Save mondain/4d5f16d6b446d80f141270a09dd7e537 to your computer and use it in GitHub Desktop.
Chromium load test script
This file contains 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 | |
# maximum chromium instances to spawn | |
MAX_INSTANCES=50 | |
# the testing url to request, default page will use "stream1" | |
#TEST_URL='http://localhost:5080/webrtcexamples/test/subscribe/'' | |
#TEST_URL='http://webrtc.red5.org:5080/webrtcexamples/test/subscribe/' | |
#TEST_URL='https://webrtc.red5.org/live/viewer.jsp?host=webrtc.red5.org&stream=myStream' | |
TEST_URL='http://webrtc.red5.org:5080/live/viewer.jsp?host=webrtc.red5.org&stream=myStream' | |
# set the ulimit | |
ulimit -n 8192 | |
# create our null speaker for audio output / sink | |
pacmd load-module module-null-sink sink_name=nullspeaker | |
# set env var for our speaker that doesnt speak | |
export PULSE_SINK="nullspeaker" | |
# create n chromium instances and subscribe | |
for i in $( seq 1 $MAX_INSTANCES ); do | |
if [ $i -lt 10 ]; then | |
DPORT="900$i" | |
elif [ $i -lt 100 ]; then | |
DPORT="90$i" | |
elif [ $i -lt 1000 ]; then | |
DPORT="9$i" | |
fi | |
echo "Spawning $i with debugging port: $DPORT" | |
chromium-browser --user-data-dir=/tmp/chrome$(date +%s%N) --headless --disable-gpu --mute-audio --remote-debugging-port=$DPORT --window-size=1024,768 $TEST_URL > /dev/null & | |
#xvfb-run -a --server-args='-screen 0, 1024x768x16' chromium-browser "--user-data-dir=/tmp/chrome$(date +%s%N)" --headless --mute-audio --disable-gpu --start-maximized $TEST_URL > /dev/null & | |
sleep 3 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment