Latency dependence on geographical location

This discussion made me curious just how much geography affects the time a server round-trip takes.

I created an app that calls an empty server function a few times and just reports back how long it took. The output looks like this:

From America/Chicago, the first round trip took 0.612 s. The subsequent 5 round trips took 0.222 s on average, with a min of 0.189 s and max of 0.297 s.

I’m curious to see what results others get from other locations. If you’re up for it, visit this link and share your results in a reply: https://latency.anvil.app

p.s. Clone link below:

4 Likes

From America/Arizona, the first round trip took 0.824 s. The subsequent 5 round trips took 0.205 s on average, with a min of 0.199 s and max of 0.219 s.

This is enlightening! Thank you Tim!

1 Like

From Asia/Baku, the first round trip took 0.471 s. The subsequent 5 round trips took 0.150 s on average, with a min of 0.141 s and max of 0.165 s.

1 Like

From America/New_York, the first round trip took 0.601 s. The subsequent 5 round trips took 0.195 s on average, with a min of 0.179 s and max of 0.210 s.

1 Like

From America/Chicago, the first round trip took 0.607 s. The subsequent 5 round trips took 0.192 s on average, with a min of 0.175 s and max of 0.245 s.

I tested in 3 conditions:

  • with your app on your server (shared or dedicated?)
  • with the app cloned and running on my dedicated server
  • with the app cloned and running on my dedicated server with keep server running

… and there was no difference.

A second interesting test would be to add an HTTP endpoint. In my experience the keep server running makes a big difference with HTTP endpoints. Perhaps because they always restart from scratch, while the app keeps a connection open.

I am (positively) surprised to see these fast response times. The last time I ran similar tests, long time ago, I was getting bigger numbers. But my focus was on HTTP endpoints, and I may be getting old.

1 Like

From Europe/London, the first round trip took 0.206 s. The subsequent 5 round trips took 0.099 s on average, with a min of 0.085 s and max of 0.122 s.

1 Like

Mine is running on a shared server (on a Professional plan without much going on, though I was thinking that wouldn’t matter since it’s just calling an empty server function?).

From Europe/Dublin, the first round trip took 0.768 s. The subsequent 5 round trips took 0.172 s on average, with a min of 0.129 s and max of 0.198 s.

1 Like

From UK, the first round trip took 0.480 s. The subsequent 5 round trips took 0.179 s on average, with a min of 0.136 s and max of 0.214 s.

1 Like

From America (Florida), the first round trip took 0.664 s. The subsequent 5 round trips took 0.223 s on average, with a min of 0.205 s and max of 0.248 s.

1 Like

From America/Los_Angeles, the first round trip took 0.814 s. The subsequent 5 round trips took 0.370 s on average, with a min of 0.238 s and max of 0.761 s.

1 Like

I ran it 4 times to see how much variability there was. I do monitor the latency on my app occasionally and generally see about 310 ms when I ping Anvil.Works

From Australia/Sydney, the first round trip took 1.348 s. The subsequent 5 round trips took 0.376 s on average, with a min of 0.364 s and max of 0.399 s.

From Australia/Sydney, the first round trip took 2.125 s. The subsequent 5 round trips took 0.367 s on average, with a min of 0.352 s and max of 0.378 s.

From Australia/Sydney, the first round trip took 1.688 s. The subsequent 5 round trips took 0.438 s on average, with a min of 0.372 s and max of 0.676 s.

From Australia/Sydney, the first round trip took 1.301 s. The subsequent 5 round trips took 0.368 s on average, with a min of 0.341 s and max of 0.398 s.

1 Like

From Stavanger, Norway, the first round trip took 0.241 s. The subsequent 5 round trips took 0.093 s on average, with a min of 0.084 s and max of 0.123 s.

1 Like

From Europe/Amsterdam, the first round trip took 0.218 s. The subsequent 5 round trips took 0.084 s on average, with a min of 0.066 s and max of 0.103 s.

1 Like

This is very cool. Often wondered the same myself. When I was in the UK it seemed quite a bit quicker and this seems to be borne out by the above. And now I’m here:

From Africa/Ouagadougou, the first round trip took 0.882 s. The subsequent 5 round trips took 0.251 s on average, with a min of 0.234 s and max of 0.258 s.

Subsequent runs very similar

1 Like

From Europe/Berlin, the first round trip took 0.260 s. The subsequent 5 round trips took 0.145 s on average, with a min of 0.085 s and max of 0.236 s.

1 Like

From Europe/Salzburg, the first round trip took 0.376 s. The subsequent 5 round trips took 0.132 s on average, with a min of 0.104 s and max of 0.144 s.

From America/New_York, the first round trip took 0.458 s. The subsequent 5 round trips took 0.140 s on average, with a min of 0.133 s and max of 0.151 s.

1a) newer laptop, ISP #1 - From America/New_York, the first round trip took 0.532 s. The subsequent 5 round trips took 0.167 s on average, with a min of 0.159 s and max of 0.175 s.

1b) newer laptop, ISP #2 - From America/New_York, the first round trip took 0.789 s. The subsequent 5 round trips took 0.227 s on average, with a min of 0.194 s and max of 0.266 s.

2a) slow old netbook, ISP #1 - From America/New_York, the first round trip took 0.491 s. The subsequent 5 round trips took 0.149 s on average, with a min of 0.134 s and max of 0.169 s.

2b) slow old netbook ISP #2 - From America/New_York, the first round trip took 0.708 s. The subsequent 5 round trips took 0.257 s on average, with a min of 0.191 s and max of 0.403 s

3a) old Android, ISP #1 - From America/Indianapolis, the first round trip took 0.514 s. The subsequent 5 round trips took 0.166 s on average, with a min of 0.149 s and max of 0.178 s.

3b) old Android, ISP #2 - From America/Indianapolis, the first round trip took 0.841 s. The subsequent 5 round trips took 0.355 s on average, with a min of 0.298 s and max of 0.497 s.

3c) old Android, ISP #3 (phone data plan) - From America/Indianapolis, the first round trip took 0.572 s. The subsequent 5 round trips took 0.209 s on average, with a min of 0.185 s and max of 0.243 s.

The ISP (Internet Service Provider used to provide Internet connectivity to my local machine) consistently made a difference. Not surprising, that ISP #2 is generally slower: check your local Internet performance if Anvil apps are running slowly.

2 Likes

From Pacific/Auckland, the first round trip took 1.304 s. The subsequent 5 round trips took 0.411 s on average, with a min of 0.345 s and max of 0.520 s.