1
  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: 17)

I query the database through prisma and suddenly that error appears. How should I handle it?

On the planet scale, it is stated that up to 250,000 connections are possible.

dontknowhy
  • 2,480
  • 2
  • 23
  • 67

1 Answers1

2

To specify the connection limit, you would need to set the connection_limit connection string parameter: Reference.

For example you can set your connection string like this:

mysql://tpuf2:*****@ap-south.connect.psdb.cloud/db?sslaccept=strict&connection_limit=100

In this case Prisma could have maximum 100 connections with the database.

Nurul Sundarani
  • 5,550
  • 3
  • 23
  • 52
  • Thanks, I use Cloud Run as my web server. It can have up to a thousand instances. If so, is it okay if I set the connection_limit to 100 per instance in order to use all 100000 connections? (100x1000 = 100,000) Or should I just set connect_limit=100000 in this case? Your reply would be very appreciate – dontknowhy Nov 09 '22 at 09:20
  • 1
    I think you should set connection_limit to 100000 in that case, I assume these instances would be connected with the same connection string so connections would be split among these instances – Nurul Sundarani Nov 09 '22 at 13:52
  • Thanks! I was confused because of this https://www.prisma.io/docs/guides/performance-and-optimization/connection-management `You must manually set the connection_limit parameter . For example, if your calculated pool size is 10 and you have 2 instances of your app, the connection_limit parameter should be no more than 5.` – dontknowhy Nov 09 '22 at 14:03