Aquila

Game server lifecycle

The states a game server moves through, and what moves it.

States

StateMeaning
StartingThe container is starting and has not reported Ready yet
ReadyWaiting for a match. Allocation picks from these
ReservedHeld back from allocation and scale-down for the time the game asked for, up to 1 hour
AllocatedRunning a match. Never scaled down
ShutdownEnding. The fleet starts a replacement
UnhealthyMissed its health checks. It is replaced
ErrorCould not be created, for example because the image does not exist
CrashingThe container keeps exiting. Replaced if it has not recovered in 2 minutes

The usual path

  1. The fleet creates the server. It is Starting.
  2. The game loads its map and opens its port, then calls Ready. The server joins the pool.
  3. A matchmaker allocates it. The server is Allocated, and the game sees the change through Watch along with the match's labels and annotations.
  4. Players connect to the address the allocation returned.
  5. The match ends and the game calls Shutdown. The fleet starts a fresh server in its place.

A game that runs its own lobby can call Allocate on itself in step 3, with no matchmaker involved.

Health

A server built against an SDK must call Health regularly once it is Ready. By default it has 30 seconds after Ready before the first check, then must call at least every 5 seconds, and is marked Unhealthy after 3 missed periods. The fleet template can change all three, or turn the checks off.

Servers that run without an SDK use Kubernetes-style probes instead. A failing liveness probe restarts a stuck container, and a restart after Ready ends the server.

Reserving

Reserve holds a Ready server back from allocation and scale-down for the number of seconds you pass, up to 1 hour, then returns it to Ready. Calling it again restarts the timer. Use it while the game is setting something up that allocation must not interrupt.

Scale-down

When a fleet shrinks, it removes Starting and Ready servers. Allocated and Reserved servers are never removed by scaling. They end when the game calls Shutdown, when a reservation runs out and the server is Ready again, or when the fleet is deleted.

On this page