Been running in production for a few weeks no prob...
# orm-help
i
Been running in production for a few weeks no problem, haven't touched a thing, and now it seems like all my api calls on Vercel that use Prisma have been timing out, yet my AWS RDS db seems to have no errors or weird things. Anyone encounter anything like this?
r
@Ivan Lukianchuk 👋 Could you add logs and check if Prisma can reach the database?
i
I added logging since, and rebooted the db and redeployed a few times and haven't been seeing issues, thankfully, but next time I should hopefully see the logs on what went wrong. Thanks for reaching out!
👍 1
a
Is this using the data proxy @Ivan Lukianchuk?
i
I'm not sure, what is the data proxy?
hmm, I've still seen a few random timeouts and not seeing any additional errors being logged with them 😕
This is all I get in my vercel function error log: [POST] /api/tickets/create 200344:50 2021-11-27T010444.589Z abad3fe4-bbd5-49d9-a58d-ff1035f1bf21 Task timed out after 60.06 seconds
Here is my client.js file: import { PrismaClient } from "@prisma/client"; let prisma; if (process.env.NODE_ENV === "production") {     prisma = new PrismaClient({         log: ['warn', 'error'],     }); } else {     if (!global.prisma) {         global.prisma = new PrismaClient({             log: ['warn', 'error'],         });     }     prisma = global.prisma; }
I seem to see localhost testing errors, but nothing new appears in my vercel logs
a
If you don’t know I am going to guess you are not using it. It’s a featured of the Prisma Data Platform, which does connection pooling for Prisma apps. This is particularly helpful in serverless environments where it’s really easy to exhaust the database connections . You can find some more info here: https://www.prisma.io/docs/concepts/components/prisma-data-platform#prisma-data-proxy
And you can sign up for free here: https://cloud.prisma.io/
i
I know when I first started testing this site I was having all sorts of pooling connection errors that I couldn't solve, then one day they just went away
but I'm getting a lot more traffic now so I'm not sure if I'm hitting those limits
this isn't production ready though yet is it?
a
It’s not encouraged to use the proxy in production since there is no SLA and it’s not battle tested yet. If you are able to easily revert to not using the proxy this might work for you,