technical

Regions, discovery, and reducing latency

281 views

Ngris runs tunnel-servers in multiple regions so traffic enters the network close to your users. Endpoints are region-less — the serving region is a property of the agent/tunnel, chosen when the agent connects, not of the endpoint.

Available regions

  • eu-fi — Helsinki, Finland.
  • us-va — Ashburn, Virginia.

More regions are being added — check GET /v1/agent/discover for the live list.

How discovery picks a region

When the agent starts, the discovery service chooses a tunnel-server based on, in order:

  1. Operator preference — the --region flag forces a specific region.
  2. GeoIP of the agent — with no flag, discovery routes to the nearest healthy region by your source IP.
  3. Default region — if all else fails, the closest discovery POP (currently eu-fi).

Choosing a region

# GeoIP-routed (recommended for most users)
ngris http 8080

# Force a region (testing, comparisons, pinning)
ngris http 8080 --region us-va

# Or via environment variable
AGENT_REGION=us-va ngris http 8080

Connect your agent in the region close to your users, not close to the agent host: a US user hitting a service served through an EU region pays the EU-US round trip per request.

Fallbacks and failover

The discovery response includes fallback tunnel-servers in other healthy regions. If your primary becomes unreachable, the agent automatically cycles through fallbacks before re-querying discovery — you don’t need to handle this in your code. A region is excluded from discovery when its tunnel-server hasn’t heartbeated for over 30 seconds, when it is draining for maintenance, or while it is within a failover cooldown window.

Ask an AI to summarise this page