question

nestor-alonso avatar image
nestor-alonso asked

How can I create a new server instance when one server is full?

Hi,

First of all, I'm using Unity as IDE and Mirror as transport.

I'm testing to create a server for a multiplayer game.

I've upload my Server build and deployed in Playfab and I can connect with my Client build.

I've set maximum connections to 4 and the 5th can't connect, thats right.

So here its my question, How (from 5th client) can I say to my Playfab to "create a new server instance" to play?

Thanks!

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Gosen Gao avatar image
Gosen Gao answered

I don't know how you request the first server instance. If this instance allows 4 players to connect, you can request another server instance for the 5th player with the same way you request the first one. Usually, you can use Request Multiplayer Server to request server instance.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Gosen Gao avatar image
Gosen Gao answered

Please note that if the number of active servers reaches the Maximum, the client will not be able to request new servers. You need to set a suitable maximum number of servers in advance based on the needs of your game. If you mean you can only set the maximum connections to 4 because of the quota, then you can refer to Managing Server Cores Quota to request more quota.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

nestor-alonso avatar image
nestor-alonso answered

@Gosen Gao

The problem is, I've set 2 standby server and my server configuration allow max 4 players. I start to connect with the first 4 players and one standby servers go to Active and when I try to connect with the 5 user I can't and the second standby server never go to active. I belive I have to handle the connection error from the server and tell playfab use a new standby server for me, but I dont know how to do or im wrong with my aproach?
Thanks for the response!

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Gosen Gao avatar image Gosen Gao commented ·

Sorry, I misunderstood. So, you set the Servers per machine to 4. May I know what is the Maximum servers(The one next to Standby servers) you set?

0 Likes 0 ·
nestor-alonso avatar image nestor-alonso Gosen Gao commented ·

Maximum servers 2. Maximum players in the logic of my server 4. First 4 players can enter the server without problem, my question is how to handle the 5th player trying to enter to create new server instance?

0 Likes 0 ·
Dimitris-Ilias Gkanatsios avatar image Dimitris-Ilias Gkanatsios nestor-alonso commented ·

Just to be clear, our autoscaling logic has nothing to do with the number of players, it's only a matter of standingBy/active servers. Sum of standingBy+active servers is never beyond the max. So if you set up 2 max and you have 4 per machine, we will spin up one VM with 4 servers (so not to waste space) but we'll never spin up a second. Does this make sense?

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.