My website can't work anymore with my new neon db
Hello i have a big problem, i migrate my vercel db to neon db,
My database, is so slow, and the website is slow
The error is basicaly :
Invalid
prisma.user.findFirst() invocation: website-container
12 mars 2024 à 07:15 (UTC+1:00) Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 3) { website-container
12 mars 2024 à 07:15 (UTC+1:00) message: '\n' + website-container
12 mars 2024 à 07:15 (UTC+1:00) 'Invalid prisma.user.findFirst() invocation:\n' + website-container
12 mars 2024 à 07:15 (UTC+1:00) '\n' + website-container
12 mars 2024 à 07:15 (UTC+1:00) '\n' + website-container
12 mars 2024 à 07:15 (UTC+1:00) 'Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 3)', website-container
12 mars 2024 à 07:15 (UTC+1:00) stack: 'PrismaClientKnownRequestError: \n' + website-container
12 mars 2024 à 07:15 (UTC+1:00) 'Invalid prisma.user.findFirst() invocation:\n' + website-container
12 mars 2024 à 07:15 (UTC+1:00) '\n' +
PS: i'm using prisma
I don't know what i need to change i added : "?pgbouncer=true&connect_timeout=15" to my prisma url so idk what to do
It's a postgres dbPrisma
Connection pool
Prisma ORM's query engine creates a connection pool to store and manage database connections.
6 Replies
fair-rose•2y ago
Hey, a few ideas for you.
1. If you're using the latest Prisma client, you shouldn't need the, pgbouncer=true setting any more when you are using a pooled Neon connection string. See this recent post:
https://neon.tech/blog/better-postgres-with-prisma-experience
2. Use a pooled Neon connection string if you are not already. That's for pooling on the Neon side. https://neon.tech/docs/connect/connection-pooling#enable-connection-pooling
3. The Prisma query engine has its own pooler. The number of connections it supports is determined by the machine that's running your app. See here for an explanation: https://neon.tech/docs/guides/prisma#connection-pool-timeouts
4. You can set a pool_timeout on the Prisma side to allow connections from the Prisma connection pool more time to process a query. Maybe try a higher setting there to see if that helps.
5. Do you have any slow queries holding up connections in the pool on the Prisma side? Maybe set up pg_stat_statements and look for slow queries, as described here: https://neon.tech/blog/postgres-support-recap-investigating-postgres-query-performance
Neon
Better Postgres with Prisma Experience - Neon
We’re Neon. We’re building Postgres that helps you confidently ship reliable and scalable apps. We made Postgres on Neon work seamlessly with Prisma. This article explains how we did it. We love Prisma, and so do developers. Prisma ORM makes it easy to perform schema migrations and map any database objects with your existing JavaScript […]
Neon
Postgres Support Recap: Investigating Postgres Query Performance - ...
Neon Support often receives support tickets related to Postgres query performance. Such issues could result from a myriad of factors ranging from missing indexes or lack of database maintenance to ineffective queries and joins or system resource limitations. Where should you start when trying to get to the bottom of an issue with such a […]
Neon
Connect from Prisma to Neon - Neon Docs
Prisma is an open source, next generation ORM that lets you to manage and interact with your database. This guide covers the following topics Connect to Neon from Prisma Use connection pooling with Pr...
Neon
Connection pooling - Neon Docs
Neon uses PgBouncer to offer support for connection pooling, enabling up to 10,000 concurrent connections. PgBouncer is a lightweight connection pooler for Postgres. This topic describes Neon's defaul...
eastern-cyanOP•2y ago
Hey daniel thanks a lot for your message, but that's really weird, cause with my last db on vercel entreprise which was neon db, it was working perfectly
There is something mroe to dig in, i think
I will try your info thx !
fair-rose•2y ago
yeah, that's odd that your config works on Vercel but not on Neon. @ShinyPokemon any ideas here?
ambitious-aqua•2y ago
@Fye If the problem persists after following the advises of Daniel, please, raise a support case and share with me as many details as possible. I would be happy to give you a hand.
We can have a quick remote session together tomorrow if that helps (et on peut meme le faire en francais :p :p :p)
eastern-cyanOP•2y ago
Superrrv! J’ai un call avec Will à 22h je vais pas te déranger mais si j’ai besoin d’aide encore go !
ambitious-aqua•2y ago
🇫🇷 Parfait, comment l'appel s'est déroulé? Est-ce que le problème est corrigé?
🇺🇸 Perfect, how did the call go? Is the problem fixed?