Visitors are offered the operator nodes most likely to deliver fastest
TL;DR: Regional Gateways now rank the operator nodes they give a visitor's browser by how fast each delivered to nearby visitors, and stop offering nodes that browsers can't reach.
When a visitor visits a site placed on edge nodes, the Regional Gateway tells their browser which nodes it can fetch the site’s files from. Until now, that list held every node with a copy of the site, in no particular order. From v0.0.121, the gateway picks a short list for each visitor, based on how each node has actually performed for visitors near them, and leaves out nodes that aren’t responding.
How the list is chosen
- Up to 4 nodes are offered. The browser connects ahead of time to the first three over WebRTC, in the order given.
- Measured nodes come first. A node gets a measurement once it has delivered to enough visitors, timed in their browsers. The gateway uses the figure for visitors on the same ISP (when available), and for the same metro otherwise, and offers the nodes with the best latency first.
- One slot goes to a node that hasn’t been measured yet, rotating among those in the visitor’s metro, so new nodes get the chance to earn a a performance measurement. A node that keeps losing to others doesn’t get this slot.
- The rest is filled by location: nodes on the visitor’s ISP, then in their metro, then in the nearest metros that hold the site. Within each group, a measured node still comes before an unmeasured one.
- Pages still come from the gateway, and any file a node can’t deliver, or delivers wrongly, still falls back to the gateway, as described in the operator nodes entry.
What operators should know
- Each Regional Gateway sends your node one small
/healthrequest every minute on its public endpoint, and only once it has started offering nodes in your metro. The answer is built in memory, with no disk or network work on your node. - A node that fails two checks in a row is no longer offered, until a check succeeds again. A check that times out after 3 seconds, or answers with anything but
success, counts as a failure. - Nodes behind NAT are still offered when browsers reach them over WebRTC. The same goes for a node whose public endpoint fails its checks but that browsers can reach over WebRTC.
- A node that browsers can’t reach either way isn’t offered.
Privacy and limits
- Timings are measured in visitors’ browsers, not reported by the nodes. The gateway uses a visitor’s address only to place them in a metro and ISP, then drops it. No visitor data is kept.
- Latency measurements follow recent deliveries. A node with no new deliveries for an hour loses its ranking and is treated as unmeasured again.
What you need to do
Nothing. If you run a node in gatewa mode, make sure it is reachable from the internet, or that WebRTC works, so it stays on the list.