Getting intermittent database connection timeout
oeduardofreitas
PROOP

5 months ago

Backend: NestJS + prisma
ENV is DATABASE_URL="${{ name-of-db-service.DATABASE_URL }}"

Attachments

Solved$30 Bounty

Pinned Solution

brody
EMPLOYEE

5 months ago

I would first try switching to pg for your database driver instead of Prisma's default Rust driver.

https://www.prisma.io/docs/orm/overview/databases/postgresql#using-the-node-postgres-driver

19 Replies

Railway
BOT

5 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


noahd
EMPLOYEE

5 months ago

Hey there! Do you happen to have multiple connections going at once? If so are you doing connection pooling?


noahd

Hey there! Do you happen to have multiple connections going at once? If so are you doing connection pooling?

oeduardofreitas
PROOP

5 months ago

I'm 100% sure, I know it is possible, but I also noticed it happening when I was the only user accessing the app


oeduardofreitas

I'm 100% sure, I know it is possible, but I also noticed it happening when I was the only user accessing the app

oeduardofreitas
PROOP

5 months ago

I'm not using connection pooling


noahd
EMPLOYEE

5 months ago

Did a bit of digging, it looks like some users had this same issue then implemented connection pooling with pgbouncer and it solved it!


noahd
EMPLOYEE

5 months ago

Currently looking around for prisma specific docs on it.


noahd

Did a bit of digging, it looks like some users had this same issue then implemented connection pooling with pgbouncer and it solved it!

oeduardofreitas
PROOP

5 months ago

I'll try adding the pgbouncer


noahd
EMPLOYEE

5 months ago

This might be a good thing to take a peek at as well! https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/databases-connections

Let me know how PGBouncer goes!


brody
EMPLOYEE

5 months ago

I would first try switching to pg for your database driver instead of Prisma's default Rust driver.

https://www.prisma.io/docs/orm/overview/databases/postgresql#using-the-node-postgres-driver


brody

I would first try switching to pg for your database driver instead of Prisma's default Rust driver.https://www.prisma.io/docs/orm/overview/databases/postgresql#using-the-node-postgres-driver

oeduardofreitas
PROOP

5 months ago

sure, I'll do it first


brody

I would first try switching to pg for your database driver instead of Prisma's default Rust driver.https://www.prisma.io/docs/orm/overview/databases/postgresql#using-the-node-postgres-driver

oeduardofreitas
PROOP

5 months ago

I have made the change, lets see if the error goes away


noahd
EMPLOYEE

5 months ago

Howdy! Did that fix the error?


noahd

Howdy! Did that fix the error?

oeduardofreitas
PROOP

5 months ago

I haven't seen the error anymore. I'll keep monitoring it


noahd
EMPLOYEE

5 months ago

Can i get any more info about the project? Would be awesome!


noahd

Can i get any more info about the project? Would be awesome!

oeduardofreitas
PROOP

5 months ago

sure, what info would you like?


oeduardofreitas

sure, what info would you like?

noahd
EMPLOYEE

5 months ago

Oop I think I sent this in the wrong thread accidentally I apologize! Was multitasking with tabs too fast


noahd

Oop I think I sent this in the wrong thread accidentally I apologize! Was multitasking with tabs too fast

oeduardofreitas
PROOP

5 months ago

No worries


oeduardofreitas
PROOP

5 months ago

Resolved by switching to pg the database driver instead of Prisma's default Rust driver white_check_mark emoji


brody
EMPLOYEE

5 months ago

Awsome!


Status changed to Awaiting User Response Railway 5 months ago


Status changed to Solved brody 5 months ago


Loading...