Questions tagged [pgbouncer]

pgbouncer is a lightweight connection pooler for PostgreSQL

pgbouncer is a lightweight connection pooler for PostgreSQL. Its development status is 5 - Production/Stable, available under a BSD License for Windows and POSIX operating systems and is is written in C.

292 questions
4
votes
2 answers

PGbouncer ERROR accept() failed: Too many open files

I am running a server with 20 cpu cores and 96 GB of ram. I have configured Postgresql and Pgbouncer to handle 1000 connections at a time. However when the connections increase (even though they are well below the 1000 limit I have set) I start…
Arya
  • 8,473
  • 27
  • 105
  • 175
4
votes
1 answer

Will PgBouncer reuse postgresql session sequence cache?

I want to use postgres sequence with cache CREATE SEQUENCE serial CACHE 100. The goal is to improve performance of 3000 usages per second of SELECT nextval('serial'); by ~500 connection/application threads concurrently. The issue is that I am doing…
naviram
  • 1,445
  • 1
  • 15
  • 26
4
votes
1 answer

Postgres Advisory Locks not working

I am having issues with postgres advisory locks not acquiring correctly on postgres 9.4.4. If I ssh into a postgres server on two screens and open psql to acquire a lock on one and attempt to aquire the lock on another it works perfectly. However,…
Jared Mackey
  • 3,998
  • 4
  • 31
  • 50
4
votes
1 answer

Can't connect pgbouncer and postgres running with docker

So here is the command to start database sudo docker run --name mydb -e "POSTGRES_USER=user" -e "POSTGRES_PASSWORD=password" -t -d postgres Here is dockerfile for pgbouncer from ubuntu RUN apt-get update && apt-get -y install pgbouncer COPY…
user1685095
  • 5,787
  • 9
  • 51
  • 100
3
votes
0 answers

Install PgBouncer for PostgreSQL on AWS RDS

We created a PostgreSQL production database in AWS RDS a few months back and now we have received a requirement from the application team to install a connection pooler - PgBouncer in it. I couldn't see any proper document from the AWS team showing…
3
votes
1 answer

pgbouncer fails to start when configured to dockerized postgres

I am trying to configuer pgbouncer for the first time. My postgres DB is running as a container (with port 5011) My OS is debian 10. I used apt-install to install pgbouncer: sudo apt-get install pgbouncer and then could see that pgbouncer status…
Tamar
  • 145
  • 4
  • 15
3
votes
1 answer

What exactly does a connection pool for databases like PostgreSQL do?

I know the general idea that a connection pool is a pool of reusable connections that speeds up traffic to the database because it can reuse connections instead of constantly creating new ones. But this is a very high level explanation. It doesn't…
Martin01478
  • 387
  • 1
  • 5
  • 16
3
votes
2 answers

How to use statement_timeout with pgBouncer in transaction mode

Using pgBouncer in transaction mode seems to be the optimal way of reducing the number of active connection at any given time, but it's also given rise to a problem that I'm not sure how to solve effectively. Say you want to have a blanket…
mscrivo
  • 1,107
  • 12
  • 14
3
votes
1 answer

After using pg_dump behind pg_bouncer, the search_path appears to be altered and other clients are affected

My network looks like this: App (many connections) pg_bouncer (few sessions) PostgreSql nodes ----------------------- nodes ----------------- nodes So pg_bouncer multiplexes connections giving app nodes the illusion that they are…
annitaq
  • 31
  • 2
3
votes
1 answer

PgBouncer performance drops when connection count increases

I have a dedicated PostgreSQL server and a pgBouncer server. all connections are established through pgBouncer. I tested the system using Apache JMeter and PHP. The results are weird. The throughput with 500 connections are not bad but when I test…
rostamiani
  • 2,859
  • 7
  • 38
  • 74
3
votes
0 answers

CentOS 7 pgbouncer.pid Permissions Issue

I have installed pgbouncer. I can't get it started because the directory that houses the .pid file re-generates its own ownership. 2020-07-31 04:58:34.083 EDT [3682] DEBUG loading auth_file: "/etc/pgbouncer/userlist.txt" 2020-07-31 04:58:34.088 EDT…
Rich_F
  • 1,830
  • 3
  • 24
  • 45
3
votes
2 answers

Flyway: Multiple nodes migrating in parallel with PgBouncer transaction pooling

We're encountering issues with using Flyway for database migrations with multiple nodes in parallel, backed by a PostgreSQL database behind PgBouncer with transaction pooling. The problem is that when multiple nodes start up at the same time, Flyway…
Mat Mannion
  • 3,315
  • 2
  • 30
  • 31
3
votes
1 answer

What's the worst case scenario if one runs individual queries when pgbouncer has pool_mode=transaction?

Let's assume following config for pgbouncer: pool_mode=transaction reset_query=discard all reset_query_always=0 If I have a connection that does begin transaction ... commit transaction then it's pretty simple because during the transaction is…
Mikko Rantalainen
  • 14,132
  • 10
  • 74
  • 112
3
votes
1 answer

Npgsql with Pgbouncer on Kubernetes - pooling & keepalives

I'm looking for more detailed guidance / other people's experience of using Npgsql in production with Pgbouncer. Basically we have the following setup using GKE and Google Cloud SQL: Right now - I've got npgsql configured as if pgbouncer wasn't in…
Kieran Benton
  • 8,739
  • 12
  • 53
  • 77
3
votes
1 answer

Not able to open connection from PgBouncer (Connection attempt timed out)

We are using PgBouncer as the middle ware for connection pooling for our spring-based application. Within the application, we are using HikariCP for application-level connection pooling. We have set maxLifeTime value equal to one hour for HikariCP…
Munish Dhiman
  • 511
  • 1
  • 7
  • 22