Update benchmark.sh
This commit is contained in:
parent
db398d09d5
commit
20a2fd03d0
@ -6,7 +6,6 @@ times=(1m)
|
|||||||
kuberhost="node1:30765"
|
kuberhost="node1:30765"
|
||||||
maxthreads=40
|
maxthreads=40
|
||||||
|
|
||||||
wave_function=isprime
|
|
||||||
wave_dir_up=true
|
wave_dir_up=true
|
||||||
wave_connection=40
|
wave_connection=40
|
||||||
wave_max_conn=1600
|
wave_max_conn=1600
|
||||||
@ -33,61 +32,61 @@ then
|
|||||||
cp "$HOME"/go/bin/hey /usr/local/bin
|
cp "$HOME"/go/bin/hey /usr/local/bin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $* = *"--wave"* ]]
|
|
||||||
then
|
|
||||||
while true; do
|
|
||||||
now=$(date '+%Y-%m-%d-%H-%M')
|
|
||||||
echo -e "Running"
|
|
||||||
hey -c $wave_connection -z $wave_time -m POST -o csv -host "$wave_function.kubeless" -D "$wave_function".body -T "application/json" http://$kuberhost/"$wave_function" > ./"$wave_function"."$now".wave.txt
|
|
||||||
echo -e "Sleeping"
|
|
||||||
sleep $wave_time
|
|
||||||
if [[ $wave_dir_up ]]
|
|
||||||
then
|
|
||||||
if [[ $wave_connection -lt $wave_max_conn ]]
|
|
||||||
then
|
|
||||||
wave_connection=$((wave_connection * 2))
|
|
||||||
else
|
|
||||||
wave_dir_up=false
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
if [[ $wave_connection -gt $wave_min_conn ]]
|
|
||||||
then
|
|
||||||
wave_connection=$((wave_connection / 2))
|
|
||||||
else
|
|
||||||
wave_dir_up=true
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
else
|
|
||||||
echo -e "Benchmarking functions\n"
|
echo -e "Benchmarking functions\n"
|
||||||
for function in "${functions[@]}"
|
for function in "${functions[@]}"
|
||||||
do
|
do
|
||||||
echo -e "Benchmarking $function\n"
|
if [[ $* = *"--wave"* ]]
|
||||||
echo -e "Output of $function is:\n"
|
then
|
||||||
perl -pi -e 'chomp if eof' "$function".body
|
while true; do
|
||||||
curl --data-binary @"$function".body --header "Host: $function.kubeless" --header "Content-Type:application/json" http://$kuberhost/"$function"
|
now=$(date '+%Y-%m-%d-%H-%M')
|
||||||
echo -e "\n"
|
echo -e "Running"
|
||||||
for connection in "${connections[@]}"
|
hey -c $wave_connection -z $wave_time -m POST -o csv -host "$function.kubeless" -D "$function".body -T "application/json" http://$kuberhost/"$function" > ./"$function"."$now".wave.txt
|
||||||
do
|
echo -e "Sleeping"
|
||||||
if [[ $connection -lt $((maxthreads + 1)) ]]
|
sleep $wave_time
|
||||||
then
|
if [[ $wave_dir_up ]]
|
||||||
threads=$((connection-1))
|
then
|
||||||
else
|
if [[ $wave_connection -lt $wave_max_conn ]]
|
||||||
threads=$maxthreads
|
then
|
||||||
fi
|
wave_connection=$((wave_connection * 2))
|
||||||
echo -e "Threads: $threads Connections $connection\n"
|
else
|
||||||
for time in "${times[@]}"
|
wave_dir_up=false
|
||||||
do
|
fi
|
||||||
datetime=$(date '+%Y-%m-%d-%H-%M-%S')
|
else
|
||||||
echo -e "Time: $time\n"
|
if [[ $wave_connection -gt $wave_min_conn ]]
|
||||||
echo -e "wrk\n"
|
then
|
||||||
wrk -t$threads -c"$connection" -d"$time" -s"$function".wrk -H"Host: $function.kubeless" -H"Content-Type:application/json" --latency http://$kuberhost/"$function" > ./"$function"."$connection"."$time"."$datetime".wrk.txt 2>&1
|
wave_connection=$((wave_connection / 2))
|
||||||
echo -e "hey-summary\n"
|
else
|
||||||
hey -c "$connection" -z "$time" -m POST -host "$function.kubeless" -D "$function".body -T "application/json" http://$kuberhost/"$function" > ./"$function"."$connection"."$time"."$datetime".hey.txt
|
wave_dir_up=true
|
||||||
echo -e "hey-csv\n"
|
fi
|
||||||
hey -c "$connection" -z "$time" -m POST -o csv -host "$function.kubeless" -D "$function".body -T "application/json" http://$kuberhost/"$function" > ./"$function"."$connection"."$time"."$datetime".csv
|
fi
|
||||||
echo -e "$datetime"
|
|
||||||
done
|
done
|
||||||
done
|
else
|
||||||
|
echo -e "Benchmarking $function\n"
|
||||||
|
echo -e "Output of $function is:\n"
|
||||||
|
perl -pi -e 'chomp if eof' "$function".body
|
||||||
|
curl --data-binary @"$function".body --header "Host: $function.kubeless" --header "Content-Type:application/json" http://$kuberhost/"$function"
|
||||||
|
echo -e "\n"
|
||||||
|
for connection in "${connections[@]}"
|
||||||
|
do
|
||||||
|
if [[ $connection -lt $((maxthreads + 1)) ]]
|
||||||
|
then
|
||||||
|
threads=$((connection-1))
|
||||||
|
else
|
||||||
|
threads=$maxthreads
|
||||||
|
fi
|
||||||
|
echo -e "Threads: $threads Connections $connection\n"
|
||||||
|
for time in "${times[@]}"
|
||||||
|
do
|
||||||
|
datetime=$(date '+%Y-%m-%d-%H-%M-%S')
|
||||||
|
echo -e "Time: $time\n"
|
||||||
|
echo -e "wrk\n"
|
||||||
|
wrk -t$threads -c"$connection" -d"$time" -s"$function".wrk -H"Host: $function.kubeless" -H"Content-Type:application/json" --latency http://$kuberhost/"$function" > ./"$function"."$connection"."$time"."$datetime".wrk.txt 2>&1
|
||||||
|
echo -e "hey-summary\n"
|
||||||
|
hey -c "$connection" -z "$time" -m POST -host "$function.kubeless" -D "$function".body -T "application/json" http://$kuberhost/"$function" > ./"$function"."$connection"."$time"."$datetime".hey.txt
|
||||||
|
echo -e "hey-csv\n"
|
||||||
|
hey -c "$connection" -z "$time" -m POST -o csv -host "$function.kubeless" -D "$function".body -T "application/json" http://$kuberhost/"$function" > ./"$function"."$connection"."$time"."$datetime".csv
|
||||||
|
echo -e "$datetime"
|
||||||
|
done
|
||||||
|
done
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
fi
|
|
||||||
|
Loading…
Reference in New Issue
Block a user