Nearest region
Light has a speed limit, so distance costs time. A round trip between continents takes 70 to 160 ms, and one on the same continent takes 20 to 40 ms. Serve each user group from the nearest region to keep p99 below 85 ms.
See it on the board
The same traffic runs on two boards. The simulator measured both when this page was built.
| Measure | Goal | All users go to Europe | Each group goes to its nearest region |
|---|---|---|---|
| p99 latency (Eu) | under 85 ms | 24 ms Pass | 26 ms Pass |
| p99 latency (Us) | under 85 ms | 140 ms Fail | 25 ms Pass |
| p99 latency (Ap) | under 85 ms | 140 ms Fail | 68 ms Pass |
| Monthly cost | 12 USD/mo | 16 USD/mo | |
| Error rate | 0% | 0% | |
| Level rules | none broken | Board is not complete Fail | Pass |
Key numbers
| Number | Value |
|---|---|
| Speed of light in vacuum | 299,792,458 m/s |
| Round trip on one continent, slow end | 40 ms |
| Round trip between continents, fast end | 70 ms |
| Round trip between continents, slow end | 160 ms |
Lasers in orbit, New York to London · 7,151 km · 24 ms one way
How it works
A signal cannot be faster than light, and in glass fiber it is about one third slower. A packet that crosses an ocean and returns takes 70 ms at best and often 160 ms. No cache or faster server removes this time. Only a shorter distance does.
In the mini board users in Europe, America and Asia share one API name. A server is ready in each region, but all traffic goes to the European server. European users get fast answers. Users in America and Asia pay a round trip across an ocean for each request, and their p99 passes the 85 ms limit.
The fix is to route each group to its nearest region. A geographic DNS service answers each lookup with the address of the closest region, chosen from the location of the client. The three groups then each have a local round trip of 20 to 40 ms or less, and p99 stays below 85 ms for every group.
The limit applies to each group, not to the average. A fast local group can hide a slow remote group in an average, so the level sets a target for each group.
A server in each region also needs its data. A service that reads one database in Europe from every region pays the long round trip again.
In the levels you route users to the nearest region and check p99 for every group.