Gamelift runs game server instances on creation of fleet and i cannot close them

How can i disallow automatic creation of Gamelift game server instance. Always once my fleet is up, gamelift creates “ghost” server that just stays there, once i make successfully use matchmake, another server instance is opened so i have 2 servers running, instead of 1. Last time i tried it held 2 empty servers opened and i connected into game and got my player session timed out (i think it’s because it connected to new server, but game has wrong listener port).

I just found out that number of ghost servers depends on ConcurrentProcessesNumber. How can i turn off that game servers are created before MatchMaking creates one

Might be useful to understand the flow:

  • On the launch of an EC2 instance, gamelift starts up x versions of your game server (each running game server is referred to typically as a process)
    • See ConcurrentExecutions in the runtimeconfiguration part of CreateFleet
  • Each process is in a ready state to host a game session
  • GameLift asks a process to hold a game session, and that process is no longer available for other game sessions
  • When the game session is done, your server should call TerminateGameSession or OnProcessEnding to remove the game session from the process.
  • Process is then recycled for more game sessions

FlexMatch groups player together and creates a game session for them. You are responsible for terminating active game sessions which appears to not be happening as expected on your server.

The other thing todo to look at Target tracking which controls how many instances are running in your fleet at time.

You may also turn off new-game-session-protection-policy so you can manually scale down instances and terminate the game sessions on them.