← Lessons

quiz vs the machine

Platinum1740

System Design

The Game Session Lifecycle

Allocating, running, and reclaiming dedicated match servers as load changes.

5 min read · advanced · beat Platinum to climb

A match has a life

A game session is one match running on a dedicated server process. Managing its lifecycle, from allocation to teardown, is what lets a fleet serve millions of matches efficiently.

The states

  • Allocate: the orchestrator picks a server with free capacity and reserves a slot.
  • Ready: the server loads the map and waits for players to connect.
  • In progress: the match runs, the server is busy and excluded from new allocations.
  • Shutdown: the match ends, results are flushed to storage, and the slot is reclaimed.

A health and readiness protocol lets each game server report its state so the orchestrator never double books a busy server.

Scaling the fleet

  • A buffer of pre warmed ready servers absorbs sudden demand without cold start delay.
  • Autoscaling adds or removes servers based on the count of available slots.
  • Sessions are ephemeral, so a crashed match is just torn down and a new one allocated.

Key idea

The session lifecycle allocates, runs, and reclaims ephemeral match servers, with a warm buffer and autoscaling to meet demand.

Check yourself

Answer to earn rating on the learn ladder.

1. Why keep a buffer of pre warmed ready servers?

2. What happens when a match crashes?