Simultaneous client requests to create game sessions

0

I have a Unity Custom GameLift server deployment and everything seems to startup, run, and shutdown correctly. The clients can connect to the server and communicate as expected. So all works well in general.

My concern is for the case when there are no active game sessions and two clients request to create a new game session at the same time. With my setup, only one of them gets created and the other client errors out with FleetCapacityExceededException: Unable to reserve a process on fleet. This create call is wrapped in a retry block so it does retry again after 2, 3, then 5 seconds, but still fails.

The Launch Path for the Unity game executable has Concurrent processes set to 1. The Max concurrent game sessions activation is set to No Limit. There’s only one active server instance.

I guess I expected that simultaneous requests to create game sessions would actually spawn multiple sessions. Maybe I’m not understanding the relationship between the Concurrent processes of the game executable and game sessions. Can you have multiple game sessions for a single game process?

Any feedback or help would be greatly appreciated. Thank you

已提問 3 年前檢視次數 300 次
4 個答案
1
已接受的答案

You are right, if you don't have have available processes to host game sessions, your creategamesession calls will fail with that exception. You can use autoscaling, multiple processes per instance etc to get around this problem. Your Fleet metrics should show you all the data you need.

Also ensure you are terminating game sessions correctly to free up the server process for another session.

And you are also right that when running multiple servers per instance, each server needs to run on its own port and accurately report that port via the ProcessParams passed via ProcessReady.

已回答 3 年前
profile picture
專家
已審閱 19 天前
0

Ok, after some more experimentation and a couple re-reads of other posts, it is my understanding that the allowed amount of Game Sessions is tied directly to the number of Concurrent processes for the game executable configured in the fleet.

The reason my simultaneous create game session requests failed is because there wasn't another available process to run the game.

I also want to say that if you have multiple game sessions, make sure your server picks a different port for each game session, otherwise you'll have some potential cross session communication.

If someone else can weigh in on whether or not this is accurate, that would be awesome.

thanks

已回答 3 年前
0

Also pay attention to the values for GameSessionActivationTimeoutSeconds and MaxConcurrentGameSessionActivations in your CreateFleet settings, both can impact the availability of new sessions.

已回答 3 年前
0

This solidifies it for me, thank you!

已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南