exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

run-latency.bash (1436B)


      1 #/usr/bin/env bash
      2 
      3 # This is intended to be run with SSH agent forwarding,
      4 # so we can log in as root to adjust artificial delay.
      5 
      6 set -eu
      7 
      8 which taler-exchange-benchmark
      9 
     10 # check that we can log in at least!
     11 ssh root@gv.taler.net true
     12 ssh root@firefly.gnunet.org true
     13 
     14 ssh root@gv.taler.net tc qdisc delete dev enp4s0f0 root || true
     15 ssh root@firefly.gnunet.org tc qdisc delete dev eno2 root || true
     16 
     17 ssh root@gv.taler.net "echo 3 > /proc/sys/net/ipv4/tcp_fastopen"
     18 ssh root@firefly.gnunet.org "echo 3 > /proc/sys/net/ipv4/tcp_fastopen"
     19 
     20 # warm up TCP fast open cookies
     21 taler-exchange-benchmark -c benchmark-remote-gv.conf -m client -p 1 -n 5 >> benchmark-latency.log 2>&1
     22 
     23 export GNUNET_BENCHMARK_DIR=$(readlink -f ./stats)
     24 
     25 for x in 0 50 100 150 200; do
     26 	echo running with one-sided delay of $x
     27 	result_dir="results/latency-$x"
     28 	if [[ -d "$result_dir" ]]; then
     29 		echo "skipping because results exist"
     30 		continue
     31 	fi
     32 
     33 	ssh root@gv.taler.net tc qdisc add dev enp4s0f0 root netem delay "${x}ms"
     34 	ssh root@firefly.gnunet.org tc qdisc add dev eno2 root netem delay "${x}ms"
     35 
     36 	rm -rf stats
     37 	taler-exchange-benchmark -c benchmark-remote-gv.conf -m client -p 1 -n 200 >> benchmark-latency.log 2>&1
     38 	echo "### Finished latency run for ${x}ms" >> benchmark-latency.log
     39 	mkdir -p "$result_dir"
     40 	cp -a stats "$result_dir/"
     41 
     42 	ssh root@gv.taler.net tc qdisc delete dev enp4s0f0 root
     43 	ssh root@firefly.gnunet.org tc qdisc delete dev eno2 root
     44 done