Getting intermittent database connection timeout
oeduardofreitas
HOBBYOP

a year ago

Backend: NestJS + prisma

ENV is DATABASE_URL="${{ name-of-db-service.DATABASE_URL }}"

Attachments

Solved$30 Bounty

Pinned Solution

a year 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

a year 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!


a year 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
HOBBYOP

a year 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
HOBBYOP

a year ago

I'm not using connection pooling


a year 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!


a year 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
HOBBYOP

a year ago

I'll try adding the pgbouncer


a year 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!


a year 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
HOBBYOP

a year 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
HOBBYOP

a year ago

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


a year ago

Howdy! Did that fix the error?


noahd

Howdy! Did that fix the error?

oeduardofreitas
HOBBYOP

a year ago

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


a year 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
HOBBYOP

a year ago

sure, what info would you like?


oeduardofreitas

sure, what info would you like?

a year 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
HOBBYOP

a year ago

No worries


oeduardofreitas
HOBBYOP

a year ago

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


a year ago

Awsome!


Status changed to Awaiting User Response Railway • about 1 year ago


Status changed to Solved brody • about 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...