Choosing an Engine Region
Tips and suggestions for choosing your Battlesnake's engine region.

Why Engine Regions?

There are developers from all over the world in the Battlesnake community, and we've heard that latency can be a big issue. The main Battlesnake servers are currently located in the us-west2 (Oregon) datacenter operated by Amazon Web Services (AWS), and by default the response time of a Battlesnake request is measured from there. Although you can deploy your Battlesnake into a hosting provider that's close to Oregon, local development can end up being difficult if you're located on a different continent. Many services that make hosting easier, like Replit, also don't operate in regions that are nearby.

What are engine regions?

We've deployed servers around the world that can handle making the requests to your Battlesnake, and we can measure the response time of your Battlesnake as seen by a server that's geographically closer to where it's deployed. So if your snake is hosted on your home network somewhere in Europe, you can change a setting on your Battlesnake to send requests through the region in the Netherlands, and avoid losing several hundred milliseconds every turn in network latency between the main Battlesnake servers and your Battlesnake.
Using these alternate regions does not affect which Battlesnakes you can play against, the rules of the game, or the matchmaking in arenas. The region is just used to measure the response time from your Battlesnake as seen from a different geographic location.

How do I change my Battlesnake's region?

Go to your profile at http://play.battlesnake.com/me, find the Battlesnake you want to change, and click "Edit". You'll see a dropdown called "Engine Region", which will default to the primary region in AWS US-WEST-2 (Oregon).
Editing your Battlesnake
Options for a Battlesnake's Engine Region
Selecting one of the other regions and clicking "Save" will refresh your Battlesnake's metadata through the region. If it's reachable and returns a valid response, you'll be able to see the new latency next to your Battlesnake. Hover your cursor over the "Latency" element to see the exact number in milliseconds. From now on, all Battlesnake API requests will go through the new engine region, hopefully giving your Battlesnake more time to think!

How should I choose an Engine Region?

Choosing the right Engine Region might be a little confusing depending on where you are, and where your Battlesnake is hosted. We highly encourage testing with a few different Engine Regions to see how it affects your latency. If you're worried about affecting your snake in a League or Arena, you can make a new snake and re-use the URL.
Here are some tips for common hosting setups:

Running on Replit

  • Replit decides where to run your repl based on your geographic location. They have several datacenters around the world, and pick one automatically for you when you create the repl.
  • If you're in North America, Replit currently seems to deploy in a region on the east coast. As a result, the "GCP US-EAST4" region may have lower latency.
  • Otherwise, you should pick the region that's closest to you geographically.
  • If you're traveling, or using a VPN, Replit might not detect your location accurately. In that case, test out the other regions and see if you get a better result.
Running locally with Ngrok
  • Choose a region that's close to what Ngrok shows in the "Region" field in your terminal.
  • You can force Ngrok to use a different region for a tunnel with the --region option.

Running on AWS, GCP, etc.

  • Pick the region that's closest to the cloud provider's location/region you've deployed your code into.
  • e.g. for AWS us-east-1, use "GCP US-EAST4".

Running on Heroku

  • If you're using the "United States" Heroku region, use the "GCP US-EAST4" region.
  • If you're using the "Europe" Heroku region, use the "GCP EUROPE-WEST4" region.

Currently supported engine regions

  • Amazon Web Services (AWS)
    • US-WEST-2 (Oregon)
      • This is the default region
  • Google Cloud Platform (GCP)
    • GCP US-EAST4 (Virginia)
    • GCP EUROPE-WEST4 (Netherlands)
    • GCP ASIA-SOUTH1 (Mumbai)
Last modified 9d ago