GithubHelp home page GithubHelp logo

Comments (4)

jflambert avatar jflambert commented on August 28, 2024 1

Could you share a (simplified) docker-compose here

Did this happen with prior versions of pgbouncer?

from docker-pgbouncer.

zN3utr4l avatar zN3utr4l commented on August 28, 2024

This is the first Pgbouncer version i tried

Docker Compose:

version: 3.9

services:
    timescaledb:
        image: timescaledb:2.7.2-pg14
        container_name: timescale
        environment:
            - POSTGRES_PASSWORD=$POSTGRES_PASSWORD
            - POSTGRES_DB=$POSTGRES_DB
            - POSTGRES_HOST_AUTH_METHOD=scram-sha-256
        command: -c config_file=/etc/postgresql.conf
        networks:
            DefaultNet:
                ipv4_address: 172.20.0.5
        volumes:
            - certs:/Certs/Analyser
        ports:
            - 5432:5432

    pgbouncer:
        image: pgbouncer:1.17.0
        restart: always
        networks:
            DefaultNet:
                ipv4_address: 172.20.0.9
        ports:
            - 6432:6432
        volumes:
            - certs:/Certs/Analyser
        depends_on:
            - timescaledb

volumes:
    certs_analyser:
        name: certs

networks:
    DefaultNet:
        name: internal_network
        ipam:
            config:
                - subnet: 172.20.0.0/24

pgbouncer.ini

################## Auto generated ##################
[databases]
TEST= host=172.20.0.5 port=5432 user=postgres

;; Configuration section
[pgbouncer]

;;;
;;; Administrative settings
;;;

logfile = /etc/pgbouncer/pgbouncer.log
pidfile = /var/run/pgbouncer/pgbouncer.pid

;;;
;;; Where to wait for clients
;;;

;; IP address or * which means all IPs
listen_addr = 172.20.0.9, 127.0.0.1, localhost
listen_port = 6432

;; Unix socket is also used for -R.
;; On Debian it should be /var/run/postgresql
;unix_socket_dir = /tmp
;unix_socket_mode = 0777
;unix_socket_group =

;;;
;;; TLS settings for accepting clients
;;;

;; disable, allow, require, verify-ca, verify-full
client_tls_sslmode = allow

;; Path to file that contains trusted CA certs
client_tls_ca_file = /Certs/Analyser/TimeScaleDBCert/testca/cacert.pem

;; Private key and cert to present to clients.
;; Required for accepting TLS connections from clients.
client_tls_key_file = /Certs/Analyser/TimeScaleDBCert/client/key.pem
client_tls_cert_file = /Certs/Analyser/TimeScaleDBCert/client/cert.pem

;; fast, normal, secure, legacy, <ciphersuite string>
client_tls_ciphers = HIGH:MEDIUM:+3DES:!aNULL

;; all, secure, tlsv1.0, tlsv1.1, tlsv1.2, tlsv1.3
client_tls_protocols = tlsv1.2

;; none, auto, legacy
client_tls_dheparams = auto

;; none, auto, <curve name>
client_tls_ecdhcurve = auto

;;;
;;; TLS settings for connecting to backend databases
;;;

;; disable, allow, require, verify-ca, verify-full
server_tls_sslmode = allow

;; Path to that contains trusted CA certs
server_tls_ca_file = /Certs/Analyser/TimeScaleDBCert/testca/cacert.pem

;; Private key and cert to present to backend.
;; Needed only if backend server require client cert.
server_tls_key_file = /Certs/Analyser/TimeScaleDBCert/client/key.pem
server_tls_cert_file = /Certs/Analyser/TimeScaleDBCert/client/cert.pem

;; all, secure, tlsv1.0, tlsv1.1, tlsv1.2, tlsv1.3
server_tls_protocols = tlsv1.2

;; fast, normal, secure, legacy, <ciphersuite string>
server_tls_ciphers = HIGH:MEDIUM:+3DES:!aNULL

;;;
;;; Authentication settings
;;;

;; any, trust, plain, md5, cert, hba, pam, scram-sha-256

auth_type = scram-sha-256
auth_file = /etc/pgbouncer/userlist.txt

;; Path to HBA-style auth config
;auth_hba_file = /etc/pgbouncer/pg_hba.hba

;; Query to use to fetch password from database.  Result
;; must have 2 columns - username and password hash.
; auth_query = SELECT usename, passwd FROM pg_shadow WHERE usename=$1

;;;
;;; Users allowed into database 'pgbouncer'
;;;

;; comma-separated list of users who are allowed to change settings
admin_users = postgres

;; comma-separated list of users who are just allowed to use SHOW command
stats_users = postgres

;;;
;;; Pooler personality questions
;;;

;; When server connection is released back to pool:
;;   session      - after client disconnects (default)
;;   transaction  - after transaction finishes
;;   statement    - after statement finishes
pool_mode = transaction

;; Query for cleaning connection immediately after releasing from
;; client.  No need to put ROLLBACK here, pgbouncer does not reuse
;; connections where transaction is left open.
server_reset_query = DISCARD ALL
;;;
;;; Connection limits
;;;

;; Total number of clients that can connect
max_client_conn = 1000

;; Default pool size.  20 is good number when transaction pooling
;; is in use, in session pooling it needs to be the number of
;; max clients you want to handle at any moment
default_pool_size = 35

;; Minimum number of server connections to keep in pool.
;min_pool_size = 0

; how many additional connection to allow in case of trouble
reserve_pool_size = 10

;; If a clients needs to wait more than this many seconds, use reserve
;; pool.
reserve_pool_timeout = 3

;; Maximum number of server connections for a database
max_db_connections = 150

;;;
;;; Logging
;;;

;; Syslog settings
syslog = 0
syslog_facility = daemon
syslog_ident = pgbouncer

;; log if client connects or server connection is made
log_connections = 1

;; log if and why connection was closed
log_disconnections = 1

;; log error messages pooler sends to clients
log_pooler_errors = 1

;; write aggregated stats into log
log_stats = 1

;; Logging verbosity.  Same as -v switch on command line.
verbose = 0

;;;
;;; Timeouts
;;;

;; Close server connection if its been connected longer.
server_lifetime = 3600

;; Close server connection if its not been used in this time.  Allows
;; to clean unnecessary connections from pool after peak.
server_idle_timeout = 120

;; Cancel connection attempt if server does not answer takes longer.
server_connect_timeout = 15

;; If server login failed (server_connect_timeout or auth failure)
;; then wait this many second before trying again.
server_login_retry = 3

;; Dangerous.  Server connection is closed if query does not return in
;; this time.  Should be used to survive network problems, _not_ as
;; statement_timeout. (default: 0)
query_timeout = 0

;; Dangerous.  Client connection is closed if the query is not
;; assigned to a server in this time.  Should be used to limit the
;; number of queued queries in case of a database or network
;; failure. (default: 120)
query_wait_timeout = 120

;; Dangerous.  Client connection is closed if no activity in this
;; time.  Should be used to survive network problems. (default: 0)
client_idle_timeout = 0

;; Disconnect clients who have not managed to log in after connecting
;; in this many seconds.
client_login_timeout = 60


;; Close connections which are in "IDLE in transaction" state longer
;; than this many seconds.
idle_transaction_timeout = 10000

from docker-pgbouncer.

zN3utr4l avatar zN3utr4l commented on August 28, 2024

Look: pgbouncer/pgbouncer#750

from docker-pgbouncer.

jflambert avatar jflambert commented on August 28, 2024

Hi @zN3utr4l let me know if this is still an issue with v1.23.1-p0 or latest

from docker-pgbouncer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.