aboutsummaryrefslogtreecommitdiff
path: root/doc/system/plots/run-latency.bash
blob: 77b375db6fa9eed2bd1d57d545c97021fe3b73a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#/usr/bin/env bash

# This is intended to be run with SSH agent forwarding,
# so we can log in as root to adjust artificial delay.

set -eu

which taler-exchange-benchmark

# check that we can log in at least!
ssh root@gv.taler.net true
ssh root@firefly.gnunet.org true

ssh root@gv.taler.net tc qdisc delete dev enp4s0f0 root || true
ssh root@firefly.gnunet.org tc qdisc delete dev eno2 root || true

ssh root@gv.taler.net "echo 3 > /proc/sys/net/ipv4/tcp_fastopen"
ssh root@firefly.gnunet.org "echo 3 > /proc/sys/net/ipv4/tcp_fastopen"

# warm up TCP fast open cookies
taler-exchange-benchmark -c benchmark-remote-gv.conf -m client -p 1 -n 5 >> benchmark-latency.log 2>&1

export GNUNET_BENCHMARK_DIR=$(readlink -f ./stats)

for x in 0 50 100 150 200; do
	echo running with one-sided delay of $x
	result_dir="results/latency-$x"
	if [[ -d "$result_dir" ]]; then
		echo "skipping because results exist"
		continue
	fi

	ssh root@gv.taler.net tc qdisc add dev enp4s0f0 root netem delay "${x}ms"
	ssh root@firefly.gnunet.org tc qdisc add dev eno2 root netem delay "${x}ms"

	rm -rf stats
	taler-exchange-benchmark -c benchmark-remote-gv.conf -m client -p 1 -n 200 >> benchmark-latency.log 2>&1
	echo "### Finished latency run for ${x}ms" >> benchmark-latency.log
	mkdir -p "$result_dir"
	cp -a stats "$result_dir/"

	ssh root@gv.taler.net tc qdisc delete dev enp4s0f0 root
	ssh root@firefly.gnunet.org tc qdisc delete dev eno2 root
done