[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-grid5k] 29/73: switch to transaction mode since otherwise its all
From: |
gnunet |
Subject: |
[taler-grid5k] 29/73: switch to transaction mode since otherwise its all the same as when pgbouncer not used at all |
Date: |
Tue, 14 Dec 2021 15:10:11 +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 6b404f5f7ae90deb8b05f9956b3b2bbe8f1d3506
Author: Boss Marco <bossm8@bfh.ch>
AuthorDate: Tue Nov 30 12:49:39 2021 +0100
switch to transaction mode since otherwise its all the same as when
pgbouncer not used at all
---
configs/etc/pgbouncer/pgbouncer.ini | 2 +-
experiment/scripts/database.sh | 16 +++++++++++++---
experiment/scripts/exchange.sh | 2 +-
experiment/scripts/helpers.sh | 1 +
4 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/configs/etc/pgbouncer/pgbouncer.ini
b/configs/etc/pgbouncer/pgbouncer.ini
index af1223c..c4140dc 100644
--- a/configs/etc/pgbouncer/pgbouncer.ini
+++ b/configs/etc/pgbouncer/pgbouncer.ini
@@ -10,7 +10,7 @@ listen_port = 6432
auth_type = md5
auth_file = /etc/pgbouncer/userlist.txt
-pool_mode = session
+pool_mode = transaction
max_client_conn = 500
default_pool_size = 20
diff --git a/experiment/scripts/database.sh b/experiment/scripts/database.sh
index fd20388..92d0cc3 100755
--- a/experiment/scripts/database.sh
+++ b/experiment/scripts/database.sh
@@ -27,7 +27,7 @@ function setup_config() {
wal_buffers=16MB
max_worker_processes=$(lscpu | grep "CPU(s)" | head -n 1 | awk '{print $2}')
- max_connections=200
+ max_connections=100
# out of shared memory
max_locks_per_transaction=85
@@ -41,16 +41,26 @@ function setup_config() {
# Enable password for taler since this is commonly the case
# For the postgres user do not enable authentication (used in metrics)
echo "
- host all ${DB_USER} 172.16.0.0/12 md5
+ # 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
+
+ sed -i -e "s/<DB_USER_HERE>/${DB_USER}/g" \
+ -e "s/<DB_PASSWORD_HERE>/${DB_PASSWORD}/g" \
+ /etc/pgbouncer/userlist.txt
+ sed -i -e "s/<DB_NAME_HERE>/${DB_NAME}/g" \
+ /etc/pgbouncer/pgbouncer.ini
}
if [[ "$1" == "init" ]]; then
setup_config
fi
+
+# pgbouncer does not cleanup those...
+rm -f /var/run/postgresql/pgbouncer.pid
+rm -f /var/run/postgresql/.s.PGSQL.6432
-systemctl restart postgresql
+systemctl restart postgresql pgbouncer
su postgres << EOF
psql postgres -tAc "SELECT 1 FROM pg_roles WHERE
rolname='taler-exchange-httpd'" | \
diff --git a/experiment/scripts/exchange.sh b/experiment/scripts/exchange.sh
index bb37d69..d6ed1ed 100755
--- a/experiment/scripts/exchange.sh
+++ b/experiment/scripts/exchange.sh
@@ -2,7 +2,7 @@
set -eux
function setup_config() {
- sed -i
"s\<DB_URL_HERE>\postgresql://${DB_USER}:${DB_PASSWORD}@${DATABASE_DOMAIN}/${DB_NAME}\g"
\
+ sed -i
"s\<DB_URL_HERE>\postgresql://${DB_USER}:${DB_PASSWORD}@${DATABASE_DOMAIN}:6432/${DB_NAME}\g"
\
/etc/taler/secrets/exchange-db.secret.conf
sed -i "s/<BANK_HOST_HERE>/${BANK_DOMAIN}/g" \
diff --git a/experiment/scripts/helpers.sh b/experiment/scripts/helpers.sh
index 683d644..00ecac9 100755
--- a/experiment/scripts/helpers.sh
+++ b/experiment/scripts/helpers.sh
@@ -43,6 +43,7 @@ function wait_for_db() {
-h "${DATABASE_DOMAIN}" \
-U "${DB_USER}" \
-d "${DB_NAME}" \
+ -p "6432" \
-c '\q';
do
echo "Database not ready yet"
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-grid5k] 31/73: pgbouncer still occupying 6432 even when stopped, (continued)
- [taler-grid5k] 31/73: pgbouncer still occupying 6432 even when stopped, gnunet, 2021/12/14
- [taler-grid5k] 35/73: some more pgbouncer config, gnunet, 2021/12/14
- [taler-grid5k] 27/73: rename userlist, gnunet, 2021/12/14
- [taler-grid5k] 20/73: issue in logbackup, gnunet, 2021/12/14
- [taler-grid5k] 19/73: running make two times seems to work, gnunet, 2021/12/14
- [taler-grid5k] 10/73: update service files, gnunet, 2021/12/14
- [taler-grid5k] 34/73: exporter for merchant now on monitor too, gnunet, 2021/12/14
- [taler-grid5k] 24/73: cleanup with functions - try work_mem and idle_in_transaction, gnunet, 2021/12/14
- [taler-grid5k] 15/73: build wallet from source since dist does not work, gnunet, 2021/12/14
- [taler-grid5k] 25/73: enable postgres-exporter again, gnunet, 2021/12/14
- [taler-grid5k] 29/73: switch to transaction mode since otherwise its all the same as when pgbouncer not used at all,
gnunet <=
- [taler-grid5k] 23/73: disable pgbouncer per default, gnunet, 2021/12/14
- [taler-grid5k] 52/73: possible to configure max_requests with env file, gnunet, 2021/12/14
- [taler-grid5k] 22/73: add pgbouncer, tune pg config, gnunet, 2021/12/14
- [taler-grid5k] 16/73: fix wallet build - broken on master, gnunet, 2021/12/14
- [taler-grid5k] 61/73: refactor db.sh, gnunet, 2021/12/14
- [taler-grid5k] 30/73: increase default pool size, gnunet, 2021/12/14
- [taler-grid5k] 43/73: update config of db and exch, gnunet, 2021/12/14
- [taler-grid5k] 44/73: -resolve conflict, gnunet, 2021/12/14
- [taler-grid5k] 41/73: update installer script, gnunet, 2021/12/14
- [taler-grid5k] 54/73: enable huge_pages, implement exchange scrape logic, gnunet, 2021/12/14