#Api requests 100x lower on Vercel compared to local

11 messages · Page 1 of 1 (latest)

copper sun
#

My very simple API requests are all failing with 10s timeout when the app is deployed on Vercel.
Local responds in 100ms.
How come?
Both are connected to the same MongoDB Atlas cloud db and it's a simple read operation.

kind patrol
#

possibly due to serverless cold start

#

SSR has this issue too

copper sun
kind patrol
#

there should be a lot of options if you google "serverless cold start"

copper sun
#

Ok, ty

kind patrol
#

you can also opt-out the server-less api routes and simply host a server for APIs elsewhere

copper sun
copper sun
#

I reduced the bundle size to the minimum. My function still fails with 10s timeout. I must have missed something, but can't see what...
It's a simple getById that returns less than 1Kb.

#

I also set the region as closest of my position as possible