Create account

Fleets

Run game servers from a container image in the locations you choose, and scale each location on its own.

What a fleet is#

A fleet runs your game server image as many copies, in one or more locations. Players are matched onto a ready server with an allocation, which marks that server as in a match so it is not given to anyone else. A server in a match is never stopped to make room: when you scale down, remove a location or delete the fleet, the servers that are in a match finish first.

A fleet belongs to one environment, and its name is unique among that environment's fleets.

Create a fleet#

  1. Open Fleets

    In the console, choose Fleets, then New fleet.

  2. Say what it runs

    Pick the project and environment, name the fleet (lower-case letters, numbers and hyphens), and give the image, for example ghcr.io/acme/arena:1.4.0. Add at least one port the game server listens on (1024 to 65535; 9357 and 9358 are reserved), and the CPU and memory each server asks for, such as 500m and 512Mi.

  3. Say where, and how much

    Add a location for each place it should run, and set how it is scaled there (below). A fleet runs in up to 10 locations.

  4. Create it

    Choose Create fleet. A location shows Waiting for a cluster until a cluster has taken it, and then the servers it reports.

Scale each location on its own#

Every location has its own settings, so one fleet can be large in one place and small in another. Open Locations and scaling on the fleet to change them.

SettingWhat it does
ServersHow many game servers the location runs. 0 pauses it. With Scale with demand this becomes Fewest servers: the location never runs fewer.
PriorityWhen an allocation could be served from more than one location, the higher priority is preferred.
Scale with demandLets the platform grow and shrink the location with the number of servers in a match, between Fewest servers and Most servers.
Most serversThe most the location can ever run. Your limit, and the room on the cluster, are counted at this number.
Keep spareHow many ready servers are kept above those in a match, as a number or as a percentage (below).

Spare servers: a number or a percentage#

A location that scales with demand keeps ready servers spare so a new match never waits for one to start. Choose how to size the spare ones, with Servers or Percent. You set one or the other, never both.

  • Servers keeps that many spare, and at least 1.
  • Percent (1 to 99) keeps that share of the servers in a match ready as well. It suits a large location, where a fixed number is the wrong size. It needs at least 1 server to start from.

The form checks these rules before it sends anything, and the API checks them again.

Read a location#

  • Servers on the fleet list adds up what each location reported: ready, and in a match.
  • In Locations and scaling each location shows what it is set to, such as 2–50 · 20% spare, and what its cluster last reported. The report is advisory and can be a few seconds old.
  • Could not be placed yet means there is not yet room for all of that location. The rest is still running, and the platform keeps trying: the message clears when room is found.
  • Probe address is where a client can measure its distance to the location, to pick the nearest one when it allocates. Time a GET of it from the player's side and discard the first request, which pays for the TLS handshake.

Change a fleet#

  • Edit changes the name, or replaces the spec (image, ports, resources, variables).
  • Scale on a location replaces that location's whole setting. Taking a location back to a fixed size is the same form, with Scale with demand off.
  • Add a location and Remove change where it runs. A removed location drains first.
  • Delete starts draining the whole fleet. It stays in the list until the last server in a match has finished.

If someone else changed the fleet while you had it open, the change is refused with a conflict instead of overwriting theirs: reload and try again.

Use the API#

Everything above is available over the API. Each location is its own resource, with its own scaling.

RequestDoes
POST /v1/environments/{environment_id}/fleetsCreate a fleet with its locations
GET /v1/environments/{environment_id}/fleetsList an environment's fleets
GET /v1/fleets/{fleet_id}One fleet, with each location's status
PATCH /v1/fleets/{fleet_id}Change the name or spec (If-Match required)
DELETE /v1/fleets/{fleet_id}Start deleting (If-Match required)
PUT /v1/fleets/{fleet_id}/locations/{location_id}Add a location, or replace one whole
DELETE /v1/fleets/{fleet_id}/locations/{location_id}Remove a location (If-Match required)

A location's scaling is replicas and priority, and autoscaling with max_replicas and either buffer_size or buffer_percentage. Sending both is refused. The ETag of a fleet or location is its version: send it back in If-Match when you change or delete it.