Part of my NextJS project consists on grabbing paginated/iterating data from an api using axios and saving in a Postgres db using Prisma to further manipulate them.
I think it is important to mention I'm trying to keep my server code as close as possible to a clean architecture, which means the touch point between Client and Server, through the actions folder is where the injection happens.
With that said, I'm experiencing something I don't understand and I would love thoughts about that.
Having 2 Serverless Functions, 1 to grab data and 1 to save data, they are called several times from the client - around 200x - with a sleep between calls to avoid api limitations. What happens to them is a sequence of calls that start with an acceptable response time and it keeps increasing for the next ones until they reach max response time and everything fails.
Why is this happening? I've never seen something like that in other services and I'm wondering if someone could give me a clue about Vercel's service.
On the screenshots the log at 23:54 says the execution duration took 7.99s and 5 minutes later at 23:59 the execution duration took 8.18s - Difference is minimal, but this is to demonstrate what is happening as I could not get the logs from earlier time where it started with a fair 1s execution duration.
Thank you.


