[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-grid5k] 03/05: add postgres version config
From: |
gnunet |
Subject: |
[taler-grid5k] 03/05: add postgres version config |
Date: |
Tue, 21 Dec 2021 20:38:56 +0100 |
This is an automated email from the git hooks/post-receive script.
marco-boss pushed a commit to branch master
in repository grid5k.
commit 611ea47a1e85c019f10bef9b6a18bb2a8dca8efb
Author: Boss Marco <bossm8@bfh.ch>
AuthorDate: Wed Dec 15 11:04:35 2021 +0100
add postgres version config
---
additional/grafana/transactions.json | 205 +++++++++++++++++++++++++++++------
additional/plots/config.yaml | 2 +-
experiment/env | 11 +-
experiment/scripts/database.sh | 20 ++--
experiment/scripts/merchant.sh | 4 +-
5 files changed, 191 insertions(+), 51 deletions(-)
diff --git a/additional/grafana/transactions.json
b/additional/grafana/transactions.json
index 7b7d4f8..7fdaeea 100644
--- a/additional/grafana/transactions.json
+++ b/additional/grafana/transactions.json
@@ -1,5 +1,13 @@
{
"__inputs": [
+ {
+ "name": "DS_PROMETHEUS",
+ "label": "Prometheus",
+ "description": "",
+ "type": "datasource",
+ "pluginId": "prometheus",
+ "pluginName": "Prometheus"
+ },
{
"name": "DS_LOKI",
"label": "Loki",
@@ -29,6 +37,12 @@
"name": "Loki",
"version": "1.0.0"
},
+ {
+ "type": "datasource",
+ "id": "prometheus",
+ "name": "Prometheus",
+ "version": "1.0.0"
+ },
{
"type": "panel",
"id": "stat",
@@ -144,7 +158,6 @@
"type": "stat"
},
{
- "description": "Number of exchange processes running",
"fieldConfig": {
"defaults": {
"color": {
@@ -157,6 +170,10 @@
{
"color": "green",
"value": null
+ },
+ {
+ "color": "red",
+ "value": 80
}
]
}
@@ -166,14 +183,14 @@
"gridPos": {
"h": 4,
"w": 3,
- "x": 6,
+ "x": 3,
"y": 1
},
- "id": 8,
+ "id": 59,
"options": {
- "colorMode": "value",
+ "colorMode": "none",
"graphMode": "area",
- "justifyMode": "auto",
+ "justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": [
@@ -182,25 +199,92 @@
"fields": "",
"values": false
},
- "text": {},
"textMode": "auto"
},
"pluginVersion": "8.3.2",
"targets": [
{
- "exemplar": true,
- "expr":
"sum(node_systemd_unit_state{name=~\"taler-exchange-http(.*).service\",
state=\"active\"})",
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "exemplar": false,
+ "expr": "count(go_info{instance=~\"wallet(.*)\"})",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
- "title": "# Exchange",
+ "title": "# Wallet Nodes",
"type": "stat"
},
{
- "description": "Number of wirewatch processes running",
+ "description": "The load of all wallet hosts together",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "max": 100,
+ "min": 0,
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "percent"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 4,
+ "w": 3,
+ "x": 6,
+ "y": 1
+ },
+ "id": 57,
+ "options": {
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showThresholdLabels": false,
+ "showThresholdMarkers": true,
+ "text": {}
+ },
+ "pluginVersion": "8.3.2",
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "exemplar": false,
+ "expr": "((count(go_info{instance=~\"wallet(.*)\"}) * 100) -
sum((avg by(instance) (irate(node_cpu_seconds_total{mode=\"idle\",
instance=~\"wallet(.*)\"}[5m])) * 100))) /
count(go_info{instance=~\"wallet(.*)\"})",
+ "interval": "",
+ "legendFormat": "",
+ "refId": "A"
+ }
+ ],
+ "title": "Wallet Load [Experimental]",
+ "type": "gauge"
+ },
+ {
+ "description": "Number of exchange processes running",
"fieldConfig": {
"defaults": {
"color": {
@@ -222,10 +306,10 @@
"gridPos": {
"h": 4,
"w": 3,
- "x": 9,
+ "x": 12,
"y": 1
},
- "id": 41,
+ "id": 8,
"options": {
"colorMode": "value",
"graphMode": "area",
@@ -245,14 +329,14 @@
"targets": [
{
"exemplar": true,
- "expr":
"sum(node_systemd_unit_state{name=~\"taler-exchange-wirewatch(.*).service\",
state=\"active\"})",
+ "expr":
"sum(node_systemd_unit_state{name=~\"taler-exchange-http(.*).service\",
state=\"active\"})",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
- "title": "# Wirewatch",
+ "title": "# Exchange",
"type": "stat"
},
{
@@ -291,9 +375,9 @@
"overrides": []
},
"gridPos": {
- "h": 4,
- "w": 3,
- "x": 12,
+ "h": 2,
+ "w": 2,
+ "x": 16,
"y": 1
},
"id": 46,
@@ -364,7 +448,7 @@
"gridPos": {
"h": 2,
"w": 2,
- "x": 15,
+ "x": 18,
"y": 1
},
"id": 50,
@@ -436,7 +520,7 @@
"gridPos": {
"h": 2,
"w": 2,
- "x": 17,
+ "x": 20,
"y": 1
},
"id": 49,
@@ -541,6 +625,62 @@
"title": "Loki",
"type": "stat"
},
+ {
+ "description": "Number of wirewatch processes running",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 2,
+ "w": 2,
+ "x": 16,
+ "y": 3
+ },
+ "id": 41,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "area",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "text": {},
+ "textMode": "auto"
+ },
+ "pluginVersion": "8.3.2",
+ "targets": [
+ {
+ "exemplar": true,
+ "expr":
"sum(node_systemd_unit_state{name=~\"taler-exchange-wirewatch(.*).service\",
state=\"active\"})",
+ "instant": true,
+ "interval": "",
+ "legendFormat": "",
+ "refId": "A"
+ }
+ ],
+ "title": "# Wirewatch",
+ "type": "stat"
+ },
{
"fieldConfig": {
"defaults": {
@@ -579,7 +719,7 @@
"gridPos": {
"h": 2,
"w": 2,
- "x": 15,
+ "x": 18,
"y": 3
},
"id": 52,
@@ -650,7 +790,7 @@
"gridPos": {
"h": 2,
"w": 2,
- "x": 17,
+ "x": 20,
"y": 3
},
"id": 51,
@@ -922,7 +1062,7 @@
"type": "linear"
},
"showPoints": "never",
- "spanNulls": true,
+ "spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
@@ -1125,8 +1265,7 @@
"mode": "absolute",
"steps": [
{
- "color": "green",
- "value": null
+ "color": "green"
}
]
}
@@ -1183,8 +1322,7 @@
"mode": "absolute",
"steps": [
{
- "color": "green",
- "value": null
+ "color": "green"
}
]
}
@@ -1259,7 +1397,7 @@
"type": "linear"
},
"showPoints": "never",
- "spanNulls": true,
+ "spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
@@ -1273,8 +1411,7 @@
"mode": "absolute",
"steps": [
{
- "color": "green",
- "value": null
+ "color": "green"
}
]
},
@@ -1328,8 +1465,7 @@
"mode": "absolute",
"steps": [
{
- "color": "green",
- "value": null
+ "color": "green"
}
]
}
@@ -1387,8 +1523,7 @@
"mode": "absolute",
"steps": [
{
- "color": "green",
- "value": null
+ "color": "green"
},
{
"color": "red",
@@ -1798,13 +1933,13 @@
"list": []
},
"time": {
- "from": "now-1h",
+ "from": "now-90m",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Transactions",
"uid": "83vvgKKnk",
- "version": 84,
+ "version": 87,
"weekStart": ""
}
\ No newline at end of file
diff --git a/additional/plots/config.yaml b/additional/plots/config.yaml
index 679e791..ca3094b 100644
--- a/additional/plots/config.yaml
+++ b/additional/plots/config.yaml
@@ -21,7 +21,7 @@ dashboards:
variables: ['db', 'server']
graph:
width: 1200
- height: 600
+ height: 500
- uid: MsjffzSZz # Proxy
graph:
width: 1200
diff --git a/experiment/env b/experiment/env
index a0f3e9d..e1861e9 100644
--- a/experiment/env
+++ b/experiment/env
@@ -4,7 +4,10 @@
# Make sure to name all hosts with the following format in jFed:
# 'Role'-N, add only 'Role' here, setup.sh will determine the rest.
# Nodes listed here will be parsed and exported in
-# <ROLE>_HOSTS=<Grid5000-node[s]>
+# <ROLE>_HOSTS=<Grid5000-node[s]>
+# (used to determine which script to execute in run.sh)
+# Wallets are not needed explicitely since they can (and will be)
+# exported as a wildcard (*).
NODES="Bank DB DNS Exchange Merchant Monitor Proxy"
# DNS Zone to setup inside the grid for the experiment
@@ -19,7 +22,7 @@ G5K_COMMIT_SHA=master
# Domain names for the hosts inside the grid.
# The most certainly do not need to be adjusted.
-# If you do anyway make sure the wallets contain a wildcard (*)
+# If you do anyway, make sure the wallets contain a wildcard (*)
# Otherwise the experiment will not work
BANK_DOMAIN=bank.${DNS_ZONE}
DATABASE_DOMAIN=db.${DNS_ZONE}
@@ -48,7 +51,7 @@ EXCHANGE_CMD_PREFIX=""
# Maximal number of requests an exchange process should handle
# before it kills itself
-EXCHANGE_MAX_REQUESTS=10000
+EXCHANGE_MAX_REQUESTS=8192
# Datasource names registered in the grafana instance
PROMETHEUS_DATASOURCE_NAME=Prometheus
@@ -61,6 +64,8 @@ LOKI_DATASOURCE_NAME=Loki
PROMETHEUS_G5K_PROXY_PORT=http8080
LOKI_G5K_PROXY_PORT=http
+# Which version of postgres is installed in the environment
+POSTGRES_VERSION=13
# Exchange database configuration
DB_NAME=taler-exchange
DB_USER=taler
diff --git a/experiment/scripts/database.sh b/experiment/scripts/database.sh
index 614a27a..b19cabf 100755
--- a/experiment/scripts/database.sh
+++ b/experiment/scripts/database.sh
@@ -17,18 +17,18 @@ function setup_disks() {
if [[ "$(hostname)" =~ "dahu" ]]; then
mkdir /mnt/sdb || true
mount /dev/sdb /mnt/sdb || true
- if [ ! -L /var/lib/postgresql/13/main/pg_wal ]; then
+ if [ ! -L /var/lib/postgresql/${POSTGRES_VERSION}/main/pg_wal ]; then
rm -rf /mnt/sdb/pg_wal || true
- mv /var/lib/postgresql/13/main/pg_wal/ /mnt/sdb
- ln -s /mnt/sdb/pg_wal /var/lib/postgresql/13/main/pg_wal
- chown -R postgres:postgres /var/lib/postgresql/13/main/pg_wal/
+ mv /var/lib/postgresql/${POSTGRES_VERSION}/main/pg_wal/ /mnt/sdb
+ ln -s /mnt/sdb/pg_wal /var/lib/postgresql/${POSTGRES_VERSION}/main/pg_wal
+ chown -R postgres:postgres
/var/lib/postgresql/${POSTGRES_VERSION}/main/pg_wal/
fi
fi
}
function setup_ram_storage() {
SIZE=$(($(awk '/MemTotal/ {print $2}' /proc/meminfo) / 10))
- if ! df -h | grep /var/lib/postgresql; then
+ if ! df | grep -q /var/lib/postgresql; then
mv /var/lib/postgresql /var/lib/postgresql.bak
mkdir /var/lib/postgresql
chown postgres:postgres /var/lib/postgresql
@@ -45,11 +45,11 @@ function setup_config() {
# Enable password for taler since this is the case in real world deployments
# For the postgres user do not enable authentication (used in metrics)
if ! grep -q "host all ${DB_USER} 127.16.0.0/12 md5" \
- /etc/postgresql/13/main/pg_hba.conf; then
+ /etc/postgresql/${POSTGRES_VERSION}/main/pg_hba.conf; then
echo "
host all ${DB_USER} 172.16.0.0/12 md5
host all postgres 172.16.0.0/12 trust
- " >> /etc/postgresql/13/main/pg_hba.conf
+ " >> /etc/postgresql/${POSTGRES_VERSION}/main/pg_hba.conf
fi
# Get hardware info to tune in postgresql.conf
@@ -114,12 +114,12 @@ function setup_config() {
maintenance_work_mem=2GB
# 1 min
idle_in_transaction_session_timeout=60000
- " > /etc/postgresql/13/main/exchange.conf
+ " > /etc/postgresql/${POSTGRES_VERSION}/main/exchange.conf
if ! grep -q "include = 'exchange.conf'" \
- /etc/postgresql/13/main/postgresql.conf; then
+ /etc/postgresql/${POSTGRES_VERSION}/main/postgresql.conf; then
echo "include = 'exchange.conf'" >> \
- /etc/postgresql/13/main/postgresql.conf
+ /etc/postgresql/${POSTGRES_VERSION}/main/postgresql.conf
fi
}
diff --git a/experiment/scripts/merchant.sh b/experiment/scripts/merchant.sh
index 62d1ba3..e35ffbe 100755
--- a/experiment/scripts/merchant.sh
+++ b/experiment/scripts/merchant.sh
@@ -34,13 +34,13 @@ function configure_db() {
# Allow the remote hosts (monitor) access with the postgres user
echo "
host all postgres 172.16.0.0/12 trust
- " >> /etc/postgresql/13/main/pg_hba.conf
+ " >> /etc/postgresql/${POSTGRES_VERSION}/main/pg_hba.conf
# Listen on all interfaces so the monitors db exporter can reach the db
echo "
listen_addresses='*'
shared_preload_libraries='pg_stat_statements,auto_explain'
- " >> /etc/postgresql/13/main/postgresql.conf
+ " >> /etc/postgresql/${POSTGRES_VERSION}/main/postgresql.conf
}
# Start postgres an initialize the merchant's database
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.