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
2
votes
0 answers

pgbouncer config File descriptor limit, max_client_conn, max fds possible

I had a PostgreSQL based web application that run into no connection left problem. so I used pgbouncer to solve this problem. It works very much better with pgbouncer but I'm still having some problems with connection limit... Right now my…
Ehphan
  • 537
  • 3
  • 7
  • 19
2
votes
1 answer

pgbouncer kill command blocks subsequent connections

According to https://pgbouncer.github.io/usage.html running KILL db; should immediately drop all client and server connections on given database. I was trying to stop all the connections to postgres on my test environment using =# kill…
Mikhail
  • 21
  • 5
2
votes
2 answers

haproxy pgsql-check and eof message

I am using haproxy 1.5.4 . in front of pgbouncer . my configuration has pgsql-check enabled . Once the check is enabled i see these messages in pgbouncer log . 2015-10-01 05:02:46.203 27104 LOG C-0x6609d0: (nodb)/(nouser)@10.53.6.132:38711 closing…
user101736
  • 21
  • 3
2
votes
0 answers

how to start the pgbouncer with normal user other than root

I installed postgres-9.2.13 and pgbouncer in my Linux machine. My db admin in "postgres" user. When I am trying to start postgres or pgbouncer respectively with the below commands, it is asking the root password and i am able to run the command only…
Shashikanth Komandoor
  • 781
  • 1
  • 11
  • 29
2
votes
1 answer

how to configure postgresql / pgbouncer using unix sockets?

cannot make simplest pgbouncer / postgresql combo work using default unix sockets. logged in as foo, with an existent database (created by foo) bar. these work fine: $ psql bar $ psql -U foo bar $ psql -U foo --password bar in…
cc young
  • 18,939
  • 31
  • 90
  • 148
2
votes
1 answer

How does pgbouncer behave when transaction pooling is enabled and a single statement is issued?

I'm using pgbouncer on a web app and most threads begin with a BEGIN and end with a COMMIT or a ROLLBACK, so we're using transaction pooling and everything is fine. However, we also have some processes which don't use transactions: instead, they…
rat
  • 487
  • 1
  • 5
  • 10
2
votes
1 answer

How to setup pgbouncer with rails on heroku?

Heroku recently decreased number of available connections to production database (from 500 to 60). Opened connections were consuming a lot of memory and causing problems, so it seems like a step in right direction. My app has more than 100…
Milovan Zogovic
  • 1,541
  • 2
  • 16
  • 24
2
votes
1 answer

Does statement_timeout need to be set within a function?

When I get a sudden spike in web users, some statements start queueing indefinitely, even though i'm setting a timeout like: SET STATEMENT_TIMEOUT TO 5000; SELECT get_user_properties(12345); Do functions ignore statement_timeout if it is not set…
Nick
  • 555
  • 5
  • 22
2
votes
1 answer

pgadmin connecting to postgresql via pgbouncer

I have a postgresql server running on a remote debian box. postgresql is running on unix socket dir /var/run/postgresql. I also have pgbouncer running on port 6432. I also have 6432 open for tcp connections as below ACCEPT tcp -- anywhere …
mongle
  • 65
  • 1
  • 7
2
votes
1 answer

pgbouncer port vs db port

I used PostgreSQL with php. After a while the client connection become larger so I try to use pgbouncer to set the max connection etc. My DB port is 5432 and all my php using that port to connect to my DB. My question is, what if I used the same…
user430926
  • 4,017
  • 13
  • 53
  • 77
1
vote
0 answers

PostgreSQL HA + Load Balancing + Pooling setup

I'm facing dilemma regarding which method to achieve HA + Load Balancing + Pooling for postgreSQL. Currently I'm in the phase of POC, and I had setup a cluster of 3 nodes which consists of 1 master and 2 slave. This cluster also setup with repmgr…
Xonos
  • 103
  • 10
1
vote
2 answers

Configure pgbouncer and postgresql in docker-compose

How can I apply connection pooling with pgbouncer in my docker-compose file. I don't know if the ConnectionString of my containers are correct or not. postgredb: image: postgres environment: - POSTGRES_USER=dbuser -…
Kaveh Naseri
  • 1,102
  • 2
  • 15
  • 24
1
vote
1 answer

Prisma ORM, PgBouncer, Supabase stack - what is causing these database connection timeouts on production?

I'm working with a tech stack of Prisma ORM and Postgres on Supabase with PgBouncer enabled. We're also using Google Cloud Run to deploy our Node/Express API. When looking through logs for production, you will see occurances of the same errors being…
1
vote
0 answers

Django / Postgres and random Operational Error - Connection closed

We are having a hairy Django issue for a while now that keeps coming and going randomly. Every once in a while we get Operational Error - Connection closed. (see error below). We are running Django 4.2 / Py3.11 - pgbouncer - PostgreSQL 14 (EC2 + RDS…
1
vote
1 answer

HikariCP (and other connection pools) on multi-threaded server and PgBouncer

So I've recently become aware of PgBouncer and I'm struggling to understand how it replaces a connection pool on a multi-threaded server. I looked over HikariCP/Apache DBCP2 and PgBouncer but it doesn't seem to address that. Suppose I have a Java…
aiguofer
  • 1,887
  • 20
  • 34