question

Christopher Kranebitter avatar image
Christopher Kranebitter asked

How many servers can I run on a single VM?

I've been working on a turn-based strategy game in Unity using DarkRift2 for the server.
I am using PlayFab for player account management, matchmaking, and server hosting. I am very happy with PlayFab as everything seems to be working as intended, however, I am still confused about how to scale the servers effectively.

As far as I understand it, you are billed per VM per hour. Because my game is turn-based, the server executable requires very little computing power. So ideally, I want to run as many servers as possible on the same VM. For testing purposes, I tried setting the 'servers per machine' to 100 in my build and got an error saying that the number of ports on a VM can not exceed 60. Because there are two ports (one for TCP and one for UDP) this would mean that I can only run a maximum of 30 servers per VM. This would be pretty wasteful, as I could easily run hundreds of servers on the same machine without running into performance issues.

Is there any way to circumvent this 60 ports per VM limit? If not, what are my options to use the available resources as effectively as possible?

Thanks in advance,
Chris from Dreamlabs

multiplayer
10 |1200

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

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

Correct, the number of maximum servers per machine is 60,due to the limit on ports per VM. As a workaround, you can try hosting multiple sessions in single server instance as described in this thread: https://community.playfab.com/questions/41608/is-it-possible-to-host-multiple-game-sessions-on-o.html. And, we also a feature request regarding this: https://community.playfab.com/idea/36522/increase-servers-20-port-limit.html, please vote on this because more votes can help us prioritize our work.

10 |1200

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

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.