Skip to content

Commit

Permalink
Updating the media-streaming benchmark (#359)
Browse files Browse the repository at this point in the history
* set the number of nginx workers

* update media-streaming client and its doc

* removed spell-check failed terms: NUM

* Ûfixed port allocation of httperf

* Add support for TLS encryption

* Support for TLS v1.3 is added

* typo is fixed

* update streaming doc

* Update media-streaming.md

* fix build problem of media-streaming dataset on riscv

* modify media-streaming dataset to control the number of sessions

* update media-streaming doc

* modify the printed stats for the streaming client

* update the streaming doc and fix a small bug in streaming client

* Fix a typo in streaming doc

* Fix another typo in the streaming doc

* Change the message

* Update media-streaming.md

* Update .wordlist.txt

* Update media-streaming.md

* Update media-streaming.md

Co-authored-by: Cyan Lin <[email protected]>
  • Loading branch information
aansaarii and xusine authored Sep 20, 2022
1 parent a9c6804 commit d9c7511
Show file tree
Hide file tree
Showing 19 changed files with 5,224 additions and 5,107 deletions.
5 changes: 5 additions & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Cloudsuite's
cmd
conf
cpufreq
cpus
cpuset
csv
datacenters
dataset
Expand All @@ -42,6 +44,7 @@ fb
filesystem
fpm
Gbit
GBs
github
GraphX
grouplens
Expand All @@ -60,6 +63,7 @@ localhost
login
MapReduce
masterdocker
Mbps
md
Mediawiki
memcache
Expand Down Expand Up @@ -115,6 +119,7 @@ UI
usertable
usr
uwsgi
videoperf
VM
VMs
WebServer
Expand Down
8 changes: 7 additions & 1 deletion benchmarks/media-streaming/client/files/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#!/bin/bash
set -e

# $1: the IP of the server
# $2: the number of httperf clients
# $3: the total number of sessions
# $4: the rate (sessions per seconds)
# $5: plain text or encrypted communication, possible values are "PT" and "TLS"

if [ "$1" = "bash" ]; then
exec $@
else
cd /root/run && exec ./benchmark.sh $1
cd /root/run && exec ./benchmark.sh $1 $2 $3 $4 $5
fi
24 changes: 13 additions & 11 deletions benchmarks/media-streaming/client/files/run/benchmark.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
#!/bin/bash

num_clients_per_machine=4
min_num_sessions=100
max_num_sessions=2000
server_ip=$1
num_clients_per_machine=${2:-4}
num_sessions=${3:-100}
rate=${4:-10}
mode=${5:-TLS}

streaming_client_dir=..
#server_ip=$(tail -n 1 hostlist.server)
server_ip=$1

peak_hunter/launch_hunt_bin.sh \
$server_ip \
hostlist.client \
$streaming_client_dir \
$num_clients_per_machine \
$min_num_sessions \
$max_num_sessions
peak_hunter/launch_hunt_bin.sh \
$server_ip \
hostlist.client \
$streaming_client_dir \
$num_clients_per_machine \
$num_sessions \
$rate \
$mode

./process_logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,23 @@ videoServerIp="$1"
hostFileName="$2"
remoteOutputPath="$3"
numClientsPerHost="$4"
totalNumSessions="$5"
rate="$6"
mode="$7"

totalMinNumSessions="$5"
totalMaxNumSessions="$6"

if [ $# -ne 6 ]; then
echo "Usage: launch_hunt_bin.sh <video_server_ip> <host_list_file> <remote_output_path> <num_clients_per_host> <min_num_sessions> <max_num_sessions>"
if [ $# -ne 7 ]; then
echo "Usage: launch_hunt_bin.sh <video_server_ip> <host_list_file> <remote_output_path> <num_clients_per_host> <total_num_sessions> <rate> <encryption_mode>"
exit
fi

# Distribute the load
numHosts=$(wc -l < $hostFileName)
numTotalClients=$[$numHosts*$numClientsPerHost]
minNumSessions=$[$totalMinNumSessions/$numTotalClients]
maxNumSessions=$[$totalMaxNumSessions/$numTotalClients]
NumSessions=$[$totalNumSessions/$numTotalClients]
rate=`echo "scale=2; $rate/$numTotalClients" | bc`

echo "Total clients = $numTotalClients"
echo "Minimum number of sessions = $minNumSessions"
echo "Maximum number of sessions = $maxNumSessions"

benchmarkSuccess=1
echo "Total number of sessions = $totalNumSessions"

outputDir="/output"
backUpStdoutDir="/output-stdout"
Expand All @@ -32,14 +29,12 @@ rm -rf "$outputDir/*" "$backUpStdoutDir"
mkdir -p "$outputDir" "$backUpStdoutDir"

# Launches remote with the specified number of sessions.
# Sets benchmarkSuccess to 1 or 0 depending on success/failure
function launchRemote () {
totalConns=0
totalErrors=0

numSessions="$1"
rate=$[numSessions/10]
$(dirname $0)/launch_remote.sh $videoServerIp $hostFileName $remoteOutputPath $numClientsPerHost $numSessions $rate
$(dirname $0)/launch_remote.sh $videoServerIp $hostFileName $remoteOutputPath $numClientsPerHost $numSessions $rate $mode
if [ $? -ne 0 ]; then
echo 'Failed launching remote... exiting.'
exit
Expand All @@ -59,58 +54,12 @@ function launchRemote () {
if [ "$percFailure" -gt 5 ]; then
cp $backUpStdoutDir/* $outputDir
sleep 10
benchmarkSuccess=0
else
cp $outputDir/* $backUpStdoutDir
benchmarkSuccess=1
fi
}

# Test for minNumSessions
launchRemote $minNumSessions

if [ $benchmarkSuccess -eq 0 ]
then
echo "Benchmark failed for $minNumSessions sessions"
echo "Minimum Limit for number of sessions too high."
exit 0
else
echo "Benchmark succeeded for $minNumSessions sessions"
fi


# Test for maxNumSessions
launchRemote $maxNumSessions
# Test for NumSessions
launchRemote $NumSessions

if [ $benchmarkSuccess -eq 1 ]
then
echo "Benchmark succeeded for $maxNumSessions sessions"
echo "Maximum limit for number of sessions too low."
exit 0
else
echo "Benchmark failed for $maxNumSessions sessions"
fi

lowLimSessions=$minNumSessions
hiLimSessions=$maxNumSessions

# Launch binary search
while :
do
diff=$[maxNumSessions-minNumSessions]
if [ $diff -le 50 ]
then
maxThroughput=$[$numSessions*$numTotalClients]
# echo "Benchmark succeeded for maximum sessions: $maxThroughput"
exit 0
fi
delta=$[(maxNumSessions-minNumSessions)/2]
numSessions=$[minNumSessions+delta]
launchRemote $numSessions
if [ "$benchmarkSuccess" -eq 0 ]
then
maxNumSessions=$numSessions
else
minNumSessions=$numSessions
fi
done
exit 0
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ remoteOutputPath="$3"
numClientsPerHost="$4"
numSessions="$5"
rate="$6"
mode="$7"

if [ $# -ne 6 ]; then
echo "Usage: launch_hunt_bin.sh <video_server_ip> <host_list_file> <remote_output_path> <num_clients_per_host> <num_sessions> <rate>"
if [ $# -ne 7 ]; then
echo "Usage: launch_remote.sh <video_server_ip> <host_list_file> <remote_output_path> <num_clients_per_host> <num_sessions> <rate> <encryption_mode>"
exit
fi

if [ $mode = "PT" ];then
mode="--port 80"
elif [ $mode = "TLS" ]; then
mode="--ssl --port 443"
else
echo "invalid encryption mode flag"
exit
fi

# TODO: this needs to be fixed - need static correspondence between log, ratio, and ip
logs=$(echo /videos/logs/cl* | sed -e 's/ /,/g')
Expand All @@ -25,7 +34,7 @@ do
echo "Launching $numClientsPerHost clients on $host";
for i in $(seq 1 $numClientsPerHost)
do
cmd="httperf --hog --server $videoServerIp --videosesslog=[$logs],[0.1,0.3,0.4,0.2],[localhost,localhost,localhost,localhost] --epoll --recv-buffer=524288 --port 80 --output-log=/output/result$i.log --num-sessions=$numSessions --rate=$rate 2>>/output/bt$i.trace" # > output-stdout/stdout$i"
cmd="httperf --hog --server $videoServerIp --videosesslog=[$logs],[0.1,0.3,0.4,0.2],[localhost,localhost,localhost,localhost] --epoll --recv-buffer=524288 $mode --output-log=/output/result$i.log --num-sessions=$numSessions --rate=$rate 2>>/output/bt$i.trace" # > output-stdout/stdout$i"
echo "Running command $cmd"
eval $cmd &
done
Expand Down
Loading

0 comments on commit d9c7511

Please sign in to comment.