question

rob avatar image
rob asked

Is there any way to spin up/shut down servers manually?

I'm still getting to grips with how much our server can handle and when we get a surge it would be really useful to be able to manually spin up another server from the dashboard.

Also the way the load balancing works currently if you spin up a new server to handle the load it will never shut back down again if the pressure eases off. Is it possible to prioritise one server over another so that we're not running extra servers than we need to? Is there any way to prevent new games being created in a specific server?

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

·
brendan avatar image
brendan answered

Please have a look at the details of our server scaling in this tutorial: https://api.playfab.com/docs/tutorials/landing-tournaments/custom-game-servers. In short, we spin up and down servers based upon your min available instances setting. Once you drop below that, we start the process of spinning up another server. If at any time you have a server where the last game instance on it ends, we check if we can spin down that server (if that won't drop you below your min available instances setting). There's no need to handle server host spin up/down yourself if you're using our hosting.

4 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.

rob avatar image rob commented ·

I feel like the automatic spinning up and down is very limiting though. For example, if you set up a server with min free slots 1 and say max instances per host 100 then 1 server will spin up. Game start being created, but let's say that 100 instances was an unrealistic goal and you notice that it becomes impossible to create new games when there are only around 50 instances. Each new instance launched crashes. A new server will never spin up despite the fact that you desperately need one. If you edit the min free slots or the max instances values at this point it does nothing because those seem to be set when the server first spins up. So you have no choice but to bring it all offline and start again.

In addition, let's say you have a spike in traffic, enough to cause another server instance to spin up, but then it dies down again to the point where one server would be plenty. The current system will never cause the second server to shut down because the load is balanced equally across the two. Surely it would be better to prioritise one over the other so that it could be allowed to shut down once all open games on it have closed if it is no longer needed?

0 Likes 0 ·
brendan avatar image brendan rob commented ·

When using hosted game servers, testing is going to be critical in determining your max instances. If you try to run too many on a server, yes, you'll definitely have problems. The second scenario is actually not quite accurate. We don't make any effort to balance the instances across the servers - it's randomized. The idea is to prevent a sudden influx of players from causing any issues on the one server (multiple instances all spinning up at once, and players connecting). If you have a preferred model for how you want server hosting to work, you can always use the Matchmaker API to manage it directly.

0 Likes 0 ·
rob avatar image rob brendan commented ·

So what do we do in the case where a single server can handle many more games than are currently running but because peak times made us flow onto a second server there are now two running? We're stuck paying double for our servers but if one was prioritised over the other (only when it's well below capacity) it could be allowed to shut down when it's no longer needed.

0 Likes 0 ·
Show more comments

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.