Skip to content

Instantly share code, notes, and snippets.

@douglasmiranda
Created May 6, 2018 22:15
Show Gist options
  • Save douglasmiranda/72a6453f07014f177cae3b977c67a137 to your computer and use it in GitHub Desktop.
Save douglasmiranda/72a6453f07014f177cae3b977c67a137 to your computer and use it in GitHub Desktop.
pgbouncer
# Based on https://www.pgday.ch/common/slides/2017_ver6_pgbouncer_20k_English.pdf
# Just connect to pgbouncer like you would connect to a postgres server
# In this case using the port 6432
# Run pgbouncer as the user pgbouncer (su-exec)
[databases]
db1 = host=postgres port=5432 dbname=db1
[pgbouncer]
listen_addr = *
listen_port = 6432
auth_type = md5
# Example: "db1" "pass-db1"
auth_file = userlist.txt
pool_mode = transaction
max_client_conn = 100
default_pool_size = 5
reserve_pool_size = 1
reserve_pool_timeout = 1
query_wait_timeout = 10
client_idle_timeout = 7200
tcp_keepalive = 1
tcp_keepidle = 600
server_lifetime = 60
server_idle_timeout = 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment