Running my application in Vercel (Pro Plan) and seeing these errors sometimes:
Invalid `prisma.customer.findMany()` invocation:
Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 15, connection limit: 20)
and
Invalid `prisma.salesOrder.findFirst()` invocation:
Server has closed the connection.
Have been chatting with Neon and they recommended tweaking the connection string:
DATABASE_URL="postgres://something:something@something-pooler.us-east-1.aws.neon.tech:5432/something?sslmode=require&connect_timeout=15&connection_limit=20&pool_timeout=15"
Prisma docs mentions:
he recommended connection pool size (
connection_limit
) to start with for long-running processes is the default pool size (num_physical_cpus * 2 + 1
) รท number of application instances .
What is the number of physical cpus here? Which numbers to use here?