Performance issues in production
Answered
Russian Blue posted this in #help-forum
Russian BlueOP
Hi,
I'm building an app in Next.JS and I've gone ahead and deployed it to Vercel. I recently built and ran my app on my computer and was having great performance, however, I recently went ahead and deployed my app on vercel, now it appears that the page takes an additional 700ms to load while I'm on my computer.
I'm wondering if theres a good way to diagnose what's causing this extra 700ms spike. The API request which is varying so much is the
Thanks,
Noah H
I'm building an app in Next.JS and I've gone ahead and deployed it to Vercel. I recently built and ran my app on my computer and was having great performance, however, I recently went ahead and deployed my app on vercel, now it appears that the page takes an additional 700ms to load while I'm on my computer.
I'm wondering if theres a good way to diagnose what's causing this extra 700ms spike. The API request which is varying so much is the
?_rsc=19ror
request. Thanks,
Noah H
Answered by Asian black bear
The first thing to investigate is data fetching. A classic case where people think that a locally running app against a locally running database with no latency is what it will feel like when deployed. Often it turns out their app is deployed in one region and their database in a region at the other end of the world.
3 Replies
Asian black bear
The first thing to investigate is data fetching. A classic case where people think that a locally running app against a locally running database with no latency is what it will feel like when deployed. Often it turns out their app is deployed in one region and their database in a region at the other end of the world.
Answer
Asian black bear
In this example you'd have to check where your data sources are hosted, where your Vercel deployment is hosted and rule out this as possible reason. If that isn't the cause for the latency you have to investigate the data fetching method itself an debug that.
@Asian black bear In this example you'd have to check where your data sources are hosted, where your Vercel deployment is hosted and rule out this as possible reason. If that isn't the cause for the latency you have to investigate the data fetching method itself an debug that.
Russian BlueOP
Thank you for this detailed and sophisticated response. I too thought that this may be an issue but failed to investigate it properly. Turned out the Vercel region was set to North America despite infastructure being hosted in London. 🤦♂️