Recommended pgbouncer usage for pgbouncer version > 1.21.0
Hi, I am using Prisma with Azure Postgres - Flexible Server. As my app is deployed on Vercel, I want to use pgbouncer. However, I seem to be encountering some issues.
As per the docs, I have not set
pgbouncer=true
since the default version on Azure is 1.22.1
I am currently using DATABASE_URL
and DIRECT_URL
with the only difference between the connection strings being the port number (6432, 5432) respectively (no &pgbouncer=true
)
When deploying my application, I get errors related to prepared statements.
Also attached is my pgbouncer config. What am I doing wrong?2 Replies
From reading the docs, it seems like this might relate to the
max_prepared_statements
parameter? What's a recommended value for this?Hi @Éanna
A value greater than zero should be fine as mentioned in the documentation
Configure Prisma Client with PgBouncer | Prisma Documentation
An external connection pooler like PgBouncer holds a connection pool to the database, and proxies incoming client connections by sitting between Prisma Client and the database. This reduces the number of processes a database has to handle at any given time.