summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-05-15 11:28:40 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-05-15 11:29:51 +0200
commit0a4f6e57567c7c58a68973f5b954e6ee12bd4e49 (patch)
tree97d72ab20ff3dce398fd0cb52d24e78672eb22bb
parentb4325a1c89392d8c0ada92f6cb7e49c76c0cb76d (diff)
downloaddold-thesis-phd-0a4f6e57567c7c58a68973f5b954e6ee12bd4e49.tar.gz
dold-thesis-phd-0a4f6e57567c7c58a68973f5b954e6ee12bd4e49.tar.bz2
dold-thesis-phd-0a4f6e57567c7c58a68973f5b954e6ee12bd4e49.zip
also add benchmarking code
-rw-r--r--.gitignore4
-rw-r--r--bench/auditor.in0
-rw-r--r--bench/baseline.txt25
-rw-r--r--bench/benchmark-local-remotedb.conf144
-rw-r--r--bench/benchmark-local.conf147
-rw-r--r--bench/benchmark-remote-gv-1024.conf147
-rw-r--r--bench/benchmark-remote-gv.conf147
-rw-r--r--bench/benchmark-remote.conf147
-rwxr-xr-xbench/db-inmem/create_db.sh7
-rw-r--r--bench/db-inmem/postgresql.conf658
-rwxr-xr-xbench/db-inmem/start_db.sh3
-rwxr-xr-xbench/db-inmem/start_db_tcp.sh3
-rw-r--r--bench/dbsize.sql12
-rw-r--r--bench/eval-basic.bash23
-rw-r--r--bench/eval-latency.bash26
-rw-r--r--bench/exchange_benchmark_home/.config/taler/account-2.json4
-rw-r--r--bench/exchange_benchmark_home/.config/taler/account-2.json~10
-rw-r--r--bench/exchange_benchmark_home/.local/share/taler/auditor/offline-keys/auditor.priv2
-rw-r--r--bench/exchange_benchmark_home/.local/share/taler/auditors/auditor.outbin0 -> 1698 bytes
-rwxr-xr-xbench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_0_01-BET734VZZ6FNXMZQAMR5/1557667679000000bin0 -> 1667 bytes
-rwxr-xr-xbench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_0_1-CV7VDF3H660XZ6AZY1SP/1557667679000000bin0 -> 1667 bytes
-rwxr-xr-xbench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_1-AEYK51QMYFJ9ZFTN44K8/1557667679000000bin0 -> 1668 bytes
-rwxr-xr-xbench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_10-X1VVTYSB7FDYPEFG27S9/1557667679000000bin0 -> 1667 bytes
-rwxr-xr-xbench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_5-TSY4M0DQVXYFVRK1YTAB/1557667679000000bin0 -> 1667 bytes
-rw-r--r--bench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/signkeys/1556667841000000bin0 -> 192 bytes
-rw-r--r--bench/exchange_benchmark_home/.local/share/taler/exchange/offline-keys/master.priv1
-rw-r--r--bench/exchange_benchmark_home/.local/share/taler/exchange/wirefees/x-taler-bank.feebin0 -> 600 bytes
-rw-r--r--bench/run-base.bash10
-rw-r--r--bench/run-latency.bash44
-rw-r--r--bench/run-traffic.bash12
-rw-r--r--bench/run.bash29
-rw-r--r--bench/set-latency.bash19
32 files changed, 1624 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 15151d9..3156fa0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,3 +18,7 @@ summary/summary-english.pdf
*.lof
*.maf
*.mt*
+
+bench/results/
+bench/plots/
+bench/stats
diff --git a/bench/auditor.in b/bench/auditor.in
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bench/auditor.in
diff --git a/bench/baseline.txt b/bench/baseline.txt
new file mode 100644
index 0000000..207408a
--- /dev/null
+++ b/bench/baseline.txt
@@ -0,0 +1,25 @@
+op_baseline hash time_avg_us 1.36179
+op_baseline ecdsa_verify time_avg_us 0
+op_baseline ecdsa_key_create time_avg_us 0
+op_baseline hash_context_start time_avg_us 11.3917
+op_baseline eddsa_key_create time_avg_us 1892.68
+op_baseline ecdsa_key_get_public time_avg_us 0
+op_baseline ecdhe_key_get_public time_avg_us 1240.87
+op_baseline rsa_unblind time_avg_us 1335.89
+op_baseline hash_context_read time_avg_us 0.811998
+op_baseline eddsa_key_get_public time_avg_us 1724.94
+op_baseline eddsa_ecdh time_avg_us 1320.5
+op_baseline rsa_sign_blinded time_avg_us 5233.91
+op_baseline rsa_blind time_avg_us 670.812
+op_baseline hkdf time_avg_us 36.194
+op_baseline eddsa_sign time_avg_us 5024.43
+op_baseline ecdsa_ecdh time_avg_us 0
+op_baseline ecdsa_sign time_avg_us 0
+op_baseline ecdh_eddsa time_avg_us 1293.56
+op_baseline rsa_verify time_avg_us 407.257
+op_baseline ecdhe_key_create time_avg_us 1842.99
+op_baseline rsa_private_key_get_public time_avg_us 5.05
+op_baseline eddsa_verify time_avg_us 3865.26
+op_baseline ecc_ecdh time_avg_us 0
+op_baseline rsa_private_key_create time_avg_us 0
+op_baseline hash_context_finish time_avg_us 0.283333
diff --git a/bench/benchmark-local-remotedb.conf b/bench/benchmark-local-remotedb.conf
new file mode 100644
index 0000000..93cc812
--- /dev/null
+++ b/bench/benchmark-local-remotedb.conf
@@ -0,0 +1,144 @@
+# This file is in the public domain.
+#
+[paths]
+# Persistant data storage for the testcase
+# This value is a default for `taler_config_home'
+taler_test_home = exchange_benchmark_home/
+
+[taler]
+# Currency supported by the exchange (can only be one)
+currency = EUR
+
+[exchange]
+# how long is one signkey valid?
+signkey_duration = 4 weeks
+# how long are the signatures with the signkey valid?
+legal_duration = 2 years
+# how long do we provide to clients denomination and signing keys
+# ahead of time?
+lookahead_provide = 4 weeks 1 day
+# HTTP port the exchange listens to
+port = 8082
+# Master public key used to sign the exchange's various keys
+master_public_key = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
+# How to access our database
+DB = postgres
+# Base URL of the exchange. Must be set to a URL where the
+# exchange (or the twister) is actually listening.
+base_url = "http://localhost:8082/"
+# Keep it short so the test runs fast.
+lookahead_sign = 12 h
+
+[exchangedb-postgres]
+config = "postgres://bench:bench@192.168.42.2:5433/taler"
+
+[auditordb-postgres]
+config = "postgres://bench:bench@192.168.42.2:5433/taler"
+
+[benchmark-remote-exchange]
+# Only used for SSH connection
+host =
+dir =
+
+[account-2]
+# What is the bank account (with the "Taler Bank" demo system)?
+URL = "payto://x-taler-bank/localhost:8081/2"
+# This is the response we give out for the /wire request. It provides
+# wallets with the bank information for transfers to the exchange.
+wire_response = ${TALER_CONFIG_HOME}/account-2.json
+# Which wire plugin should we use to access the account?
+plugin = taler_bank
+# Authentication information for basic authentication
+taler_bank_auth_method = "basic"
+username = user
+password = pass
+
+enable_debit = YES
+enable_credit = YES
+
+[fees-x-taler-bank]
+# Fees for the forseeable future...
+# If you see this after 2017, update to match the next 10 years...
+wire-fee-2018 = EUR:0.01
+wire-fee-2019 = EUR:0.01
+wire-fee-2020 = EUR:0.01
+wire-fee-2021 = EUR:0.01
+wire-fee-2022 = EUR:0.01
+wire-fee-2023 = EUR:0.01
+wire-fee-2024 = EUR:0.01
+wire-fee-2025 = EUR:0.01
+wire-fee-2026 = EUR:0.01
+wire-fee-2027 = EUR:0.01
+
+closing-fee-2018 = EUR:0.01
+closing-fee-2019 = EUR:0.01
+closing-fee-2020 = EUR:0.01
+closing-fee-2021 = EUR:0.01
+closing-fee-2022 = EUR:0.01
+closing-fee-2023 = EUR:0.01
+closing-fee-2024 = EUR:0.01
+closing-fee-2025 = EUR:0.01
+closing-fee-2026 = EUR:0.01
+closing-fee-2027 = EUR:0.01
+
+# Sections starting with "coin_" specify which denominations
+# the exchange should support (and their respective fee structure)
+[coin_eur_ct_1]
+value = EUR:0.01
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.00
+fee_deposit = EUR:0.00
+fee_refresh = EUR:0.01
+fee_refund = EUR:0.01
+rsa_keysize = 2048
+
+[coin_eur_ct_10]
+value = EUR:0.10
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 2048
+
+[coin_eur_1]
+value = EUR:1
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 2048
+
+[coin_eur_5]
+value = EUR:5
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 2048
+
+[coin_eur_10]
+value = EUR:10
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 2048
diff --git a/bench/benchmark-local.conf b/bench/benchmark-local.conf
new file mode 100644
index 0000000..931b2b3
--- /dev/null
+++ b/bench/benchmark-local.conf
@@ -0,0 +1,147 @@
+# This file is in the public domain.
+#
+[paths]
+# Persistant data storage for the testcase
+# This value is a default for `taler_config_home'
+taler_test_home = exchange_benchmark_home/
+
+[taler]
+# Currency supported by the exchange (can only be one)
+currency = EUR
+
+[exchange]
+# how long is one signkey valid?
+signkey_duration = 4 weeks
+# how long are the signatures with the signkey valid?
+legal_duration = 2 years
+# how long do we provide to clients denomination and signing keys
+# ahead of time?
+lookahead_provide = 4 weeks 1 day
+# HTTP port the exchange listens to
+port = 8082
+# Master public key used to sign the exchange's various keys
+master_public_key = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
+# How to access our database
+DB = postgres
+# Base URL of the exchange. Must be set to a URL where the
+# exchange (or the twister) is actually listening.
+base_url = "http://localhost:8082/"
+# Keep it short so the test runs fast.
+lookahead_sign = 12 h
+
+[auditor]
+base_url = "http://localhost:8083/auditor"
+
+[exchangedb-postgres]
+config = "postgres:///taler?host=/home/dold/sockets"
+
+[auditordb-postgres]
+config = "postgres:///taler?host=/home/dold/sockets"
+
+[benchmark-remote-exchange]
+# Only used for SSH connection
+host =
+dir =
+
+[account-2]
+# What is the bank account (with the "Taler Bank" demo system)?
+URL = "payto://x-taler-bank/localhost:8081/2"
+# This is the response we give out for the /wire request. It provides
+# wallets with the bank information for transfers to the exchange.
+wire_response = ${TALER_CONFIG_HOME}/account-2.json
+# Which wire plugin should we use to access the account?
+plugin = taler_bank
+# Authentication information for basic authentication
+taler_bank_auth_method = "basic"
+username = user
+password = pass
+
+enable_debit = YES
+enable_credit = YES
+
+[fees-x-taler-bank]
+# Fees for the forseeable future...
+# If you see this after 2017, update to match the next 10 years...
+wire-fee-2018 = EUR:0.01
+wire-fee-2019 = EUR:0.01
+wire-fee-2020 = EUR:0.01
+wire-fee-2021 = EUR:0.01
+wire-fee-2022 = EUR:0.01
+wire-fee-2023 = EUR:0.01
+wire-fee-2024 = EUR:0.01
+wire-fee-2025 = EUR:0.01
+wire-fee-2026 = EUR:0.01
+wire-fee-2027 = EUR:0.01
+
+closing-fee-2018 = EUR:0.01
+closing-fee-2019 = EUR:0.01
+closing-fee-2020 = EUR:0.01
+closing-fee-2021 = EUR:0.01
+closing-fee-2022 = EUR:0.01
+closing-fee-2023 = EUR:0.01
+closing-fee-2024 = EUR:0.01
+closing-fee-2025 = EUR:0.01
+closing-fee-2026 = EUR:0.01
+closing-fee-2027 = EUR:0.01
+
+# Sections starting with "coin_" specify which denominations
+# the exchange should support (and their respective fee structure)
+[coin_eur_ct_1]
+value = EUR:0.01
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.00
+fee_deposit = EUR:0.00
+fee_refresh = EUR:0.01
+fee_refund = EUR:0.01
+rsa_keysize = 2048
+
+[coin_eur_ct_10]
+value = EUR:0.10
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 2048
+
+[coin_eur_1]
+value = EUR:1
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 2048
+
+[coin_eur_5]
+value = EUR:5
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 2048
+
+[coin_eur_10]
+value = EUR:10
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 2048
diff --git a/bench/benchmark-remote-gv-1024.conf b/bench/benchmark-remote-gv-1024.conf
new file mode 100644
index 0000000..97521f6
--- /dev/null
+++ b/bench/benchmark-remote-gv-1024.conf
@@ -0,0 +1,147 @@
+# This file is in the public domain.
+#
+[paths]
+# Persistant data storage for the testcase
+# This value is a default for `taler_config_home'
+taler_test_home = exchange_benchmark_home/
+
+[taler]
+# Currency supported by the exchange (can only be one)
+currency = EUR
+
+[exchange]
+# how long is one signkey valid?
+signkey_duration = 4 weeks
+# how long are the signatures with the signkey valid?
+legal_duration = 2 years
+# how long do we provide to clients denomination and signing keys
+# ahead of time?
+lookahead_provide = 4 weeks 1 day
+# HTTP port the exchange listens to
+port = 8081
+# Master public key used to sign the exchange's various keys
+master_public_key = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
+# How to access our database
+DB = postgres
+# Base URL of the exchange. Must be set to a URL where the
+# exchange (or the twister) is actually listening.
+base_url = "http://192.168.42.1:8081/"
+# Keep it short so the test runs fast.
+lookahead_sign = 12 h
+
+[auditor]
+base_url = http://auditor.example.com/
+
+[exchangedb-postgres]
+config = "postgres:///taler?host=/home/dold/sockets"
+
+[auditordb-postgres]
+config = "postgres:///taler?host=/home/dold/sockets"
+
+[benchmark-remote-exchange]
+# Only used for SSH connection
+host = firefly.gnunet.org
+dir = /home/dold/bench
+
+[account-2]
+# What is the bank account (with the "Taler Bank" demo system)?
+URL = "payto://x-taler-bank/192.168.42.2:8081/2"
+# This is the response we give out for the /wire request. It provides
+# wallets with the bank information for transfers to the exchange.
+wire_response = ${TALER_CONFIG_HOME}/account-2.json
+# Which wire plugin should we use to access the account?
+plugin = taler_bank
+# Authentication information for basic authentication
+taler_bank_auth_method = "basic"
+username = user
+password = pass
+
+enable_debit = YES
+enable_credit = YES
+
+[fees-x-taler-bank]
+# Fees for the forseeable future...
+# If you see this after 2017, update to match the next 10 years...
+wire-fee-2018 = EUR:0.01
+wire-fee-2019 = EUR:0.01
+wire-fee-2020 = EUR:0.01
+wire-fee-2021 = EUR:0.01
+wire-fee-2022 = EUR:0.01
+wire-fee-2023 = EUR:0.01
+wire-fee-2024 = EUR:0.01
+wire-fee-2025 = EUR:0.01
+wire-fee-2026 = EUR:0.01
+wire-fee-2027 = EUR:0.01
+
+closing-fee-2018 = EUR:0.01
+closing-fee-2019 = EUR:0.01
+closing-fee-2020 = EUR:0.01
+closing-fee-2021 = EUR:0.01
+closing-fee-2022 = EUR:0.01
+closing-fee-2023 = EUR:0.01
+closing-fee-2024 = EUR:0.01
+closing-fee-2025 = EUR:0.01
+closing-fee-2026 = EUR:0.01
+closing-fee-2027 = EUR:0.01
+
+# Sections starting with "coin_" specify which denominations
+# the exchange should support (and their respective fee structure)
+[coin_eur_ct_1]
+value = EUR:0.01
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.00
+fee_deposit = EUR:0.00
+fee_refresh = EUR:0.01
+fee_refund = EUR:0.01
+rsa_keysize = 1024
+
+[coin_eur_ct_10]
+value = EUR:0.10
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 1024
+
+[coin_eur_1]
+value = EUR:1
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 1024
+
+[coin_eur_5]
+value = EUR:5
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 1024
+
+[coin_eur_10]
+value = EUR:10
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 1024
diff --git a/bench/benchmark-remote-gv.conf b/bench/benchmark-remote-gv.conf
new file mode 100644
index 0000000..1a5a268
--- /dev/null
+++ b/bench/benchmark-remote-gv.conf
@@ -0,0 +1,147 @@
+# This file is in the public domain.
+#
+[paths]
+# Persistant data storage for the testcase
+# This value is a default for `taler_config_home'
+taler_test_home = exchange_benchmark_home/
+
+[taler]
+# Currency supported by the exchange (can only be one)
+currency = EUR
+
+[exchange]
+# how long is one signkey valid?
+signkey_duration = 4 weeks
+# how long are the signatures with the signkey valid?
+legal_duration = 2 years
+# how long do we provide to clients denomination and signing keys
+# ahead of time?
+lookahead_provide = 4 weeks 1 day
+# HTTP port the exchange listens to
+port = 8081
+# Master public key used to sign the exchange's various keys
+master_public_key = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
+# How to access our database
+DB = postgres
+# Base URL of the exchange. Must be set to a URL where the
+# exchange (or the twister) is actually listening.
+base_url = "http://192.168.42.1:8081/"
+# Keep it short so the test runs fast.
+lookahead_sign = 12 h
+
+[auditor]
+base_url = http://auditor.example.com/
+
+[exchangedb-postgres]
+config = "postgres:///taler?host=/home/dold/sockets"
+
+[auditordb-postgres]
+config = "postgres:///taler?host=/home/dold/sockets"
+
+[benchmark-remote-exchange]
+# Only used for SSH connection
+host = firefly.gnunet.org
+dir = /home/dold/bench
+
+[account-2]
+# What is the bank account (with the "Taler Bank" demo system)?
+URL = "payto://x-taler-bank/192.168.42.2:8081/2"
+# This is the response we give out for the /wire request. It provides
+# wallets with the bank information for transfers to the exchange.
+wire_response = ${TALER_CONFIG_HOME}/account-2.json
+# Which wire plugin should we use to access the account?
+plugin = taler_bank
+# Authentication information for basic authentication
+taler_bank_auth_method = "basic"
+username = user
+password = pass
+
+enable_debit = YES
+enable_credit = YES
+
+[fees-x-taler-bank]
+# Fees for the forseeable future...
+# If you see this after 2017, update to match the next 10 years...
+wire-fee-2018 = EUR:0.01
+wire-fee-2019 = EUR:0.01
+wire-fee-2020 = EUR:0.01
+wire-fee-2021 = EUR:0.01
+wire-fee-2022 = EUR:0.01
+wire-fee-2023 = EUR:0.01
+wire-fee-2024 = EUR:0.01
+wire-fee-2025 = EUR:0.01
+wire-fee-2026 = EUR:0.01
+wire-fee-2027 = EUR:0.01
+
+closing-fee-2018 = EUR:0.01
+closing-fee-2019 = EUR:0.01
+closing-fee-2020 = EUR:0.01
+closing-fee-2021 = EUR:0.01
+closing-fee-2022 = EUR:0.01
+closing-fee-2023 = EUR:0.01
+closing-fee-2024 = EUR:0.01
+closing-fee-2025 = EUR:0.01
+closing-fee-2026 = EUR:0.01
+closing-fee-2027 = EUR:0.01
+
+# Sections starting with "coin_" specify which denominations
+# the exchange should support (and their respective fee structure)
+[coin_eur_ct_1]
+value = EUR:0.01
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.00
+fee_deposit = EUR:0.00
+fee_refresh = EUR:0.01
+fee_refund = EUR:0.01
+rsa_keysize = 2048
+
+[coin_eur_ct_10]
+value = EUR:0.10
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 2048
+
+[coin_eur_1]
+value = EUR:1
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 2048
+
+[coin_eur_5]
+value = EUR:5
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 2048
+
+[coin_eur_10]
+value = EUR:10
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 2048
diff --git a/bench/benchmark-remote.conf b/bench/benchmark-remote.conf
new file mode 100644
index 0000000..0f4eeb5
--- /dev/null
+++ b/bench/benchmark-remote.conf
@@ -0,0 +1,147 @@
+# This file is in the public domain.
+#
+[paths]
+# Persistant data storage for the testcase
+# This value is a default for `taler_config_home'
+taler_test_home = exchange_benchmark_home/
+
+[taler]
+# Currency supported by the exchange (can only be one)
+currency = EUR
+
+[exchange]
+# how long is one signkey valid?
+signkey_duration = 4 weeks
+# how long are the signatures with the signkey valid?
+legal_duration = 2 years
+# how long do we provide to clients denomination and signing keys
+# ahead of time?
+lookahead_provide = 4 weeks 1 day
+# HTTP port the exchange listens to
+port = 8081
+# Master public key used to sign the exchange's various keys
+master_public_key = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
+# How to access our database
+DB = postgres
+# Base URL of the exchange. Must be set to a URL where the
+# exchange (or the twister) is actually listening.
+base_url = "http://192.168.42.2:8081/"
+# Keep it short so the test runs fast.
+lookahead_sign = 12 h
+
+[exchangedb-postgres]
+config = "postgres:///taler?host=/home/dold/sockets"
+
+[auditordb-postgres]
+config = "postgres:///taler?host=/home/dold/sockets"
+
+[auditor]
+base_url = "https://auditor.example.com/"
+
+[benchmark-remote-exchange]
+# Only used for SSH connection
+host = gv.taler.net
+dir = /home/dold/bench
+
+[account-2]
+# What is the bank account (with the "Taler Bank" demo system)?
+URL = "payto://x-taler-bank/192.168.42.1:8081/2"
+# This is the response we give out for the /wire request. It provides
+# wallets with the bank information for transfers to the exchange.
+wire_response = ${TALER_CONFIG_HOME}/account-2.json
+# Which wire plugin should we use to access the account?
+plugin = taler_bank
+# Authentication information for basic authentication
+taler_bank_auth_method = "basic"
+username = user
+password = pass
+
+enable_debit = YES
+enable_credit = YES
+
+[fees-x-taler-bank]
+# Fees for the forseeable future...
+# If you see this after 2017, update to match the next 10 years...
+wire-fee-2018 = EUR:0.01
+wire-fee-2019 = EUR:0.01
+wire-fee-2020 = EUR:0.01
+wire-fee-2021 = EUR:0.01
+wire-fee-2022 = EUR:0.01
+wire-fee-2023 = EUR:0.01
+wire-fee-2024 = EUR:0.01
+wire-fee-2025 = EUR:0.01
+wire-fee-2026 = EUR:0.01
+wire-fee-2027 = EUR:0.01
+
+closing-fee-2018 = EUR:0.01
+closing-fee-2019 = EUR:0.01
+closing-fee-2020 = EUR:0.01
+closing-fee-2021 = EUR:0.01
+closing-fee-2022 = EUR:0.01
+closing-fee-2023 = EUR:0.01
+closing-fee-2024 = EUR:0.01
+closing-fee-2025 = EUR:0.01
+closing-fee-2026 = EUR:0.01
+closing-fee-2027 = EUR:0.01
+
+# Sections starting with "coin_" specify which denominations
+# the exchange should support (and their respective fee structure)
+[coin_eur_ct_1]
+value = EUR:0.01
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.00
+fee_deposit = EUR:0.00
+fee_refresh = EUR:0.01
+fee_refund = EUR:0.01
+rsa_keysize = 2048
+
+[coin_eur_ct_10]
+value = EUR:0.10
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 2048
+
+[coin_eur_1]
+value = EUR:1
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 2048
+
+[coin_eur_5]
+value = EUR:5
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 2048
+
+[coin_eur_10]
+value = EUR:10
+duration_overlap = 5 minutes
+duration_withdraw = 7 days
+duration_spend = 2 years
+duration_legal = 3 years
+fee_withdraw = EUR:0.01
+fee_deposit = EUR:0.01
+fee_refresh = EUR:0.03
+fee_refund = EUR:0.01
+rsa_keysize = 2048
diff --git a/bench/db-inmem/create_db.sh b/bench/db-inmem/create_db.sh
new file mode 100755
index 0000000..b4eca1f
--- /dev/null
+++ b/bench/db-inmem/create_db.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+set -eu
+
+mkdir -p $HOME/sockets
+initdb -D /dev/shm/talerdb-inmem -U $USER
+cp postgresql.conf /dev/shm/talerdb-inmem/
diff --git a/bench/db-inmem/postgresql.conf b/bench/db-inmem/postgresql.conf
new file mode 100644
index 0000000..efbd04d
--- /dev/null
+++ b/bench/db-inmem/postgresql.conf
@@ -0,0 +1,658 @@
+# -----------------------------
+# PostgreSQL configuration file
+# -----------------------------
+#
+# This file consists of lines of the form:
+#
+# name = value
+#
+# (The "=" is optional.) Whitespace may be used. Comments are introduced with
+# "#" anywhere on a line. The complete list of parameter names and allowed
+# values can be found in the PostgreSQL documentation.
+#
+# The commented-out settings shown in this file represent the default values.
+# Re-commenting a setting is NOT sufficient to revert it to the default value;
+# you need to reload the server.
+#
+# This file is read on server startup and when the server receives a SIGHUP
+# signal. If you edit the file on a running system, you have to SIGHUP the
+# server for the changes to take effect, run "pg_ctl reload", or execute
+# "SELECT pg_reload_conf()". Some parameters, which are marked below,
+# require a server shutdown and restart to take effect.
+#
+# Any parameter can also be given as a command-line option to the server, e.g.,
+# "postgres -c log_connections=on". Some parameters can be changed at run time
+# with the "SET" SQL command.
+#
+# Memory units: kB = kilobytes Time units: ms = milliseconds
+# MB = megabytes s = seconds
+# GB = gigabytes min = minutes
+# TB = terabytes h = hours
+# d = days
+
+
+#------------------------------------------------------------------------------
+# FILE LOCATIONS
+#------------------------------------------------------------------------------
+
+# The default values of these variables are driven from the -D command-line
+# option or PGDATA environment variable, represented here as ConfigDir.
+
+#data_directory = 'ConfigDir' # use data in another directory
+ # (change requires restart)
+#hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file
+ # (change requires restart)
+#ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file
+ # (change requires restart)
+
+# If external_pid_file is not explicitly set, no extra PID file is written.
+#external_pid_file = '' # write an extra PID file
+ # (change requires restart)
+
+
+#------------------------------------------------------------------------------
+# CONNECTIONS AND AUTHENTICATION
+#------------------------------------------------------------------------------
+
+# - Connection Settings -
+
+#listen_addresses = 'localhost' # what IP address(es) to listen on;
+ # comma-separated list of addresses;
+ # defaults to 'localhost'; use '*' for all
+ # (change requires restart)
+#port = 5432 # (change requires restart)
+max_connections = 4096 # (change requires restart)
+#superuser_reserved_connections = 3 # (change requires restart)
+#unix_socket_directories = '/tmp' # comma-separated list of directories
+ # (change requires restart)
+#unix_socket_group = '' # (change requires restart)
+#unix_socket_permissions = 0777 # begin with 0 to use octal notation
+ # (change requires restart)
+#bonjour = off # advertise server via Bonjour
+ # (change requires restart)
+#bonjour_name = '' # defaults to the computer name
+ # (change requires restart)
+
+# - Security and Authentication -
+
+#authentication_timeout = 1min # 1s-600s
+#ssl = off
+#ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers
+#ssl_prefer_server_ciphers = on
+#ssl_ecdh_curve = 'prime256v1'
+#ssl_dh_params_file = ''
+#ssl_cert_file = 'server.crt'
+#ssl_key_file = 'server.key'
+#ssl_ca_file = ''
+#ssl_crl_file = ''
+#password_encryption = md5 # md5 or scram-sha-256
+#db_user_namespace = off
+#row_security = on
+
+# GSSAPI using Kerberos
+#krb_server_keyfile = ''
+#krb_caseins_users = off
+
+# - TCP Keepalives -
+# see "man 7 tcp" for details
+
+#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
+ # 0 selects the system default
+#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
+ # 0 selects the system default
+#tcp_keepalives_count = 0 # TCP_KEEPCNT;
+ # 0 selects the system default
+
+
+#------------------------------------------------------------------------------
+# RESOURCE USAGE (except WAL)
+#------------------------------------------------------------------------------
+
+# - Memory -
+
+shared_buffers = 2GB # min 128kB
+ # (change requires restart)
+huge_pages = try # on, off, or try
+ # (change requires restart)
+temp_buffers = 2GB # min 800kB
+#max_prepared_transactions = 0 # zero disables the feature
+ # (change requires restart)
+# Caution: it is not advisable to set max_prepared_transactions nonzero unless
+# you actively intend to use prepared transactions.
+work_mem = 5GB
+maintenance_work_mem = 5012MB # min 1MB
+#replacement_sort_tuples = 150000 # limits use of replacement selection sort
+#autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem
+max_stack_depth = 7680kB # min 100kB
+dynamic_shared_memory_type = posix # the default is the first option
+ # supported by the operating system:
+ # posix
+ # sysv
+ # windows
+ # mmap
+ # use none to disable dynamic shared memory
+ # (change requires restart)
+
+# - Disk -
+
+#temp_file_limit = -1 # limits per-process temp file space
+ # in kB, or -1 for no limit
+
+# - Kernel Resource Usage -
+
+max_files_per_process = 2048 # min 25
+ # (change requires restart)
+#shared_preload_libraries = '' # (change requires restart)
+
+# - Cost-Based Vacuum Delay -
+
+#vacuum_cost_delay = 0 # 0-100 milliseconds
+#vacuum_cost_page_hit = 1 # 0-10000 credits
+#vacuum_cost_page_miss = 10 # 0-10000 credits
+#vacuum_cost_page_dirty = 20 # 0-10000 credits
+#vacuum_cost_limit = 200 # 1-10000 credits
+
+# - Background Writer -
+
+#bgwriter_delay = 200ms # 10-10000ms between rounds
+#bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round
+#bgwriter_lru_multiplier = 2.0 # 0-10.0 multiplier on buffers scanned/round
+#bgwriter_flush_after = 512kB # measured in pages, 0 disables
+
+# - Asynchronous Behavior -
+
+effective_io_concurrency = 96 # 1-1000; 0 disables prefetching
+max_worker_processes = 96 # (change requires restart)
+max_parallel_workers_per_gather = 32 # taken from max_parallel_workers
+max_parallel_workers = 32 # maximum number of max_worker_processes that
+ # can be used in parallel queries
+#old_snapshot_threshold = -1 # 1min-60d; -1 disables; 0 is immediate
+ # (change requires restart)
+#backend_flush_after = 0 # measured in pages, 0 disables
+
+
+#------------------------------------------------------------------------------
+# WRITE AHEAD LOG
+#------------------------------------------------------------------------------
+
+# - Settings -
+
+#wal_level = replica # minimal, replica, or logical
+ # (change requires restart)
+fsync = off # flush data to disk for crash safety
+ # (turning this off can cause
+ # unrecoverable data corruption)
+#synchronous_commit = on # synchronization level;
+ # off, local, remote_write, remote_apply, or on
+#wal_sync_method = fsync # the default is the first option
+ # supported by the operating system:
+ # open_datasync
+ # fdatasync (default on Linux)
+ # fsync
+ # fsync_writethrough
+ # open_sync
+#full_page_writes = on # recover from partial page writes
+#wal_compression = off # enable compression of full-page writes
+#wal_log_hints = off # also do full page writes of non-critical updates
+ # (change requires restart)
+#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
+ # (change requires restart)
+#wal_writer_delay = 200ms # 1-10000 milliseconds
+#wal_writer_flush_after = 1MB # measured in pages, 0 disables
+
+#commit_delay = 0 # range 0-100000, in microseconds
+#commit_siblings = 5 # range 1-1000
+
+# - Checkpoints -
+
+#checkpoint_timeout = 5min # range 30s-1d
+#max_wal_size = 1GB
+#min_wal_size = 80MB
+#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
+#checkpoint_flush_after = 256kB # measured in pages, 0 disables
+#checkpoint_warning = 30s # 0 disables
+
+# - Archiving -
+
+#archive_mode = off # enables archiving; off, on, or always
+ # (change requires restart)
+#archive_command = '' # command to use to archive a logfile segment
+ # placeholders: %p = path of file to archive
+ # %f = file name only
+ # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'
+#archive_timeout = 0 # force a logfile segment switch after this
+ # number of seconds; 0 disables
+
+
+#------------------------------------------------------------------------------
+# REPLICATION
+#------------------------------------------------------------------------------
+
+# - Sending Server(s) -
+
+# Set these on the master and on any standby that will send replication data.
+
+#max_wal_senders = 10 # max number of walsender processes
+ # (change requires restart)
+#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables
+#wal_sender_timeout = 60s # in milliseconds; 0 disables
+
+#max_replication_slots = 10 # max number of replication slots
+ # (change requires restart)
+#track_commit_timestamp = off # collect timestamp of transaction commit
+ # (change requires restart)
+
+# - Master Server -
+
+# These settings are ignored on a standby server.
+
+#synchronous_standby_names = '' # standby servers that provide sync rep
+ # method to choose sync standbys, number of sync standbys,
+ # and comma-separated list of application_name
+ # from standby(s); '*' = all
+#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed
+
+# - Standby Servers -
+
+# These settings are ignored on a master server.
+
+#hot_standby = on # "off" disallows queries during recovery
+ # (change requires restart)
+#max_standby_archive_delay = 30s # max delay before canceling queries
+ # when reading WAL from archive;
+ # -1 allows indefinite delay
+#max_standby_streaming_delay = 30s # max delay before canceling queries
+ # when reading streaming WAL;
+ # -1 allows indefinite delay
+#wal_receiver_status_interval = 10s # send replies at least this often
+ # 0 disables
+#hot_standby_feedback = off # send info from standby to prevent
+ # query conflicts
+#wal_receiver_timeout = 60s # time that receiver waits for
+ # communication from master
+ # in milliseconds; 0 disables
+#wal_retrieve_retry_interval = 5s # time to wait before retrying to
+ # retrieve WAL after a failed attempt
+
+# - Subscribers -
+
+# These settings are ignored on a publisher.
+
+#max_logical_replication_workers = 4 # taken from max_worker_processes
+ # (change requires restart)
+#max_sync_workers_per_subscription = 2 # taken from max_logical_replication_workers
+
+
+#------------------------------------------------------------------------------
+# QUERY TUNING
+#------------------------------------------------------------------------------
+
+# - Planner Method Configuration -
+
+#enable_bitmapscan = on
+#enable_hashagg = on
+#enable_hashjoin = on
+#enable_indexscan = on
+#enable_indexonlyscan = on
+#enable_material = on
+#enable_mergejoin = on
+#enable_nestloop = on
+enable_seqscan = off
+#enable_sort = on
+#enable_tidscan = on
+
+# - Planner Cost Constants -
+
+seq_page_cost = 1.0 # measured on an arbitrary scale
+random_page_cost = 1.0 # same scale as above
+#cpu_tuple_cost = 0.01 # same scale as above
+#cpu_index_tuple_cost = 0.005 # same scale as above
+#cpu_operator_cost = 0.0025 # same scale as above
+#parallel_tuple_cost = 0.1 # same scale as above
+#parallel_setup_cost = 1000.0 # same scale as above
+#min_parallel_table_scan_size = 8MB
+#min_parallel_index_scan_size = 512kB
+#effective_cache_size = 4GB
+
+# - Genetic Query Optimizer -
+
+#geqo = on
+#geqo_threshold = 12
+#geqo_effort = 5 # range 1-10
+#geqo_pool_size = 0 # selects default based on effort
+#geqo_generations = 0 # selects default based on effort
+#geqo_selection_bias = 2.0 # range 1.5-2.0
+#geqo_seed = 0.0 # range 0.0-1.0
+
+# - Other Planner Options -
+
+#default_statistics_target = 100 # range 1-10000
+#constraint_exclusion = partition # on, off, or partition
+#cursor_tuple_fraction = 0.1 # range 0.0-1.0
+#from_collapse_limit = 8
+#join_collapse_limit = 8 # 1 disables collapsing of explicit
+ # JOIN clauses
+#force_parallel_mode = off
+
+
+#------------------------------------------------------------------------------
+# ERROR REPORTING AND LOGGING
+#------------------------------------------------------------------------------
+
+# - Where to Log -
+
+log_destination = csvlog # Valid values are combinations of
+ # stderr, csvlog, syslog, and eventlog,
+ # depending on platform. csvlog
+ # requires logging_collector to be on.
+
+# This is used when logging to stderr:
+logging_collector = on # Enable capturing of stderr and csvlog
+ # into log files. Required to be on for
+ # csvlogs.
+ # (change requires restart)
+
+# These are only used if logging_collector is on:
+log_directory = 'log' # directory where log files are written,
+ # can be absolute or relative to PGDATA
+log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
+ # can include strftime() escapes
+#log_file_mode = 0600 # creation mode for log files,
+ # begin with 0 to use octal notation
+#log_truncate_on_rotation = off # If on, an existing log file with the
+ # same name as the new log file will be
+ # truncated rather than appended to.
+ # But such truncation only occurs on
+ # time-driven rotation, not on restarts
+ # or size-driven rotation. Default is
+ # off, meaning append to existing files
+ # in all cases.
+#log_rotation_age = 1d # Automatic rotation of logfiles will
+ # happen after that time. 0 disables.
+#log_rotation_size = 10MB # Automatic rotation of logfiles will
+ # happen after that much log output.
+ # 0 disables.
+
+# These are relevant when logging to syslog:
+#syslog_facility = 'LOCAL0'
+#syslog_ident = 'postgres'
+#syslog_sequence_numbers = on
+#syslog_split_messages = on
+
+# This is only relevant when logging to eventlog (win32):
+# (change requires restart)
+#event_source = 'PostgreSQL'
+
+# - When to Log -
+
+#client_min_messages = notice # values in order of decreasing detail:
+ # debug5
+ # debug4
+ # debug3
+ # debug2
+ # debug1
+ # log
+ # notice
+ # warning
+ # error
+
+#log_min_messages = warning # values in order of decreasing detail:
+ # debug5
+ # debug4
+ # debug3
+ # debug2
+ # debug1
+ # info
+ # notice
+ # warning
+ # error
+ # log
+ # fatal
+ # panic
+
+#log_min_error_statement = error # values in order of decreasing detail:
+ # debug5
+ # debug4
+ # debug3
+ # debug2
+ # debug1
+ # info
+ # notice
+ # warning
+ # error
+ # log
+ # fatal
+ # panic (effectively off)
+
+#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
+ # and their durations, > 0 logs only
+ # statements running at least this number
+ # of milliseconds
+
+
+# - What to Log -
+
+#debug_print_parse = off
+#debug_print_rewritten = off
+#debug_print_plan = off
+#debug_pretty_print = on
+#log_checkpoints = off
+#log_connections = off
+#log_disconnections = off
+#log_duration = off
+#log_error_verbosity = default # terse, default, or verbose messages
+#log_hostname = off
+#log_line_prefix = '%m [%p] ' # special values:
+ # %a = application name
+ # %u = user name
+ # %d = database name
+ # %r = remote host and port
+ # %h = remote host
+ # %p = process ID
+ # %t = timestamp without milliseconds
+ # %m = timestamp with milliseconds
+ # %n = timestamp with milliseconds (as a Unix epoch)
+ # %i = command tag
+ # %e = SQL state
+ # %c = session ID
+ # %l = session line number
+ # %s = session start timestamp
+ # %v = virtual transaction ID
+ # %x = transaction ID (0 if none)
+ # %q = stop here in non-session
+ # processes
+ # %% = '%'
+ # e.g. '<%u%%%d> '
+#log_lock_waits = off # log lock waits >= deadlock_timeout
+#log_statement = 'none' # none, ddl, mod, all
+#log_replication_commands = off
+#log_temp_files = -1 # log temporary files equal or larger
+ # than the specified size in kilobytes;
+ # -1 disables, 0 logs all temp files
+log_timezone = 'Europe/Berlin'
+
+
+# - Process Title -
+
+#cluster_name = '' # added to process titles if nonempty
+ # (change requires restart)
+#update_process_title = on
+
+
+#------------------------------------------------------------------------------
+# RUNTIME STATISTICS
+#------------------------------------------------------------------------------
+
+# - Query/Index Statistics Collector -
+
+#track_activities = on
+#track_counts = on
+#track_io_timing = off
+#track_functions = none # none, pl, all
+#track_activity_query_size = 1024 # (change requires restart)
+#stats_temp_directory = 'pg_stat_tmp'
+
+
+# - Statistics Monitoring -
+
+#log_parser_stats = off
+#log_planner_stats = off
+#log_executor_stats = off
+#log_statement_stats = off
+
+
+#------------------------------------------------------------------------------
+# AUTOVACUUM PARAMETERS
+#------------------------------------------------------------------------------
+
+#autovacuum = on # Enable autovacuum subprocess? 'on'
+ # requires track_counts to also be on.
+#log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and
+ # their durations, > 0 logs only
+ # actions running at least this number
+ # of milliseconds.
+#autovacuum_max_workers = 3 # max number of autovacuum subprocesses
+ # (change requires restart)
+#autovacuum_naptime = 1min # time between autovacuum runs
+#autovacuum_vacuum_threshold = 50 # min number of row updates before
+ # vacuum
+#autovacuum_analyze_threshold = 50 # min number of row updates before
+ # analyze
+#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
+#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
+#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
+ # (change requires restart)
+#autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age
+ # before forced vacuum
+ # (change requires restart)
+#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for
+ # autovacuum, in milliseconds;
+ # -1 means use vacuum_cost_delay
+#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for
+ # autovacuum, -1 means use
+ # vacuum_cost_limit
+
+
+#------------------------------------------------------------------------------
+# CLIENT CONNECTION DEFAULTS
+#------------------------------------------------------------------------------
+
+# - Statement Behavior -
+
+#search_path = '"$user", public' # schema names
+#default_tablespace = '' # a tablespace name, '' uses the default
+#temp_tablespaces = '' # a list of tablespace names, '' uses
+ # only default tablespace
+#check_function_bodies = on
+#default_transaction_isolation = 'read committed'
+#default_transaction_read_only = off
+#default_transaction_deferrable = off
+#session_replication_role = 'origin'
+#statement_timeout = 0 # in milliseconds, 0 is disabled
+#lock_timeout = 0 # in milliseconds, 0 is disabled
+#idle_in_transaction_session_timeout = 0 # in milliseconds, 0 is disabled
+#vacuum_freeze_min_age = 50000000
+#vacuum_freeze_table_age = 150000000
+#vacuum_multixact_freeze_min_age = 5000000
+#vacuum_multixact_freeze_table_age = 150000000
+#bytea_output = 'hex' # hex, escape
+#xmlbinary = 'base64'
+#xmloption = 'content'
+#gin_fuzzy_search_limit = 0
+#gin_pending_list_limit = 4MB
+
+# - Locale and Formatting -
+
+datestyle = 'iso, mdy'
+#intervalstyle = 'postgres'
+timezone = 'Europe/Berlin'
+#timezone_abbreviations = 'Default' # Select the set of available time zone
+ # abbreviations. Currently, there are
+ # Default
+ # Australia (historical usage)
+ # India
+ # You can create your own file in
+ # share/timezonesets/.
+#extra_float_digits = 0 # min -15, max 3
+#client_encoding = sql_ascii # actually, defaults to database
+ # encoding
+
+# These settings are initialized by initdb, but they can be changed.
+lc_messages = 'en_US.utf8' # locale for system error message
+ # strings
+lc_monetary = 'en_US.utf8' # locale for monetary formatting
+lc_numeric = 'en_US.utf8' # locale for number formatting
+lc_time = 'en_US.utf8' # locale for time formatting
+
+# default configuration for text search
+default_text_search_config = 'pg_catalog.english'
+
+# - Other Defaults -
+
+#dynamic_library_path = '$libdir'
+#local_preload_libraries = ''
+#session_preload_libraries = ''
+
+
+#------------------------------------------------------------------------------
+# LOCK MANAGEMENT
+#------------------------------------------------------------------------------
+
+deadlock_timeout = 5s
+max_locks_per_transaction = 4096 # min 10
+ # (change requires restart)
+max_pred_locks_per_transaction = 1024 # min 10
+ # (change requires restart)
+max_pred_locks_per_relation = 512 # negative values mean
+ # (max_pred_locks_per_transaction
+ # / -max_pred_locks_per_relation) - 1
+max_pred_locks_per_page = 1024 # min 0
+
+
+#------------------------------------------------------------------------------
+# VERSION/PLATFORM COMPATIBILITY
+#------------------------------------------------------------------------------
+
+# - Previous PostgreSQL Versions -
+
+#array_nulls = on
+#backslash_quote = safe_encoding # on, off, or safe_encoding
+#default_with_oids = off
+#escape_string_warning = on
+#lo_compat_privileges = off
+#operator_precedence_warning = off
+#quote_all_identifiers = off
+#standard_conforming_strings = on
+#synchronize_seqscans = on
+
+# - Other Platforms and Clients -
+
+#transform_null_equals = off
+
+
+#------------------------------------------------------------------------------
+# ERROR HANDLING
+#------------------------------------------------------------------------------
+
+#exit_on_error = off # terminate session on any error?
+#restart_after_crash = on # reinitialize after backend crash?
+
+
+#------------------------------------------------------------------------------
+# CONFIG FILE INCLUDES
+#------------------------------------------------------------------------------
+
+# These options allow settings to be loaded from files other than the
+# default postgresql.conf.
+
+#include_dir = 'conf.d' # include files ending in '.conf' from
+ # directory 'conf.d'
+#include_if_exists = 'exists.conf' # include file only if it exists
+#include = 'special.conf' # include file
+
+
+#------------------------------------------------------------------------------
+# CUSTOMIZED OPTIONS
+#------------------------------------------------------------------------------
+
+# Add settings for extensions here
diff --git a/bench/db-inmem/start_db.sh b/bench/db-inmem/start_db.sh
new file mode 100755
index 0000000..54af0d8
--- /dev/null
+++ b/bench/db-inmem/start_db.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+nohup postgres -D /dev/shm/talerdb-inmem/ -k /home/dold/sockets -h "" >/dev/shm/talerdb-inmem/nohup.out &
+disown $!
diff --git a/bench/db-inmem/start_db_tcp.sh b/bench/db-inmem/start_db_tcp.sh
new file mode 100755
index 0000000..575e45f
--- /dev/null
+++ b/bench/db-inmem/start_db_tcp.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+nohup postgres -D /dev/shm/talerdb-inmem/ -k 5432 >/dev/shm/talerdb-inmem/nohup.out &
+disown $!
diff --git a/bench/dbsize.sql b/bench/dbsize.sql
new file mode 100644
index 0000000..4f4b238
--- /dev/null
+++ b/bench/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/bench/eval-basic.bash b/bench/eval-basic.bash
new file mode 100644
index 0000000..3b28ddc
--- /dev/null
+++ b/bench/eval-basic.bash
@@ -0,0 +1,23 @@
+#/usr/bin/env bash
+
+#set -eu
+#set -x
+
+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 ~/repos/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/bench/eval-latency.bash b/bench/eval-latency.bash
new file mode 100644
index 0000000..bbc49c0
--- /dev/null
+++ b/bench/eval-latency.bash
@@ -0,0 +1,26 @@
+#/usr/bin/env bash
+
+set -eu
+
+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
+}
+
+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/bench/exchange_benchmark_home/.config/taler/account-2.json b/bench/exchange_benchmark_home/.config/taler/account-2.json
new file mode 100644
index 0000000..5b577b0
--- /dev/null
+++ b/bench/exchange_benchmark_home/.config/taler/account-2.json
@@ -0,0 +1,4 @@
+{
+ "url": "payto://x-taler-bank/localhost:8081/2",
+ "master_sig": "2Q73CVJTE40JRK8BYAJ2X57FQJ0B505DT4ZE03J0AH3KSDH8Y3KAP4JX2BXP6ATZNV31KBFATNWVGW6TGXPJKNM0QP7B563CV68WR2R"
+} \ No newline at end of file
diff --git a/bench/exchange_benchmark_home/.config/taler/account-2.json~ b/bench/exchange_benchmark_home/.config/taler/account-2.json~
new file mode 100644
index 0000000..2abb776
--- /dev/null
+++ b/bench/exchange_benchmark_home/.config/taler/account-2.json~
@@ -0,0 +1,10 @@
+{
+ "url": "payto://x-taler-bank/localhost:8082/2",
+<<<<<<< Updated upstream
+ "salt": "6TBY14X6YB6D0J2PGKQX0VVV30118QEQG1R3PYP1GG5XWXHST3ZQ1J3R6EQ85HZXS8DFDTRJN6JGBT8KDQFT0KVFPMGXTWHWC7E1518",
+ "master_sig": "CET51EPQGW01BVQMFXQKYW0BMWGQJJT7QTMGNW1FXYC6T6AB1CRK14S5PH5V34JDX7J8JJPVNV3VKXKH4CM1SVRQTFC5QVVDMJ3JM30"
+=======
+ "salt": "PM2T91BE8JK056D9041ZYDX1DSTAQ1YQNBXKVPMHDM8QRMEKKM7KYC1MPPT4J4PDFSG0R8DQZV982NS2TB9MF8PAVQZT8WN96H025J8",
+ "master_sig": "T881WQKDTNKQP5XCQHR2HD5QYPCPNZJ327W6GH1QQF2NRCH22JQWBKHNPKK6K8T6CNVNJ2E3XHR25X7RCAJ9YAEQRG9235J42JPRE20"
+>>>>>>> Stashed changes
+} \ No newline at end of file
diff --git a/bench/exchange_benchmark_home/.local/share/taler/auditor/offline-keys/auditor.priv b/bench/exchange_benchmark_home/.local/share/taler/auditor/offline-keys/auditor.priv
new file mode 100644
index 0000000..af391e4
--- /dev/null
+++ b/bench/exchange_benchmark_home/.local/share/taler/auditor/offline-keys/auditor.priv
@@ -0,0 +1,2 @@
+D4
+B, > 9]w藍%s \ No newline at end of file
diff --git a/bench/exchange_benchmark_home/.local/share/taler/auditors/auditor.out b/bench/exchange_benchmark_home/.local/share/taler/auditors/auditor.out
new file mode 100644
index 0000000..720bc7f
--- /dev/null
+++ b/bench/exchange_benchmark_home/.local/share/taler/auditors/auditor.out
Binary files differ
diff --git a/bench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_0_01-BET734VZZ6FNXMZQAMR5/1557667679000000 b/bench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_0_01-BET734VZZ6FNXMZQAMR5/1557667679000000
new file mode 100755
index 0000000..cfb1c48
--- /dev/null
+++ b/bench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_0_01-BET734VZZ6FNXMZQAMR5/1557667679000000
Binary files differ
diff --git a/bench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_0_1-CV7VDF3H660XZ6AZY1SP/1557667679000000 b/bench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_0_1-CV7VDF3H660XZ6AZY1SP/1557667679000000
new file mode 100755
index 0000000..9864647
--- /dev/null
+++ b/bench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_0_1-CV7VDF3H660XZ6AZY1SP/1557667679000000
Binary files differ
diff --git a/bench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_1-AEYK51QMYFJ9ZFTN44K8/1557667679000000 b/bench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_1-AEYK51QMYFJ9ZFTN44K8/1557667679000000
new file mode 100755
index 0000000..839bd7b
--- /dev/null
+++ b/bench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_1-AEYK51QMYFJ9ZFTN44K8/1557667679000000
Binary files differ
diff --git a/bench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_10-X1VVTYSB7FDYPEFG27S9/1557667679000000 b/bench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_10-X1VVTYSB7FDYPEFG27S9/1557667679000000
new file mode 100755
index 0000000..a7d531e
--- /dev/null
+++ b/bench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_10-X1VVTYSB7FDYPEFG27S9/1557667679000000
Binary files differ
diff --git a/bench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_5-TSY4M0DQVXYFVRK1YTAB/1557667679000000 b/bench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_5-TSY4M0DQVXYFVRK1YTAB/1557667679000000
new file mode 100755
index 0000000..fb8c568
--- /dev/null
+++ b/bench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/denomkeys/EUR_5-TSY4M0DQVXYFVRK1YTAB/1557667679000000
Binary files differ
diff --git a/bench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/signkeys/1556667841000000 b/bench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/signkeys/1556667841000000
new file mode 100644
index 0000000..0dc00cd
--- /dev/null
+++ b/bench/exchange_benchmark_home/.local/share/taler/exchange/live-keys/signkeys/1556667841000000
Binary files differ
diff --git a/bench/exchange_benchmark_home/.local/share/taler/exchange/offline-keys/master.priv b/bench/exchange_benchmark_home/.local/share/taler/exchange/offline-keys/master.priv
new file mode 100644
index 0000000..3949269
--- /dev/null
+++ b/bench/exchange_benchmark_home/.local/share/taler/exchange/offline-keys/master.priv
@@ -0,0 +1 @@
+p^-33XX!\0qmU_ \ No newline at end of file
diff --git a/bench/exchange_benchmark_home/.local/share/taler/exchange/wirefees/x-taler-bank.fee b/bench/exchange_benchmark_home/.local/share/taler/exchange/wirefees/x-taler-bank.fee
new file mode 100644
index 0000000..68f27ca
--- /dev/null
+++ b/bench/exchange_benchmark_home/.local/share/taler/exchange/wirefees/x-taler-bank.fee
Binary files differ
diff --git a/bench/run-base.bash b/bench/run-base.bash
new file mode 100644
index 0000000..d3c208e
--- /dev/null
+++ b/bench/run-base.bash
@@ -0,0 +1,10 @@
+#/usr/bin/env bash
+
+
+export GNUNET_BENCHMARK_DIR=$(readlink -f ./stats)
+
+rm -rf stats
+taler-exchange-benchmark -c benchmark-local.conf -p 1 -n 10000 >& /dev/shm/benchmark.log
+mkdir -p "results/stats-1"
+cp -a stats "results/stats-1"/
+cp /dev/shm/benchmark.log "results/stats-1/"
diff --git a/bench/run-latency.bash b/bench/run-latency.bash
new file mode 100644
index 0000000..a6d7ced
--- /dev/null
+++ b/bench/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.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.conf -m client -p 1 -n 50 >> 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/bench/run-traffic.bash b/bench/run-traffic.bash
new file mode 100644
index 0000000..115f013
--- /dev/null
+++ b/bench/run-traffic.bash
@@ -0,0 +1,12 @@
+#/usr/bin/env bash
+
+
+export GNUNET_BENCHMARK_DIR=$(readlink -f ./stats)
+mkdir -p results
+
+ip -s link show enp4s0f0 > results/traffic-before.txt
+
+taler-exchange-benchmark -c benchmark-remote-gv.conf -m client -p 1 -n 10000 >& /dev/shm/benchmark.log
+cp /dev/shm/benchmark.log results/traffic.log
+
+ip -s link show enp4s0f0 > results/traffic-after.txt
diff --git a/bench/run.bash b/bench/run.bash
new file mode 100644
index 0000000..d020f9c
--- /dev/null
+++ b/bench/run.bash
@@ -0,0 +1,29 @@
+#/usr/bin/env bash
+
+set -eu
+set -x
+
+ulimit -c 4096
+
+export GNUNET_BENCHMARK_DIR=$(readlink -f ./stats)
+export GNUNET_FORCE_LOG=";;;;ERROR"
+
+DB=postgresql:///postgres?host=/home/dold/sockets
+
+for x in $(seq 10 10 190) $(seq 200 100 2000); do
+ if [[ -d "results/stats-$x" ]]; then
+ echo skipping existing results/stats-$x
+ continue
+ fi
+ echo running with $x clients
+
+ psql "$DB" -c "drop database if exists taler;"
+ psql "$DB" -c "create database taler;"
+ echo created db
+
+ 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"/
+ tail /dev/shm/benchmark.log > "results/stats-$x/benchmark.log"
+done
diff --git a/bench/set-latency.bash b/bench/set-latency.bash
new file mode 100644
index 0000000..793d46c
--- /dev/null
+++ b/bench/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"
+