Server hold

Warning: This feature is in closed beta and accessible by permission only.

Server hold is a management pattern which allows a server to remain capable of receiving an allocation or executing a reservation for a specified period of time.

In most cases, initiating a server hold is only functionally applicable for reservation-based fleets, however, the feature is also available to fleets which handle allocations.

Problem context

With a reservation-based fleet, Game Server Hosting cannot select the best server for an incoming match. It cannot scale as efficiently as an allocation-based fleet and as such reserved servers can be left fragmented across many machines. Machines that contain no reserved servers are considered for shutdown and deletion based upon pre-configured TTLs.

Due to the potential fragmented nature of reserved servers, it can be difficult for Game Server Hosting to effectively cost-optimise reservation-based fleets. Shorter TTLs allow for unused machines to be deprovisioned more quickly (saving cost), but without careful management of the server lifecycle, machines which have short TTLs are more likely receive reservation requests during shutdown, causing interrupted game sessions. For example, a player could join a server as it is about to be turned off. This can be resolved without the server hold solution by having a longer machine shutdown TTL, but this comes at a financial cost.

Solution

Holding a server allows the machine the server is running on to be kept alive past its pre-configured TTLs. The hold timeout can be configured on a per-server basis, however, from a Game Server Hosting perspective, the timeout furthest in the future will be taken into account when making the decision as to whether a machine should be deprovisioned. Note that holding a server does not negatively influence the number of available servers - the server hold only influences deprovisioning, not provisioning of new machines.

Game Server Hosting recommends the following behaviour:

  • A server is held for a period of time based upon one, or a combination of the following:
    • Average match time: Players finishing a match could join another server
    • Current or short-term future server demand: A spike in traffic is predicted by the game developer
    • Average time to receive new players: If a server has not received players in this time, it is likely the capacity is not needed
  • The server hold period is periodically checked by the server and refreshed if necessary
  • The server hold is removed if the capacity is no longer required

Holding a server has the following benefits:

  • More efficient scaling: machines can be shut down and deleted quicker and more safely
  • Guaranteed game sessions: a server which becomes reserved is guaranteed to be live as long as it has been held some time beforehand
  • Improved server lifecycle: the lifecycle of server is more tightly controlled by the game studio, rather than Game Server Hosting

Executing a server hold

A server hold can be created, viewed and removed by executing the relevant endpoint on the Local Proxy. API documentation can be found here.

By creating a server hold, the server in question transitions into the HELD state. A server cannot transition into this state if it is in any of the ALLOCATED or RESERVED states.

Server hold expiration

A server hold can be expired manually by calling the DELETE endpoint specified in the documentation above.

Aside from this, a server hold is expired automatically under all of the following conditions:

  • The timeout specified in the latest hold request has been exceeded (the server transitions to the ONLINE state)
  • The server has been allocated (the server transitions to the ALLOCATED state)
  • The server has been reserved (the server transitions to the RESERVED state)
  • The server has been manually stopped (the server transitions to the AVAILABLE state)
  • The server has been manually restarted (the server transitions to the ONLINE state)
  • The active build configuration has been changed (the server transitions to the ONLINE state)

A server hold does not expire automatically under the following conditions

  • The server exits itself with any return code

It is important to note that if a server hold is required after an allocation or reservation has been removed, the server must create a new hold; the platform does not move the server back into the HELD state even if the previous timeout would not yet have been exceeded.