main
hwwang 3 months ago
parent 8db8516501
commit 1b4dec9a5f

@ -0,0 +1,63 @@
#!/bin/bash
function usage {
echo "$0 [aad step] [first_rps] [max_rps]"
exit 1
}
if [ $# != 3 ] ; then
usage
exit 1;
fi
step=$1
current_rps=$2
max_rps=$3
chmod 400 ./id_rsa
path="/home/weihao/sledge/sledge_tree/runtime/tests"
last_actual_rps=0
first_run=true
while [ $current_rps -le $max_rps ]
do
echo "Testing with RPS: $current_rps"
server_log_file="test_max_rps.log"
f1="105k_"$current_rps".txt"
f2="305k_"$current_rps".txt"
f3="5k_"$current_rps".txt"
f4="40k_"$current_rps".txt"
$path/start.sh $server_log_file >/dev/null 2>&1 &
echo "sledge is running"
./test_rps.sh $f1 30 $current_rps 5k.jpg 10000 2>&1 &
pid1=$!
wait -f $pid1
# read hey ouput max rps
actual_rps=$(grep "Requests/sec" "$f1" | awk '{print $2}')
# read loadtest max rps
# actual_rps=$(grep "Requests per second" "$f1" | awk '{print $4}')
echo "Actual RPS achieved: $actual_rps"
if [ "$first_run" = false ]; then
if (( $(echo "$actual_rps <= $last_actual_rps" | bc -l) )); then
echo "Actual RPS did not increase, stopping test."
break
fi
fi
last_actual_rps=$actual_rps
# ±ê¼ÇµÚÒ»´ÎÔËÐÐÒÑÍê³É
first_run=false
current_rps=$((current_rps + step))
$path/kill_sledge.sh
echo "sledge has been stopped"
done
echo "Max RPS testing completed."

@ -14,6 +14,9 @@ rps=$3
image=$4
port=$5
#hey -disable-compression -disable-keepalive -disable-redirects -c 1 -q $rps -z $duration\s -cpus 1 -t 0 -m GET -D "$image" "http://10.10.1.1:$port"
hey -disable-compression -disable-keepalive -disable-redirects -c 8 -q 50 -z $duration\s -t 0 -m GET -D "$image" "http://10.10.1.1:$port" > $output
echo "hey test"
hey -disable-compression -disable-keepalive -disable-redirects -c 5 -q $rps -z $duration\s -t 0 -m GET -D "$image" "http://10.16.109.192:$port" > $output
#loadtest -c 5 --rps $rps -t $duration --method GET --data @$image "http://10.16.109.192:$port" > $output
#hey -disable-compression -disable-keepalive -disable-redirects -c 8 -q 50 -z $duration\s -t 0 -m GET -D "$image" "http://10.10.1.1:$port" > $output

Loading…
Cancel
Save