postgresqlaws-lambdaserverless-frameworkprismaaws-rds-data-service

Prisma Data Proxy ignoring connection limit and pool timeout in serverless environment (AWS + Serverless Framework + Prisma ORM)


I'm trying to use connection_limit and pool_timeout Prisma Data proxy with specific values, but it seems to ignore them.

I'm using PostgreSQL in AWS RDS.

My current connection test is:

prisma://aws-eu-central-1.prisma-data.com/?connection_limit=5&pool_timeout=120&api_key=<API_KEY>

When it occurs an timeout, I get this error:

The error is 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)

As you can see, the limits are ignored (10 instead of 120 and 3 instead of 5).

We really did a lot of tests. Can anyone help us figuring why?


Solution

  • We got in touch with Prisma team and the answer is:

    You would need to set the pool_timeout and the connection_limit in the database connection string during environment creation. for example: DATABASE_URL=postgresql://aaa:bbb@ccc.us-east-1.rds.amazonaws.com:5432/ddd?connection_limit=10&pool_timeout=100&sslmode=prefer

    Prisma would then use that to generate a connection string to use with the Data Proxy.

    I hope this could solve the issue to anyone encountering the same problem.