Edge latency test

Hello, I need to use an API from a microservice that is implemented in another country (third-party service). I created an edge function that works well, but the latency is relatively high, especially considering that I need to make several calls to the same API quickly in a single request.

So, I have a few questions:

  • Is there a tool I can use to test which IP/hostname is faster from Vercel’s regions? This way, I could determine the best location for my function to be executed.
  • I am using an edge function; does the “region” option influence this? My idea is something like this: when contacting my API from my computer, the edge closest to the third-party API is used. This, although increasing my latency to the edge, reduces the waiting time because the edge can get the information more quickly. So, I am wondering if I am doing the right thing by using an edge function and not a serverless function.

Thank you!

@rentalhost for edge functions specifically, no, there’s no such tool available. But you can always “pin” the execution region by this way: Configuring Regions for Vercel Functions

The configuration is slightly different than serverless functions, but that’s how you set the execution region for your edge functions.

3 Likes

Thank you, this was exactly what I was looking for!

Thanks for sharing the solution, @smaeda-ks! :fire:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.