Vercel next js code performance profiler

Hi Team,

We have a project hosted on the Vercel. We get timeout issue with some of the page requests intermittently. Maybe we can get resolved by increasing the “Function Max Duration” to some higher number than the default 15 seconds.

node.js - NextJS hosted on Vercel 504: GATEWAY_TIMEOUT - Stack Overflow

We checked the Vercel logs but it does not give information regarding the code level / each function level / component level time lapse for execution.

Is there any way to do the code performance profiling to figure out the root cause or the code that takes too much of the time.

Any help is highly appreciated.

Thanks,
Sandeepkumar Gupta

Hi @sandeepperficient, welcome to the Vercel Community!

There’s no built in feature to profile functions and components individually from the Vercel dashboard as of now.

You can maybe try using the Performance measurement APIs | Node.js v23.6.0 Documentation and see where the bottleneck is.

A common cause of timeout can be network latency to a 3rd party API your functions are connecting to. So, maybe that can be a good starting point for debugging this.

I hope this helps.