🇩🇪 DE 🇬🇧 EN
NexoraHost / Docs home
Popular searches:Minecraft won't startCreate Minecraft serverFiveM txAdminInstall WordPressSet up subdomainVPS GermanySSL errorOpen port 25565Discord bot hostingDNS troubleshooting

Set Up PgBouncer – PostgreSQL Connection Pooling on VPS

Quick answer: PgBouncer recycles PostgreSQL connections – instead of 500 connections only 20 real ones. Install between app and DB on your VPS.

Related

VPS & root servers: Order VPS in Germany · panel.nexorahost.de · nexorahost.com (Maincubes FRA01 Frankfurt · Ryzen · NVMe)

Frequently asked questions (FAQ)

When do I need PgBouncer?
From ~50 concurrent DB connections or when your app opens a new connection per request (PHP, serverless-style). Symptom: "too many connections".
transaction or session pool_mode?
transaction (default): connection returned after each transaction. session: for prepared statements. statement: rare, special cases only.
PgBouncer port?
PostgreSQL stays 5432 internally. PgBouncer listens on 6432 (default). App connects to 6432 instead of 5432.
PgBouncer with Docker Compose?
Yes – most popular setup. App → pgbouncer:6432 → postgres:5432. See copy-paste compose below.
How many connections are enough?
default_pool_size=20 often enough for 500+ app users. PostgreSQL max_connections can stay low (50–100).

NexoraHost

Root & VPS servers

Ryzen power at Maincubes FRA01 – full root access, NVMe, DDoS protection included.

nexorahost.com · Maincubes FRA01 · 1 Tbit/s DDoS · 99,9 % Uptime