Skip to main content

Determining the best region for a match

In this guide, we’ll explain how to use the Ping Service to select the best region when creating a room on Hathora. Each room must be assigned to a region, so selecting the optimal one is key to ensuring low latency for players. The Ping Service helps you measure the round-trip time (RTT) in milliseconds between the game client and Hathora’s data centers, allowing you to choose the best-performing server from 14 available regions.

Regions

The Ping Service supports multiple protocols, including UDP, ICMP, and Websocket. Each region has a unique URL, which you can use to measure latency from your players' devices.

note

You should ping each region 3-5 times and calculate the average round-trip time to help smooth out any outliers or occasional network fluctuations.

RegionUDP URLICMP URLWebSocket URL
Seattleseattle.ping.hathora.dev:10000seattle.ping.hathora.devwss://seattle.ping.hathora.dev:443
Los Angeleslosangeles.ping.hathora.dev:10000losangeles.ping.hathora.devwss://losangeles.ping.hathora.dev:443
Dallasdallas.ping.hathora.dev:10000dallas.ping.hathora.devwss://dallas.ping.hathora.dev:443
Chicagochicago.ping.hathora.dev:10000chicago.ping.hathora.devwss://chicago.ping.hathora.dev:443
Washington DCwashingtondc.ping.hathora.dev:10000washingtondc.ping.hathora.devwss://washingtondc.ping.hathora.dev:443
Sao Paulosaopaulo.ping.hathora.dev:10000saopaulo.ping.hathora.devwss://saopaulo.ping.hathora.dev:443
Londonlondon.ping.hathora.dev:10000london.ping.hathora.devwss://london.ping.hathora.dev:443
Frankfurtfrankfurt.ping.hathora.dev:10000frankfurt.ping.hathora.devwss://frankfurt.ping.hathora.dev:443
Johannesburgjohannesburg.ping.hathora.dev:10000johannesburg.ping.hathora.devwss://johannesburg.ping.hathora.dev:443
Dubaidubai.ping.hathora.dev:10000dubai.ping.hathora.devwss://dubai.ping.hathora.dev:443
Mumbaimumbai.ping.hathora.dev:10000mumbai.ping.hathora.devwss://mumbai.ping.hathora.dev:443
Tokyotokyo.ping.hathora.dev:10000tokyo.ping.hathora.devwss://tokyo.ping.hathora.dev:443
Sydneysydney.ping.hathora.dev:10000sydney.ping.hathora.devwss://sydney.ping.hathora.dev:443
Singaporesingapore.ping.hathora.dev:10000singapore.ping.hathora.devwss://singapore.ping.hathora.dev:443

Integration Steps

Integrate Hathora's Ping Service into your matchmaking logic to dynamically choose the best server region for your players:

  1. Client-side Ping Requests: before a player connects to a game session, the client (game application) should ping all available server regions. Each ping request will return the round-trip time (RTT) between the player's device and the data center in milliseconds. The lower the RTT, the less delay players will experience.
  2. Server Selection in Matchmaking: once the game client has latency across all regions, it can send this data to your game's matchmaker or lobby service. In scenarios where players from different regions are connecting to the same match, your matchmaking system should find a region that provides an optimal balance for all players.