Replies: 2 comments 1 reply
-
|
I'm having the exact same issue. Have you found any fix @seloElo ? |
Beta Was this translation helpful? Give feedback.
-
|
You’re hitting the normal Prisma + Next.js SSG limitation: There is no concurrency control in Next.js 14. The only reliable solutions are:
Everything else — reducing pool size, using singleton, disconnecting manually — won’t solve the root issue because the build runs across multiple processes. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Hi all,
I have been on this this whole afternoon. I have an app using Prisma and postgre, with tons of pages created at built time with data fetched from various queries.
My database limit the number of connection, let's say I have a pool size of 15.
Every time I try to build my app, I reach that size and some pages fails to generate.
The build time looks stateless so I can't control the instances of Prisma being used, and even if I try to reduce the connection limit, looks like Next will try to create more and more "threads" to generate the pages if I limit the number of connection per instance of Prisma which makes me reach the limit again.
Is there any configuration or documentation that I missed on how I could control the build time of my ssg pages to avoid reaching that limit and force the build to wait until some connections are free again? Like a max concurrency for static generation or something?
I saw staticGenerationMaxConcurrency on version 15c, I'm not even sure this might help me fix this but it's not available on v14.
Thanks! Anything would help
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions