Search Unity

Question Servers closing themselves!

Discussion in 'Game Server Hosting' started by anrelivant, Jan 15, 2024.

  1. anrelivant


    May 30, 2023
    Hello everyone. I'm making an Online game which includes Game Server Hosting(Multiplay) and Matchmaker system (And Netcode for Gameobject of course). So basically, I installed a Linux Server in Multiplay on UGS. Then I created Build Config, Fleet etc. Then, I created a Test Allocation within Game Server Hosting. And it was allocated properly. However today, when I opened Cloud Dashboard, I couldn't see any Servers from Game Server Hosting. Somehow they didn't appear on Dashboard. But when I turned Fleets off and on, problem was solved. My question is; Why did Fleets turn themselves off and not appear on Dashboard ?
  2. ajdaniel_unity


    Unity Technologies

    Jul 19, 2019
    A server, after allocation, will deallocate itself after 1 hour by default. Servers are not expected to stay running for longer than that.
  3. firdiar


    Aug 2, 2017
    is there a way to make it always enabled? i need to make a lobby room that always active
  4. mcanfield_unity


    Unity Technologies

    Mar 1, 2022
    @anrelivant check under your Fleets for the "Scale settings" tab, if you have "min available" set to 0 then your fleet will scale down to 0 when no game sessions are available for a machine to run. As long as "max available" is greater than 0, game sessions will still be allocated on demand, but will take a longer time to startup for the first allocation request. This is a cost savings feature for your benefit. You can essentially think of the "min available" setting as a configuration for cold vs warm startups. If you set it to 1 (or more) it will keep that many machines running 24/7, ready for game session allocations. You'll be charged for that constant uptime, whether game sessions occur or not. We generally recommend folks to keep that at 0 until you have a live game. While actively developing and deploying you can bump it to 1 to have snappy allocations, then turn it back to 0 when you go home for the night. In production you'll likely want to have fine tuned that setting to your expected player load.

    Be aware that Multiplay is primarily targeted for session based games. As Andy mentioned there is also the concept of session allocation timeouts. The default allocation lifetime of a game session is 1 hour, after which the game server will shutdown. However, that can be increased via the service api. The danger there is you need to ensure you're managing your game lifecycle accurately so that servers don't stay online incurring charges that you are responsible to pay. See details here:

    Warning: I'll reiterate that setting long allocation TTLs to your game server could lead to higher hosting costs for your game. Please consider deallocating any game server not running an active session to prevent cost overruns.

    @firdiar if your lobby isn't tightly coupled to gameplay code you could look into our Unity Lobby service as it is always active. We also have Cloud Code functions that can be used for serverless logic handlers (works with C# code). We also have the "Unity Realms" service in closed beta that allows you to essentially create a named handle on a game server, associate some metadata, and attach an embedded database. The end result is a list of servers that you can query and bring online/offline as needed, but the compute resources are only needed when players are present. If you describe your use case in a bit more detail I could provide additional information about our services that might be helpful in your architecture.
    Last edited: Jan 16, 2024