- Newest
- Most votes
- Most comments
I took a quick look at logs and metrics for your fleet "fleet-******
Example logs:
30 Nov 2021 08:36:44 Received health report from process: 2538, isHealthy: true
30 Nov 2021 08:37:44 Received health report from process: 2538, isHealthy: false
30 Nov 2021 08:38:44 Received health report from process: 2538, isHealthy: false
30 Nov 2021 08:39:44 Received health report from process: 2538, isHealthy: false
30 Nov 2021 08:39:53 Detected a process (pid: 2538) that has been unhealthy for more than 180 seconds. Terminating the process.
This can be fixed by determining why you are returning false in the OnHealthCheck
callback, and switching it to return true.
In the future, you can debug this on your end by:
-
Looking at the AvailableGameSessions metric, and noticing how it is constantly fluctuating: REMOVEDUPLOAD
-
Looking at fleetEvents for your fleet and looking for "SERVER_PROCESS_TERMINATED_UNHEALTHY" fleet events: https://docs.aws.amazon.com/gamelift/latest/apireference/API_Event.html#API_Event_Contents
Hi @REDACTEDUSER
Getting FleetCapacityExceededException means that there are no game server processes running on your fleet that are available to host your gameSession. If you have enough capacity/hosts under your fleet then there is likely some issue with your server processes causing GameLift to think they are unhealthy and not available for a GameSession.
Steps to debugging further:
- Check the "AvailableGameSessions" metric for your fleet in cloudwatch or the GameLift Console to determine if your serverProcesses are healthy. - https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html
- Check the Fleet Events in the GameLift Console for any abnormal server process terminations. - https://docs.aws.amazon.com/gamelift/latest/apireference/API_Event.html
- SSH (or RDP) onto the GameLift instance and try to start up your serverProcess to see if it works - https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-remote-access.html
- Validate you're integrating correctly with the GameLift Server SDK https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-server-sdk-csharp-ref.html
Maybe something misunderstand. Let me explain my game flow: A client create a room, and wait for others to join to play together. when client request to create a room by CreateGameSessionAsync method, gamelfit will start 1 game server instance (server build I uploaded ), and if successful, it will return to my client ip address and port of server instance, and client connect to that ip/port to join this room and play. If a game session successful created, it appear on "AvailableGameSessions" metric. But this exception occur sometimes when client call CreateGameSessionAsync method, mean that can't create a game session, or gamelift can't start my game server instance, is that right? I think It's not related to "AvailableGameSessions" in gamelift console. In detail of the error, it said: REMOVEDUPLOAD So I guess it's something wrong with gamelift fleet? I think i have intergrated correctly with Gamelift Server SDK, because this exception not occur all the time. Sometimes, i can create game session and join to play normally.
That's it, I know what's the reason. I was implemented that if no client connect to server after 30 seconds, set healthy to false, so it'll auto shutdown if no client connects after long time. But it was wrong, I should check it after game session start, because when server is idle, ofcourse no client connect, and if i set healthy to false, it can't create game session after that :D Do you have any advice what should I implement in OnHealthCheck? or just simply return true ? Thank you very much!
OnHealthCheck should return true if you want to be able to create a GameSession on that serverProcess. Returning False will make it so that GameLift does not consider the serverProcess as available.
If there are any conditions during which you wouldn't want a gameSession to be placed on a serverProcess (for example: maybe something went wrong with the serverProcess Initialization), then you should return false, but otherwise returning true is correct (so that the process can be used).
Relevant content
- Accepted Answerasked 10 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated a year ago