Game server lifecycle
The states a game server moves through, and what moves it.
States
| State | Meaning |
|---|---|
Starting | The container is starting and has not reported Ready yet |
Ready | Waiting for a match. Allocation picks from these |
Reserved | Held back from allocation and scale-down for the time the game asked for, up to 1 hour |
Allocated | Running a match. Never scaled down |
Shutdown | Ending. The fleet starts a replacement |
Unhealthy | Missed its health checks. It is replaced |
Error | Could not be created, for example because the image does not exist |
Crashing | The container keeps exiting. Replaced if it has not recovered in 2 minutes |
The usual path
- The fleet creates the server. It is
Starting. - The game loads its map and opens its port, then calls
Ready. The server joins the pool. - A matchmaker allocates it. The server is
Allocated, and the game sees the change throughWatchalong with the match's labels and annotations. - Players connect to the address the allocation returned.
- 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.