aboutsummaryrefslogtreecommitdiff
path: root/doc/system/plots
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-07-12 18:19:17 +0200
committerChristian Grothoff <christian@grothoff.org>2020-07-12 18:19:17 +0200
commit895e24872de95acf255e0746b42f0661697e7f9a (patch)
treeb2aadbb712549f7aa9caf8679036e9f1535a4f2c /doc/system/plots
parent4d298f9bea8a98acc5d4b7d738af02313b203658 (diff)
initial import of thesis-dold
Diffstat (limited to 'doc/system/plots')
-rw-r--r--doc/system/plots/dbsize.sql12
-rw-r--r--doc/system/plots/eval-basic.bash20
-rw-r--r--doc/system/plots/eval-latency.bash35
-rw-r--r--doc/system/plots/latency-deposit.data5
-rw-r--r--doc/system/plots/latency-keys.data5
-rw-r--r--doc/system/plots/latency-refresh-melt.data5
-rw-r--r--doc/system/plots/latency-refresh-reveal.data5
-rw-r--r--doc/system/plots/latency-withdraw.data5
-rw-r--r--doc/system/plots/plot.gnu35
-rw-r--r--doc/system/plots/run-latency.bash44
-rw-r--r--doc/system/plots/run.bash10
-rw-r--r--doc/system/plots/set-latency.bash19
-rw-r--r--doc/system/plots/speed.data37
-rw-r--r--doc/system/plots/time_bench_cpu.data39
-rw-r--r--doc/system/plots/time_bench_ops_only.data39
-rw-r--r--doc/system/plots/time_exchange_cpu.data39
-rw-r--r--doc/system/plots/time_real.data40
17 files changed, 394 insertions, 0 deletions
diff --git a/doc/system/plots/dbsize.sql b/doc/system/plots/dbsize.sql
new file mode 100644
index 000000000..4f4b23886
--- /dev/null
+++ b/doc/system/plots/dbsize.sql
@@ -0,0 +1,12 @@
+create temporary view sizes as
+ select table_name as n,
+ pg_relation_size(quote_ident(table_name)) / 1024.0 / 1024.0 as s_tbl,
+ pg_indexes_size(quote_ident(table_name)) / 1024.0 / 1024.0 as s_idx
+ from information_schema.tables
+ where table_schema = 'public';
+
+
+select n, s_tbl, s_idx, s_tbl + s_idx from sizes where (s_tbl) != 0
+order by (s_tbl + s_idx);
+
+select sum(s_tbl), sum(s_idx), sum(s_tbl + s_idx) from sizes where s_tbl != 0;
diff --git a/doc/system/plots/eval-basic.bash b/doc/system/plots/eval-basic.bash
new file mode 100644
index 000000000..22888be80
--- /dev/null
+++ b/doc/system/plots/eval-basic.bash
@@ -0,0 +1,20 @@
+#/usr/bin/env bash
+
+for x in 1 $(seq 10 10 190) $(seq 200 100 2000); do
+ cat results/stats-$x/stats/taler-exchange-* | awk -v n=$x '{ print n, int(($3 + $5) / 96) }'
+done | sort -n > plots/time_exchange_cpu.data
+
+tail results/stats-*/benchmark.log | awk '/RAW/ { printf "%d %d\n", $4, $5 }' | sort -n > plots/time_real.data
+
+tail results/stats-*/benchmark.log | awk '/RAW/ { printf "%d %f\n", $4, (($4 * 1000)/($5/1000/1000)) }' | sort -n > plots/speed.data
+
+for x in 1 $(seq 10 10 190) $(seq 200 100 2000); do
+ tail results/stats-$x/benchmark.log | awk -v n=$x '/cpu time/ { print n, int(($4 + $6) / 96) }'
+done | sort -n > plots/time_bench_cpu.data
+
+
+for x in 1 $(seq 10 10 190) $(seq 200 100 2000); do
+ awk -f ~/code/gnunet/contrib/benchmark/collect.awk baseline.txt results/stats-$x/stats/gnunet-benchmark-ops-thread* \
+ | grep total_ops_adjusted_ms \
+ | awk -v n=$x '{ print n, int($2 / 96) }'
+done | sort -n > plots/time_bench_ops_only.data
diff --git a/doc/system/plots/eval-latency.bash b/doc/system/plots/eval-latency.bash
new file mode 100644
index 000000000..684f36b7a
--- /dev/null
+++ b/doc/system/plots/eval-latency.bash
@@ -0,0 +1,35 @@
+#/usr/bin/env bash
+
+set -eu
+
+mkdir -p plots
+
+do_eval() {
+ e=$1
+ out=$2
+ for x in 0 50 100 150 200; do
+ awk -f ~/repos/gnunet/contrib/benchmark/collect.awk results/latency-$x/stats/gnunet-benchmark-urls-*.txt \
+ | fgrep "$1" | fgrep "status 200" | awk -v x=$x '{ print x, $10/1000 }'
+ done | sort -n > plots/latency-$out.data
+}
+
+
+awk -f ~/repos/gnunet/contrib/benchmark/collect.awk results/latency-0/stats/gnunet-benchmark-urls-*.txt \
+ | fgrep "status 200" | awk '{ print $2, $10/1000 }' > plots/latency-summary-0.data
+
+awk -f ~/repos/gnunet/contrib/benchmark/collect.awk results/latency-100/stats/gnunet-benchmark-urls-*.txt \
+ | fgrep "status 200" | awk '{ print $2, $10/1000 }' > plots/latency-summary-100.data
+
+do_eval '/refresh/melt' 'refresh-melt'
+do_eval '/refresh/reveal' 'refresh-reveal'
+do_eval '/deposit' 'deposit'
+do_eval '/reserve/withdraw' 'withdraw'
+do_eval '/keys' 'keys'
+
+awk -f ~/repos/gnunet/contrib/benchmark/collect.awk results/latency-*/stats/gnunet-benchmark-urls-*.txt \
+ | fgrep "status 200" | awk '{ print $2, $16/1000 }' \
+ > plots/req-sent.data
+
+awk -f ~/repos/gnunet/contrib/benchmark/collect.awk results/latency-*/stats/gnunet-benchmark-urls-*.txt \
+ | fgrep "status 200" | awk '{ print $2, $18/1000 }' \
+ > plots/req-received.data
diff --git a/doc/system/plots/latency-deposit.data b/doc/system/plots/latency-deposit.data
new file mode 100644
index 000000000..b53b3f66d
--- /dev/null
+++ b/doc/system/plots/latency-deposit.data
@@ -0,0 +1,5 @@
+0 22.3593
+50 122.833
+100 223.217
+150 323.787
+200 424.537
diff --git a/doc/system/plots/latency-keys.data b/doc/system/plots/latency-keys.data
new file mode 100644
index 000000000..028a4ff90
--- /dev/null
+++ b/doc/system/plots/latency-keys.data
@@ -0,0 +1,5 @@
+0 1.139
+50 101.446
+100 201.251
+150 301.335
+200 401.399
diff --git a/doc/system/plots/latency-refresh-melt.data b/doc/system/plots/latency-refresh-melt.data
new file mode 100644
index 000000000..991464a8a
--- /dev/null
+++ b/doc/system/plots/latency-refresh-melt.data
@@ -0,0 +1,5 @@
+0 20.7065
+50 121.796
+100 223.9
+150 323.459
+200 422.474
diff --git a/doc/system/plots/latency-refresh-reveal.data b/doc/system/plots/latency-refresh-reveal.data
new file mode 100644
index 000000000..989c611f6
--- /dev/null
+++ b/doc/system/plots/latency-refresh-reveal.data
@@ -0,0 +1,5 @@
+0 63.6377
+50 264.969
+100 466.303
+150 665.626
+200 862.193
diff --git a/doc/system/plots/latency-withdraw.data b/doc/system/plots/latency-withdraw.data
new file mode 100644
index 000000000..5f258090b
--- /dev/null
+++ b/doc/system/plots/latency-withdraw.data
@@ -0,0 +1,5 @@
+0 22.675
+50 123.066
+100 222.458
+150 322.701
+200 423.749
diff --git a/doc/system/plots/plot.gnu b/doc/system/plots/plot.gnu
new file mode 100644
index 000000000..120db2786
--- /dev/null
+++ b/doc/system/plots/plot.gnu
@@ -0,0 +1,35 @@
+set terminal pdf monochrome
+
+set nokey
+set output 'speed.pdf'
+set ylabel "coins per second"
+set xlabel "parallel clients"
+plot "speed.data" with lines lw 1
+
+set key top left Left reverse
+set output 'cpu.pdf'
+set ylabel "CPU time (us)"
+set xlabel "parallel clients"
+plot "time_real.data" with lines lw 1 title "wall clock", \
+ "time_bench_cpu.data" with lines lw 1 title "benchmark CPU / 96", \
+ "time_exchange_cpu.data" with lines lw 1 title "exchange CPU / 96", \
+ "time_bench_ops_only.data" with lines lw 1 title "exchange crypto / 96"
+set nokey
+
+
+set output 'latencies.pdf'
+set multiplot layout 2, 3
+set xlabel "delay" font ",10"
+set ylabel "latency" font ",10"
+set xtics font ",10"
+set ytics font ",10"
+set title "/refresh/melt"
+plot "latency-refresh-melt.data" with lines lw 1
+set title "/refresh/reveal"
+plot "latency-refresh-reveal.data" with lines lw 1
+set title "/keys"
+plot "latency-keys.data" with lines lw 1
+set title "/reserve/withdraw"
+plot "latency-withdraw.data" with lines lw 1
+set title "/deposit"
+plot "latency-deposit.data" with lines lw 1
diff --git a/doc/system/plots/run-latency.bash b/doc/system/plots/run-latency.bash
new file mode 100644
index 000000000..77b375db6
--- /dev/null
+++ b/doc/system/plots/run-latency.bash
@@ -0,0 +1,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
diff --git a/doc/system/plots/run.bash b/doc/system/plots/run.bash
new file mode 100644
index 000000000..d11f5f323
--- /dev/null
+++ b/doc/system/plots/run.bash
@@ -0,0 +1,10 @@
+#/usr/bin/env bash
+
+for x in $(seq 10 10 190) $(seq 200 100 2000); do
+ echo running with $x clients
+ rm -rf stats
+ taler-exchange-benchmark -c benchmark-local.conf -p $x -n 1000 >& /dev/shm/benchmark.log
+ mkdir -p "results/stats-$x"
+ cp -a stats "results/stats-$x"/
+ cp /dev/shm/benchmark.log "results/stats-$x/"
+done
diff --git a/doc/system/plots/set-latency.bash b/doc/system/plots/set-latency.bash
new file mode 100644
index 000000000..793d46c23
--- /dev/null
+++ b/doc/system/plots/set-latency.bash
@@ -0,0 +1,19 @@
+#/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
+
+echo "setting latency to $1"
+
+# 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 tc qdisc add dev enp4s0f0 root netem delay "${1}ms"
+ssh root@firefly.gnunet.org tc qdisc add dev eno2 root netem delay "${1}ms"
+
diff --git a/doc/system/plots/speed.data b/doc/system/plots/speed.data
new file mode 100644
index 000000000..5690b84ec
--- /dev/null
+++ b/doc/system/plots/speed.data
@@ -0,0 +1,37 @@
+1 1.104439
+10 92.290911
+20 180.087087
+30 255.700284
+40 344.687076
+50 438.485028
+60 515.618333
+70 568.431831
+80 639.706303
+100 673.724088
+110 676.973144
+120 671.559308
+130 694.295694
+140 664.765652
+150 638.751296
+160 673.683504
+170 674.329287
+180 669.691392
+190 638.637718
+200 699.212198
+300 675.841986
+400 656.455187
+500 714.911636
+600 738.661570
+700 699.990279
+800 708.218566
+1000 735.599016
+1100 700.423479
+1200 687.508367
+1300 696.931102
+1400 698.255900
+1500 696.575458
+1600 737.278906
+1700 718.587847
+1800 691.539112
+1900 736.039940
+2000 742.994853
diff --git a/doc/system/plots/time_bench_cpu.data b/doc/system/plots/time_bench_cpu.data
new file mode 100644
index 000000000..7cfeb813f
--- /dev/null
+++ b/doc/system/plots/time_bench_cpu.data
@@ -0,0 +1,39 @@
+1 9801666
+10 11386875
+20 23130250
+30 36564875
+40 47727458
+50 58359958
+60 70447500
+70 84446916
+80 93801750
+90 106124375
+100 119029750
+110 129536541
+120 147174791
+130 154257625
+140 174573916
+150 192325541
+160 194480625
+170 206233000
+180 214591541
+190 239929750
+200 236358375
+300 348233916
+400 495046791
+500 579896000
+600 689094875
+700 830684375
+800 957190833
+900 1058149291
+1000 1154518791
+1100 1325087916
+1200 1502792333
+1300 1610584958
+1400 1712165458
+1500 1838840458
+1600 1881089500
+1700 2023251583
+1800 2209685583
+1900 2241094458
+2000 2351564083
diff --git a/doc/system/plots/time_bench_ops_only.data b/doc/system/plots/time_bench_ops_only.data
new file mode 100644
index 000000000..558fd5bc8
--- /dev/null
+++ b/doc/system/plots/time_bench_ops_only.data
@@ -0,0 +1,39 @@
+1 2509331
+10 2564859
+20 5002341
+30 7865777
+40 10073982
+50 12128759
+60 14693754
+70 17792025
+80 19538636
+90 21980148
+100 24423023
+110 26545671
+120 30144030
+130 31522690
+140 35732386
+150 39585595
+160 39812006
+170 42203541
+180 44053474
+190 49793400
+200 48356499
+300 74601183
+400 105393510
+500 123044026
+600 145506335
+700 176345850
+800 200698466
+900 221478860
+1000 239238872
+1100 276518348
+1200 321194002
+1300 340475242
+1400 360182556
+1500 387822458
+1600 393044377
+1700 428264745
+1800 469067124
+1900 469026116
+2000 486510753
diff --git a/doc/system/plots/time_exchange_cpu.data b/doc/system/plots/time_exchange_cpu.data
new file mode 100644
index 000000000..137929124
--- /dev/null
+++ b/doc/system/plots/time_exchange_cpu.data
@@ -0,0 +1,39 @@
+1 4769125
+10 4958166
+20 9639333
+30 14984541
+40 19394166
+50 23851208
+60 28914708
+70 34698375
+80 38456250
+90 43448500
+100 48580291
+110 52942000
+120 59859458
+130 62778708
+140 70788500
+150 78093250
+160 78634750
+170 83169416
+180 86460000
+190 96958916
+200 94814958
+300 138324083
+400 194283541
+500 227209291
+600 267426291
+700 322986833
+800 368918208
+900 406839708
+1000 440552708
+1100 518428416
+1200 591421708
+1300 631228208
+1400 663142625
+1500 713897625
+1600 726439583
+1700 783727750
+1800 858787125
+1900 863532291
+2000 895376500
diff --git a/doc/system/plots/time_real.data b/doc/system/plots/time_real.data
new file mode 100644
index 000000000..7f518b73a
--- /dev/null
+++ b/doc/system/plots/time_real.data
@@ -0,0 +1,40 @@
+0 0
+1 905437353
+10 108353032
+20 111057380
+30 117324860
+40 116047287
+50 114028979
+60 116365141
+70 123145813
+80 125057389
+90 136314756
+100 148428714
+110 162487982
+120 178688611
+130 187240107
+140 210600532
+150 234833183
+160 237500249
+170 252102353
+180 268780519
+190 297508266
+200 286036200
+300 443890741
+400 609333292
+500 699387134
+600 812279973
+700 1000013888
+800 1129594787
+900 1251266347
+1000 1359436294
+1100 1570478479
+1200 1745433303
+1300 1865320684
+1400 2004995589
+1500 2153391973
+1600 2170142109
+1700 2365751116
+1800 2602889653
+1900 2581381658
+2000 2691808686