From a29c097a5cec1ce9823d5b895b24758e8f1dac8e Mon Sep 17 00:00:00 2001 From: tormakris Date: Tue, 2 Apr 2019 22:18:13 +0200 Subject: [PATCH] benchmark script done --- functions/benchmark.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 functions/benchmark.sh diff --git a/functions/benchmark.sh b/functions/benchmark.sh new file mode 100644 index 0000000..b3f1d5c --- /dev/null +++ b/functions/benchmark.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +functions=(helloget matrix) + +connections=(2 5 10 20 21 50 100 200 400 500 1000) + +kuberhost="" + +for function in "${functions[@]}" +do + echo -e "Benchmarking $function\n" + for connection in "${connections[@]}" + do + if [[ $connection -lt 20 ]] + then + threads=$(($connection-1)) + else + threads=20 + fi + echo -e "Threads: $threads Connections $connection\n" + wrk -t$threads -d1m -c$connection -H"Host: $function.cucc" -H"Content-Type:application/json" --latency http://$kuberhost/$function > ./$function.$connection.txt 2>&1 + hey -n 10000 -c $connection -o csv -m GET -host "$function.cucc" -T "application/json" http://$kuberhost/$function > $function.$connection.csv + done +done \ No newline at end of file