mirror of
https://github.com/nclabteam/THPA.git
synced 2025-02-12 10:31:54 +00:00
- Add scripts and manual for evaluation sections
This commit is contained in:
parent
b8bdef8213
commit
7d3d945436
10 changed files with 328 additions and 1 deletions
|
@ -1,6 +1,12 @@
|
||||||
Since THPA comprises of 2 components custom kube-controller-manager and scheduler-extender so
|
Since THPA comprises of 2 components custom kube-controller-manager and scheduler-extender so
|
||||||
we need to modify these:
|
we need to modify these:
|
||||||
|
|
||||||
|
*** Collecting nodes traffic ***
|
||||||
|
|
||||||
|
- Copy kube-proxy binary file in kube-proxy directory to /usr/local/bin/ in kube-proxy container running on each node and then reset it.
|
||||||
|
|
||||||
|
- Check that enpoint is created on each node whenever new deployment is created to make sure we configure correctly.
|
||||||
|
|
||||||
*** set nodes label ***
|
*** set nodes label ***
|
||||||
|
|
||||||
- For worker nodes, set the following label to them: node-role.kubernetes.io/worker=true
|
- For worker nodes, set the following label to them: node-role.kubernetes.io/worker=true
|
||||||
|
@ -9,7 +15,7 @@ we need to modify these:
|
||||||
|
|
||||||
- cd to kube-controller-manager directory.
|
- cd to kube-controller-manager directory.
|
||||||
|
|
||||||
- Copy binary file "kube-controller-manager" to home directory.
|
- Unzip and copy binary file "kube-controller-manager" to home directory.
|
||||||
|
|
||||||
- Copy kube-controller-manager.yaml to /etc/kubernetes/manifests/
|
- Copy kube-controller-manager.yaml to /etc/kubernetes/manifests/
|
||||||
|
|
||||||
|
|
19
add_delay.sh
Executable file
19
add_delay.sh
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#example: ./add_delay_rule.sh 10.244.1.0 10.244.3.0 5
|
||||||
|
|
||||||
|
ip1=$1
|
||||||
|
ip2=$2
|
||||||
|
delay1=$3
|
||||||
|
delay2=$4
|
||||||
|
dis=1 #echo $delay/5 | bc`
|
||||||
|
echo "ip1 = $ip1, ip2 = $ip2, delay1 = $delay1, delay2 = $delay2, dis = $dis"
|
||||||
|
#echo "ip1 = $ip1, delay = $delay, dis = $dis"
|
||||||
|
|
||||||
|
sudo tc qdisc del dev flannel.1 root
|
||||||
|
#sudo tc qdisc add dev flannel.1 root handle 1: prio
|
||||||
|
sudo tc qdisc add dev flannel.1 root handle 1: prio priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||||
|
sudo tc qdisc add dev flannel.1 parent 1:2 handle 20: netem delay ${delay1}ms ${dis}ms distribution normal
|
||||||
|
sudo tc qdisc add dev flannel.1 parent 1:3 handle 30: netem delay ${delay2}ms ${dis}ms distribution normal
|
||||||
|
sudo tc filter add dev flannel.1 protocol ip parent 1:0 u32 match ip dst $ip1/24 flowid 1:2
|
||||||
|
sudo tc filter add dev flannel.1 protocol ip parent 1:0 u32 match ip dst $ip2/24 flowid 1:3
|
73
experimental-scripts/sectionV_A/auto_hey_test_all_notEqualTraffic
Executable file
73
experimental-scripts/sectionV_A/auto_hey_test_all_notEqualTraffic
Executable file
|
@ -0,0 +1,73 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# send to ip address of worker node 2
|
||||||
|
#con=$1 # number of concurrency requests
|
||||||
|
duration=$1
|
||||||
|
numOfRequest=$2
|
||||||
|
Port=$3
|
||||||
|
con1=$4
|
||||||
|
con2=$5
|
||||||
|
con3=$6
|
||||||
|
HOSTNAMES=("node1" "node2" "node3")
|
||||||
|
|
||||||
|
./cleanLog
|
||||||
|
|
||||||
|
if [[ $con1 -gt 0 ]]
|
||||||
|
then
|
||||||
|
count=0
|
||||||
|
echo "test node1"
|
||||||
|
while [ $count -lt $con1 ]
|
||||||
|
do
|
||||||
|
echo "Thread: $count"
|
||||||
|
hey -c 1 -z $duration's' -q 16 -n $numOfRequest -disable-keepalive http://node1:$Port/ > heytestNode1_${count}.log &
|
||||||
|
count=$((count+1))
|
||||||
|
done
|
||||||
|
#hey -c $con1 -z $duration -q 60 -n 50000 http://node1:$Port/ > heytestNode1_load &
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $con2 -gt 0 ]]
|
||||||
|
then
|
||||||
|
count=0
|
||||||
|
echo "test node2"
|
||||||
|
while [ $count -lt $con2 ]
|
||||||
|
do
|
||||||
|
echo "Thread: $count"
|
||||||
|
hey -c 1 -z $duration's' -q 16 -n $numOfRequest -disable-keepalive http://node2:$Port/ > heytestNode2_${count}.log &
|
||||||
|
count=$((count+1))
|
||||||
|
done
|
||||||
|
#hey -c $con2 -z $duration -q 60 -n 50000 http://node2:$Port/ > heytestNode2_load &
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $con3 -gt 0 ]]
|
||||||
|
then
|
||||||
|
count=0
|
||||||
|
echo "test node3"
|
||||||
|
while [ $count -lt $con3 ]
|
||||||
|
do
|
||||||
|
echo "Thread: $count"
|
||||||
|
hey -c 1 -z $duration's' -q 16 -n $numOfRequest -disable-keepalive http://node3:$Port/ > heytestNode3_${count}.log &
|
||||||
|
count=$((count+1))
|
||||||
|
done
|
||||||
|
#hey -c $con3 -z $duration -q 60 -n 50000 http://node3:$Port/ > heytestNode3_load &
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Performing test"
|
||||||
|
sleep $duration
|
||||||
|
echo "Done"
|
||||||
|
|
||||||
|
#rm -rf ${con1}_${con2}_${con3}_test
|
||||||
|
#touch ${con1}_${con2}_${con3}_test
|
||||||
|
|
||||||
|
#CPU=$(kubectl get hpa | awk '{print $3}' | tail -n +2 | cut -d'/' -f 1 | cut -d'%' -f 1)
|
||||||
|
|
||||||
|
#while $CPU -gt 10
|
||||||
|
#do
|
||||||
|
# CPU=$(kubectl get hpa | awk '{print $3}' | tail -n +2 | cut -d'/' -f 1 | cut -d'%' -f 1)
|
||||||
|
# sleep 2
|
||||||
|
#done
|
||||||
|
|
||||||
|
#currentReplicas=$(kubectl get hpa | awk '{print $6}' | tail -n +2)
|
||||||
|
|
||||||
|
#echo "$currentReplicas $con1:$con2:$con3 $currentReplicas $(kubectl get pods -o wide | grep -c "node1"):$(kubectl get pods -o wide | grep -c "node2"):$(kubectl get pods -o wide | grep -c "node3")" > ${con1}_${con2}_${con3}_test
|
||||||
|
|
||||||
|
|
13
experimental-scripts/sectionV_A/autoscling_realTime_test
Executable file
13
experimental-scripts/sectionV_A/autoscling_realTime_test
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
echo "Begin"
|
||||||
|
echo "1-1-1"
|
||||||
|
./auto_hey_test_all_notEqualTraffic 30 100000 30009 1 1 1
|
||||||
|
echo "8-8-8"
|
||||||
|
./auto_hey_test_all_notEqualTraffic 120 100000 30009 8 8 8
|
||||||
|
echo "8-0-0"
|
||||||
|
./auto_hey_test_all_notEqualTraffic 420 100000 30009 8 0 0
|
||||||
|
echo "1-1-1"
|
||||||
|
./auto_hey_test_all_notEqualTraffic 420 100000 30009 1 1 1
|
||||||
|
echo "finish"
|
44
experimental-scripts/sectionV_B/auto_ab_eva_node
Executable file
44
experimental-scripts/sectionV_B/auto_ab_eva_node
Executable file
|
@ -0,0 +1,44 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#con=$1 # number of concurrency requests
|
||||||
|
duration=60
|
||||||
|
numOfRequest=50000
|
||||||
|
ipWithPort=$1
|
||||||
|
eva_case=$2
|
||||||
|
|
||||||
|
rm eva_$eva_case
|
||||||
|
touch eva_$eva_case
|
||||||
|
|
||||||
|
for i in 3 6 9 12
|
||||||
|
|
||||||
|
do
|
||||||
|
rm log_test_send_$i
|
||||||
|
ab -c $i -t $duration -n $numOfRequest http://$ipWithPort/ > log_test_send_$i
|
||||||
|
sleep 40
|
||||||
|
done
|
||||||
|
|
||||||
|
for i in 3 6 9 8 12
|
||||||
|
|
||||||
|
do
|
||||||
|
|
||||||
|
sum=0
|
||||||
|
sum_mean=0
|
||||||
|
sum_sd=0
|
||||||
|
nr=`cat log_test_send_$i | grep "Requests per second" | sed 's/[^0-9.]*//g'`
|
||||||
|
|
||||||
|
sum=`echo $sum + $nr | bc`
|
||||||
|
|
||||||
|
totaltime=`cat log_test_send_$i | grep "Total:"`
|
||||||
|
|
||||||
|
mean=`echo $totaltime | awk '{print $3}'`
|
||||||
|
|
||||||
|
sum_mean=`echo $sum_mean + $mean | bc`
|
||||||
|
|
||||||
|
sd=`echo $totaltime | awk '{print $4}'`
|
||||||
|
|
||||||
|
sum_sd=`echo $sum_sd + $sd | bc`
|
||||||
|
|
||||||
|
|
||||||
|
echo "${sum} ${sum_mean} ${sum_sd}" >> eva_$eva_case
|
||||||
|
done
|
||||||
|
|
44
experimental-scripts/sectionV_C_1/auto_ab_eva_node
Executable file
44
experimental-scripts/sectionV_C_1/auto_ab_eva_node
Executable file
|
@ -0,0 +1,44 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#con=$1 # number of concurrency requests
|
||||||
|
duration=60
|
||||||
|
numOfRequest=50000
|
||||||
|
ipWithPort=$1
|
||||||
|
eva_case=$2
|
||||||
|
|
||||||
|
rm eva_$eva_case
|
||||||
|
touch eva_$eva_case
|
||||||
|
|
||||||
|
for i in 3 6 9 12
|
||||||
|
|
||||||
|
do
|
||||||
|
rm log_test_send_$i
|
||||||
|
ab -c $i -t $duration -n $numOfRequest http://$ipWithPort/ > log_test_send_$i
|
||||||
|
sleep 40
|
||||||
|
done
|
||||||
|
|
||||||
|
for i in 3 6 9 8 12
|
||||||
|
|
||||||
|
do
|
||||||
|
|
||||||
|
sum=0
|
||||||
|
sum_mean=0
|
||||||
|
sum_sd=0
|
||||||
|
nr=`cat log_test_send_$i | grep "Requests per second" | sed 's/[^0-9.]*//g'`
|
||||||
|
|
||||||
|
sum=`echo $sum + $nr | bc`
|
||||||
|
|
||||||
|
totaltime=`cat log_test_send_$i | grep "Total:"`
|
||||||
|
|
||||||
|
mean=`echo $totaltime | awk '{print $3}'`
|
||||||
|
|
||||||
|
sum_mean=`echo $sum_mean + $mean | bc`
|
||||||
|
|
||||||
|
sd=`echo $totaltime | awk '{print $4}'`
|
||||||
|
|
||||||
|
sum_sd=`echo $sum_sd + $sd | bc`
|
||||||
|
|
||||||
|
|
||||||
|
echo "${sum} ${sum_mean} ${sum_sd}" >> eva_$eva_case
|
||||||
|
done
|
||||||
|
|
49
experimental-scripts/sectionV_C_2/ab_test_cummulative_diff
Executable file
49
experimental-scripts/sectionV_C_2/ab_test_cummulative_diff
Executable file
|
@ -0,0 +1,49 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# send to ip address of worker node 2
|
||||||
|
#con=$1 # number of concurrency requests
|
||||||
|
duration=60
|
||||||
|
numOfRequest=50000
|
||||||
|
Port=$1
|
||||||
|
con1=$2
|
||||||
|
con2=$3
|
||||||
|
con3=$4
|
||||||
|
eva_case=$5
|
||||||
|
HOSTNAMES=("node1" "node2" "node3")
|
||||||
|
|
||||||
|
rm eva_all_notEqualTraffic_$eva_case
|
||||||
|
touch eva_all_notEqualTraffic_$eva_case
|
||||||
|
|
||||||
|
rm log_node1
|
||||||
|
rm log_node2
|
||||||
|
rm log_node3
|
||||||
|
|
||||||
|
ab -c $con1 -t $duration -n $numOfRequest http://node1:$Port/ > log_node1 &
|
||||||
|
ab -c $con2 -t $duration -n $numOfRequest http://node2:$Port/ > log_node2 &
|
||||||
|
ab -c $con3 -t $duration -n $numOfRequest http://node3:$Port/ > log_node3 &
|
||||||
|
|
||||||
|
sleep 70
|
||||||
|
|
||||||
|
for HOST in ${HOSTNAMES[@]}
|
||||||
|
do
|
||||||
|
|
||||||
|
sum=0
|
||||||
|
sum_mean=0
|
||||||
|
sum_sd=0
|
||||||
|
nr=`cat log_$HOST | grep "Requests per second" | sed 's/[^0-9.]*//g'`
|
||||||
|
|
||||||
|
sum=`echo $sum + $nr | bc`
|
||||||
|
|
||||||
|
totaltime=`cat log_$HOST | grep "Total:"`
|
||||||
|
|
||||||
|
mean=`echo $totaltime | awk '{print $3}'`
|
||||||
|
|
||||||
|
sum_mean=`echo $sum_mean + $mean | bc`
|
||||||
|
|
||||||
|
sd=`echo $totaltime | awk '{print $4}'`
|
||||||
|
|
||||||
|
sum_sd=`echo $sum_sd + $sd | bc`
|
||||||
|
|
||||||
|
echo "$HOST ${sum} ${sum_mean} ${sum_sd}" >> eva_all_notEqualTraffic_$eva_case
|
||||||
|
done
|
||||||
|
|
45
experimental-scripts/sectionV_C_2/ab_test_cummulative_even
Executable file
45
experimental-scripts/sectionV_C_2/ab_test_cummulative_even
Executable file
|
@ -0,0 +1,45 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# send to ip address of worker node 2
|
||||||
|
#con=$1 # number of concurrency requests
|
||||||
|
duration=60
|
||||||
|
numOfRequest=50000
|
||||||
|
Port=$1
|
||||||
|
con=$2
|
||||||
|
eva_case=$3
|
||||||
|
HOSTNAMES=("node1" "node2" "node3")
|
||||||
|
|
||||||
|
rm eva_all_$eva_case
|
||||||
|
touch eva_all_$eva_case
|
||||||
|
|
||||||
|
for HOST in ${HOSTNAMES[@]}
|
||||||
|
do
|
||||||
|
echo $HOST
|
||||||
|
rm log_$HOST
|
||||||
|
ab -c $con -t $duration -n $numOfRequest http://$HOST:$Port/ > log_$HOST &
|
||||||
|
done
|
||||||
|
|
||||||
|
sleep 70
|
||||||
|
|
||||||
|
for HOST in ${HOSTNAMES[@]}
|
||||||
|
do
|
||||||
|
|
||||||
|
sum=0
|
||||||
|
sum_mean=0
|
||||||
|
sum_sd=0
|
||||||
|
nr=`cat log_$HOST | grep "Requests per second" | sed 's/[^0-9.]*//g'`
|
||||||
|
|
||||||
|
sum=`echo $sum + $nr | bc`
|
||||||
|
|
||||||
|
totaltime=`cat log_$HOST | grep "Total:"`
|
||||||
|
|
||||||
|
mean=`echo $totaltime | awk '{print $3}'`
|
||||||
|
|
||||||
|
sum_mean=`echo $sum_mean + $mean | bc`
|
||||||
|
|
||||||
|
sd=`echo $totaltime | awk '{print $4}'`
|
||||||
|
|
||||||
|
sum_sd=`echo $sum_sd + $sd | bc`
|
||||||
|
|
||||||
|
echo "$HOST ${sum} ${sum_mean} ${sum_sd}" >> eva_all_$eva_case
|
||||||
|
done
|
34
experimental_setup.txt
Normal file
34
experimental_setup.txt
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
- Experimental set up:
|
||||||
|
|
||||||
|
+ Machines specs: as mentioned in THPA paper.
|
||||||
|
|
||||||
|
+ Kubernetes version: 1.18.0
|
||||||
|
|
||||||
|
+ Docker version: 19.03.13
|
||||||
|
|
||||||
|
+ Round trip delay between node = 10ms.
|
||||||
|
+ Execute "add_delay.sh" script to add delay between nodes:
|
||||||
|
+ ./add_delay.sh <node1_ip> <node2_ip> <delay_value>
|
||||||
|
Ex: ./add_delay.sh 192.168.1.2 192.168.1.19 5 (delay between 2 nodes is 10ms Round trip)
|
||||||
|
|
||||||
|
+ Apache tool should be installed for traffic generation
|
||||||
|
|
||||||
|
+ Switch kube-proxy to ipvs mode
|
||||||
|
|
||||||
|
|
||||||
|
- Section V_A - Evaluate 3 nodes
|
||||||
|
|
||||||
|
+ Use script "autoscaling_realTime_test" in experimental-script to test and get the result
|
||||||
|
|
||||||
|
- Section V_B - Evaluate 3 node
|
||||||
|
|
||||||
|
+ Use script "auto_ab_eva_node" in experimental-scripts/sectionV_B to generate traffic toward 3 nodes at the same time and get the results.
|
||||||
|
|
||||||
|
- Section V_C-1 - In this evaluation only Node 1 is evaluated
|
||||||
|
|
||||||
|
+ Use script "auto_ab_eva_node" in experimental-scripts/sectionV_C_1 to generate traffic toward node 1 only to get the result.
|
||||||
|
|
||||||
|
- Section V_C_2 - Evaluate 3 nodes
|
||||||
|
|
||||||
|
+ Use script "ab_test_cummulative_diff" and "ab_test_cummulative_even" in
|
||||||
|
experimental-scripts/sectionV_C_2 folder to get the result
|
BIN
kube-proxy/kube-proxy
Executable file
BIN
kube-proxy/kube-proxy
Executable file
Binary file not shown.
Loading…
Reference in a new issue