loadtest all the things

This commit is contained in:
Torma Kristóf 2019-10-29 12:52:55 +01:00
parent 0282b61ab4
commit 350f077ca4
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

@ -9,6 +9,8 @@ connections=(45)
times=(30s) times=(30s)
kuberhost="node1:31299" kuberhost="node1:31299"
maxthreads=40 maxthreads=40
kubeless=true
rps=500
#Wave mode configuration #Wave mode configuration
wave_connection=40 wave_connection=40
wave_max_conn=160 wave_max_conn=160
@ -16,11 +18,8 @@ wave_min_conn=40
wave_time="30s" wave_time="30s"
wave_loop_max=2 wave_loop_max=2
#Climb mode configuration #Climb mode configuration
climb_max=300 climb_max=10
climb_connection=30 climb=1
kubeless=true
#Loadtest specific fonguration
loadtest_rps=1000
HEY_INSTALLED=$(command -v hey) HEY_INSTALLED=$(command -v hey)
if [[ $HEY_INSTALLED = "" ]] if [[ $HEY_INSTALLED = "" ]]
@ -64,9 +63,9 @@ do
echo -e "Running" echo -e "Running"
if $kubeless; if $kubeless;
then then
hey -c $wave_connection -z $wave_time -m POST -o csv -host "$function.kubeless" -D "$function_friendly".body -T "application/json" http://$kuberhost/"$function" > ./data/"$function"."$wave_num".wave.csv hey -c $wave_connection -q $rps -z $wave_time -m POST -o csv -host "$function.kubeless" -D "$function_friendly".body -T "application/json" http://$kuberhost/"$function" > ./data/"$function"."$wave_num".wave.csv
else else
hey -c $wave_connection -z $wave_time -m POST -o csv -host "$function.default.example.com" http://$kuberhost/ > ./data/"$function"."$wave_num".wave.csv hey -c $wave_connection -q $rps -z $wave_time -m POST -o csv -host "$function.default.example.com" http://$kuberhost/ > ./data/"$function"."$wave_num".wave.csv
fi fi
wave_num=$((wave_num + 1)) wave_num=$((wave_num + 1))
if $wave_dir_up if $wave_dir_up
@ -112,16 +111,16 @@ do
then then
if [[ $* = *"--loadtest"* ]] if [[ $* = *"--loadtest"* ]]
then then
loadtest -H "Host: $function.kubeless" --rps $leadtest_rps -c $connection -t $time -p "$function_firendly".body http://$kuberhost/"$function" > ./data/"$function"."$connection"."$time"."$datetime".txt loadtest -H "Host: $function.kubeless" --rps $rps -c $connection -t $time -p "$function_firendly".body http://$kuberhost/"$function" > ./data/"$function"."$connection"."$time"."$datetime".txt
else else
hey -c "$connection" -z "$time" -m POST -host "$function.kubeless" -D "$function_firendly".body -T "application/json" http://$kuberhost/"$function" > ./data/"$function"."$connection"."$time"."$datetime".txt hey -c "$connection" -q $rps -z "$time" -m POST -host "$function.kubeless" -D "$function_firendly".body -T "application/json" http://$kuberhost/"$function" > ./data/"$function"."$connection"."$time"."$datetime".txt
fi fi
else else
if [[ $* = *"--loadtest"* ]] if [[ $* = *"--loadtest"* ]]
then then
loadtest -H "Host: $function.default.example.com" --rps $leadtest_rps -c $connection -t $time http://$kuberhost/ > ./data/"$function"."$connection"."$time"."$datetime".txt loadtest -H "Host: $function.default.example.com" --rps $rps -c $connection -t $time http://$kuberhost/ > ./data/"$function"."$connection"."$time"."$datetime".txt
else else
hey -c "$connection" -z "$time" -m POST -host "$function.default.example.com" http://$kuberhost/ > ./data/"$function"."$connection"."$time"."$datetime".txt hey -c "$connection" -q $rps -z "$time" -m POST -host "$function.default.example.com" http://$kuberhost/ > ./data/"$function"."$connection"."$time"."$datetime".txt
fi fi
fi fi
fi fi
@ -142,9 +141,19 @@ do
echo -e "hey-for $num\n" echo -e "hey-for $num\n"
if $kubeless; if $kubeless;
then then
hey -c "$connection" -z "$time" -m POST -o csv -host "$function.kubeless" -D "$function_friendly".body -T "application/json" http://$kuberhost/"$function" > ./data/"$function"."$num".csv if [[ $* = *"--loadtest"* ]]
then
loadtest -H "Host: $function.kubeless" --rps $rps -c $connection -t $time -p "$function_firendly".body http://$kuberhost/"$function" > ./data/"$function"."$num".txt
else else
hey -c "$connection" -z "$time" -m POST -o csv -host "$function.default.example.com" http://$kuberhost/ > ./data/"$function"."$num".for.csv hey -c "$connection" -q $rps -z "$time" -m POST -o csv -host "$function.kubeless" -D "$function_friendly".body -T "application/json" http://$kuberhost/"$function" > ./data/"$function"."$num".csv
fi
else
if [[ $* = *"--loadtest"* ]]
then
loadtest -H "Host: $function.default.example.com" --rps $rps -c $connection -t $time http://$kuberhost/ > ./data/"$function"."$num".for.csv
else
hey -c "$connection" -q $rps -z "$time" -m POST -o csv -host "$function.default.example.com" http://$kuberhost/ > ./data/"$function"."$num".for.csv
fi
fi fi
done done
fi fi
@ -153,15 +162,26 @@ do
fi fi
if [[ $* = *"--climb"* ]] if [[ $* = *"--climb"* ]]
then then
while [[ $climb_connection -lt $climb_max ]]; do while [[ $climb -lt $climb_max ]]; do
climb_rps=$((rps * climb))
echo -e "Connections: $climb_connection" echo -e "Connections: $climb_connection"
if $kubeless; if $kubeless;
then then
hey -c $climb_connection -z $time -m POST -o csv -host "$function.kubeless" -D "$function_friendly".body -T "application/json" http://$kuberhost/"$function" > ./data/"$function"."$climb_connection".climb.csv if [[ $* = *"--loadtest"* ]]
then
loadtest -H "Host: $function.kubeless" --rps $climb_rps -c 1 -t $time -p "$function_firendly".body http://$kuberhost/"$function" > ./data/"$function"."$climb_connection".climb.txt
else else
hey -c $climb_connection -z $time -m POST -o csv -host "$function.default.example.com" http://$kuberhost/ > ./data/"$function"."$climb_connection".climb.csv hey -c 1 -q $climb_rps -z $time -m POST -o csv -host "$function.kubeless" -D "$function_friendly".body -T "application/json" http://$kuberhost/"$function" > ./data/"$function"."$climb_connection".climb.csv
fi fi
climb_connection=$((climb_connection + 10)) else
if [[ $* = *"--loadtest"* ]]
then
loadtest -H "Host: $function.default.example.com" --rps $climb_rps -c 1 -t $time http://$kuberhost/ > ./data/"$function"."$climb_connection".climb.txt
else
hey -c 1 -q $climb_rps -z $time -m POST -o csv -host "$function.default.example.com" http://$kuberhost/ > ./data/"$function"."$climb_connection".climb.csv
fi
fi
climb=$((climb + 1))
done done
fi fi
echo -e "Finished at $datetime" echo -e "Finished at $datetime"