diff options
Diffstat (limited to 'benches/scripts')
-rw-r--r-- | benches/scripts/http/latency.sh | 24 | ||||
-rw-r--r-- | benches/scripts/mem/mem.sh | 46 | ||||
-rw-r--r-- | benches/scripts/mem/plot.plt | 18 |
3 files changed, 88 insertions, 0 deletions
diff --git a/benches/scripts/http/latency.sh b/benches/scripts/http/latency.sh new file mode 100644 index 0000000..d7e43c3 --- /dev/null +++ b/benches/scripts/http/latency.sh @@ -0,0 +1,24 @@ +#!/bin/sh +RATE="1 1000 2000 3000 4000" +DURATION="60s" + +RATHOLE="http://127.0.0.1:5202" +FRP="http://127.0.0.1:5203" + +echo warming up frp +echo GET $FRP | vegeta attack -duration 10s > /dev/null +for rate in $RATE; do + name="frp-${rate}qps-$DURATION.bin" + echo $name + echo GET $FRP | vegeta attack -rate $rate -duration $DURATION > $name + vegeta report $name +done + +echo warming up rathole +echo GET $RATHOLE | vegeta attack -duration 10s > /dev/null +for rate in $RATE; do + name="rathole-${rate}qps-$DURATION.bin" + echo $name + echo GET $RATHOLE | vegeta attack -rate $rate -duration $DURATION > $name + vegeta report $name +done diff --git a/benches/scripts/mem/mem.sh b/benches/scripts/mem/mem.sh new file mode 100644 index 0000000..2c1218e --- /dev/null +++ b/benches/scripts/mem/mem.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +rm -v *-mem.log + +echo frp +while true; do + ps -C frpc -o rsz= >> frpc-mem.log +sleep 1 +done & + +while true; do + ps -C frps -o rsz= >> frps-mem.log +sleep 1 +done & + +echo GET http://127.0.0.1:5203 | vegeta attack -duration 30s -rate 1000 > /dev/null + +sleep 10 + +kill $(jobs -p) + + +echo rathole + +pid_s=$(ps aux | grep "rathole -s" | head -n 1 | awk '{print $2}') +while true; do + ps --pid $pid_s -o rsz= >> ratholec-mem.log +sleep 1 +done & + +pid_c=$(ps aux | grep "rathole -c" | head -n 1 | awk '{print $2}') +while true; do + ps --pid $pid_c -o rsz= >> ratholes-mem.log +sleep 1 +done & + +echo GET http://127.0.0.1:5202 | vegeta attack -duration 30s -rate 1000 > /dev/null + +sleep 10 + +kill $(jobs -p) + +gawk -i inplace '{print $1 "000"}' frpc-mem.log +gawk -i inplace '{print $1 "000"}' frps-mem.log +gawk -i inplace '{print $1 "000"}' ratholec-mem.log +gawk -i inplace '{print $1 "000"}' ratholes-mem.log diff --git a/benches/scripts/mem/plot.plt b/benches/scripts/mem/plot.plt new file mode 100644 index 0000000..ee4a548 --- /dev/null +++ b/benches/scripts/mem/plot.plt @@ -0,0 +1,18 @@ +set title "Memory Usage" font ",20" + +set term png small size 800,600 +set key box outside + +set output "mem-graph.png" + +set ylabel "RSZ" +set format y '%.0s%cB' + +set ytics nomirror + +set yrange [0:*] + +plot "frps-mem.log" using 1 with lines axes x1y1 title "frps RSZ", \ + "frpc-mem.log" using 1 with lines axes x1y1 title "frpc RSZ", \ + "ratholes-mem.log" using 1 with lines axes x1y1 title "ratholes RSZ", \ + "ratholec-mem.log" using 1 with lines axes x1y1 title "ratholec RSZ" |