Brendan Vanous
started a topic on Fri, 10 April 2015 at 6:08 PM
Question from a developer:
How does the PlayFab system decide when to spin up and down custom game severs, and how does that relate to "Min Free Slots" in the Game Manager?
Brendan Vanous
started a topic on Fri, 10 April 2015 at 6:08 PM
Question from a developer:
How does the PlayFab system decide when to spin up and down custom game severs, and how does that relate to "Min Free Slots" in the Game Manager?
Best Answer
Brendan Vanous said on Fri, 10 April 2015 at 6:09 PM
Here's a quick overview of how custom game servers are managed in PlayFab, starting with some definitions:
The process for getting a build uploaded and configured is described in more detail in this post. Right now, you do need to set the Min Free Slots in the Game Manager, but we'll get that added to the Add/ModifyGameBuild shortly.
So a real-world example of a configuration might be like so:
Build A
Min Free Slots - 8
Max Instances per Host - 32
For the sake of this explanation, the build only has 1 Game Mode, with a min of 2 players and a max of 16, and it's only running in 1 Region.
If you choose to use your own matchmaker server, your logic can differ, but the logic for adding players to sessions is:
Find a free slot, given the requirements in the Matchmake call. If one is found, allocate it to the user and return the server authorization ticket. If no slots are available, Matchmake creates a new Game Server Instance. The return value then has the necessary information on the Instance, along with the authorization ticket.
In this example, there are 2 Game Server Hosts running with 28 Game Server Instances each (so the two Hosts have capacity remaining for 8 more Instances, in aggregate). If no session is found in matchmaking and a new Instance is spawned, the servers would only have capacity for 7 more instances, at which point the PlayFab server wrangler would spin up a new Host.
As game sessions complete, the Game Server Build should be exiting cleanly. When it does, our wrangler will automatically pull your log and output files into S3, so that they're available in the Game Manager, and the Instance count will be updated. If the Game Server Host that had that Instance no longer has any active sessions, and there are enough free Instance slots across the remaining servers that at least Min Free Slots will still be available if that Host is removed, the wrangler will proceed with shutting down that Host.
1 Comment
Brendan Vanous said on Fri, 10 April 2015 at 6:09 PM
Here's a quick overview of how custom game servers are managed in PlayFab, starting with some definitions:
The process for getting a build uploaded and configured is described in more detail in this post. Right now, you do need to set the Min Free Slots in the Game Manager, but we'll get that added to the Add/ModifyGameBuild shortly.
So a real-world example of a configuration might be like so:
Build A
Min Free Slots - 8
Max Instances per Host - 32
For the sake of this explanation, the build only has 1 Game Mode, with a min of 2 players and a max of 16, and it's only running in 1 Region.
If you choose to use your own matchmaker server, your logic can differ, but the logic for adding players to sessions is:
Find a free slot, given the requirements in the Matchmake call. If one is found, allocate it to the user and return the server authorization ticket. If no slots are available, Matchmake creates a new Game Server Instance. The return value then has the necessary information on the Instance, along with the authorization ticket.
In this example, there are 2 Game Server Hosts running with 28 Game Server Instances each (so the two Hosts have capacity remaining for 8 more Instances, in aggregate). If no session is found in matchmaking and a new Instance is spawned, the servers would only have capacity for 7 more instances, at which point the PlayFab server wrangler would spin up a new Host.
As game sessions complete, the Game Server Build should be exiting cleanly. When it does, our wrangler will automatically pull your log and output files into S3, so that they're available in the Game Manager, and the Instance count will be updated. If the Game Server Host that had that Instance no longer has any active sessions, and there are enough free Instance slots across the remaining servers that at least Min Free Slots will still be available if that Host is removed, the wrangler will proceed with shutting down that Host.
1 Person is following this question.