gnunet-svn
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]