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
39
votes
5 answers

Postgres - ERROR: prepared statement "S_1" already exists

When executing batch queries via JDBC to pgbouncer, I get the following error: org.postgresql.util.PSQLException: ERROR: prepared statement "S_1" already exists I've found bug reports around the web, but they all seem to deal with Postgres 8.3 or…
Chris Cashwell
  • 22,308
  • 13
  • 63
  • 94
37
votes
1 answer

What are advantages of using transaction pooling with pgbouncer?

I'm having trouble finding a good summary of the advantages/disadvantages of using pgbouncer for transaction pooling vs session pooling. Does it mean that a transaction heavy workload is somehow better load balanced? Is it to prevent as many…
dlamotte
  • 6,145
  • 4
  • 31
  • 40
34
votes
2 answers

How does pgBouncer help to speed up Django

I have some management commands that are based on gevent. Since my management command makes thousands to requests, I can turn all socket calls into non-blocking calls using Gevent. This really speeds up my application as I can make requests…
Mridang Agarwalla
  • 43,201
  • 71
  • 221
  • 382
27
votes
1 answer

Ideal settings for pgbouncer with Django's CONN_MAX_AGE

I'm running a multi-tennant website, where I would like to reduce the overhead of creating a PostgreSQL connection per request. Django's CONN_MAX_AGE allows this, at the expense of creating a lot of open idle connections to PostgreSQL (8 workers *…
vdboor
  • 21,914
  • 12
  • 83
  • 96
21
votes
2 answers

how to determine max_client_conn for pgbouncer

I'm sort of an "accidental dba" so apologies for a real noob question here. I'm using pgbouncer in pool_mode = transaction mode. Yesterday I started getting errors in my php log: no more connections allowed (max_client_conn) I had max_client_conn…
Richard Greenwood
  • 876
  • 1
  • 10
  • 20
16
votes
2 answers

How to increase the connection throughput for pgbouncer?

I am using pgbouncer in transaction mode & trying to allow close to 500 active transaction. The purpose is simply to stress test the setup Current setup: [ 'n' clients --->1 pgbouncer ----> 1 postgres ] I notice that my transaction/second (tps)…
jayanth88
  • 564
  • 1
  • 6
  • 14
14
votes
1 answer

JDBC and pgbouncer can they work with createStatement

I have learned that JDBC PreparedStatement and PGBouncer can not work together because PreparedStatement uses session pooling and is pre-compiled and PGbouncer uses transactional level pooling. My question is can createStatement be used with…
user1591668
  • 2,591
  • 5
  • 41
  • 84
14
votes
2 answers

django 1.7 and connection pooling to PostgreSQL?

What are the differences between the django apps (Django-PostgresPool, djorm-ext-pool, django-db-pool) and PG Bouncer or PG Pool? Do the apps use one of the last two packages? In this article, the author says that there is a patch starting with…
Michael
  • 8,357
  • 20
  • 58
  • 86
13
votes
2 answers

Django settings when using pgbouncer

I have a Django website with Postgresql backend, for which I'm utilizing pgbouncer for db connection pooling (transaction mode). The application and the DB reside on separate servers (1 server each). I have installed pgbouncer on the application…
Hassan Baig
  • 15,055
  • 27
  • 102
  • 205
12
votes
1 answer

PgBouncer and auth to PostgreSQL

pgbouncer version 1.7.2 psql (9.5.6) I try use auth_hba_file (/var/lib/pgsql/9.5/data/pg_hba.conf) in PgBouncer. Config pgbouncer.ini postgres = host=localhost port=5432 dbname=postgres user=postgres test = host=localhost port=5432 dbname=test…
Anton Patsev
  • 605
  • 2
  • 13
  • 27
11
votes
4 answers

Prepared Statement doesn't exist

Currently running a simple sinatra app, using passenger, and using pgbouncer for connection pooling to a database on the same server as the app. Currently I am intermittently getting a PG error that the prepared statement "a\d" doesn't exist. A…
danmanstx
  • 1,692
  • 2
  • 15
  • 21
10
votes
1 answer

pgbouncer - closing because: unclean server on every connection

I'm running Django 1.3 with PostgreSQL 9.1/PostGIS 1.5, psycopg2 2.4.2 and pgbouncer 1.4.2. On every single connection to the database I get a log entry in pgbouncer.log: 2011-11-20 02:15:25.027 29538 LOG S-0x96c2200:…
Dick
  • 1,228
  • 13
  • 21
10
votes
1 answer

Pgbouncer on large client connections

I need to configure my pgbouncer for work with more than 2000 clients connections, I was reading some information about how to work with max connections, then I have understood what I must to do max_client_con = 2000 on pgbouncer, but what about…
Carlos
  • 4,299
  • 5
  • 22
  • 34
9
votes
1 answer

Pgbouncer: how to run within a kubernetes cluster properly

The background: I currently run some kubernetes pods with a pgbouncer sidecar container. I’ve been running into annoying behavior with sidecars (that will be addressed in k8s 1.18) that have workarounds, but have brought up an earlier question…
SirensOfTitan
  • 799
  • 1
  • 7
  • 19
9
votes
2 answers

Disabling prepared statements in dbcp+spring+hibernate+jdbc?

I am currently enhancing an application that uses spring and hibernate.There are multiple instances where the application communicates with the db (postgres) via prepared statements. The application until now, communicated with postgres via…
jayanth88
  • 564
  • 1
  • 6
  • 14
1
2 3
19 20