Skip to main content
All CollectionsPortal-X Pages
Design | Servers | My Servers
Design | Servers | My Servers

Set up various server configurations for your application

Jason Liang avatar
Written by Jason Liang
Updated over a week ago

This is where you declare servers that should have privileged access to your app (via the S2S API). This may be for custom tools and services you have written, or for special Room and Relay Servers that brainCloud can host (and launch) for your app.

The following server types can be configured via the My Servers page:

  • Custom Server - these are simply external servers that you want to be able to access your app via the S2S API. For additional security, it is recommended that you declare the ip ranges of these servers so that brainCloud can automatically block unwanted requests.

  • Relay Server - relay servers are a simple form of multiplayer server without business or game logic. When a user sends a message to a relay server, the server will relay that message out to all the other users in the session. Relay Servers are very useful for casual real-time multiplayer games. brainCloud V4 introduced relay servers and our relay communications protocol. Creating a Relay Server configuration for your app allows brainCloud to automatically launch Relay Servers from Lobbies.

  • Room Server - unlike relay servers, room servers contain custom game or business logic for your multiplayer experience. To configure a Room Server, you must configure brainCloud with the details of a Docker image to load when spinning up the servers. Room Servers, like Relay Servers, can be automatically launched from Lobbies.

  • Room Server Manager - this option allows you to specify the URL for a service that will act as a Room Server Manager for brainCloud Lobbies. This allows you to custom control the hosting/allocation of your own Room Servers separate from brainCloud.

  • GameLift Server - in certain situations, using a GameLift server may be a better choice as a hosting solution for your game. See the linked article for details.

When configuring Relay Servers and Room Servers, there are some special parameters to keep in mind:

  • Server Size - the size of a server to be allocated in the cloud provider. Specs on the available sizes can be found here.

  • Containers Per Server - indicates the # of docker instances to spin up on the server. The # to configure here depends upon the size of the server you've chosen, the # of users your experience supports, and the complexity of the server experience. The higher the number, the lower the # of physical servers necessary to service your app (and the lower your costs)

  • Min Ready Containers - indicates how many container slots should be available at all times. For example, if you have configured your servers to support 3 container slots, with minReady=1, and all 3 are currently in use, brainCloud will automatically spin up an additional server so that you have at least minReady>=1. If minReady were set to 0, brainCloud wouldn't proactively spin up the extra server. This will lead to quicker startup of Relay/Room server sessions - but it will also lead to higher costs for your app.

  • Max Servers - sets the maximum # of servers to spin up (per region). This is used to help control hosting costs.

  • Keep Idle Servers Warm - this specifies the number of minutes to keep unused servers around before shutting them down. Higher numbers will give quicker startup of Relay/Room server sessions - but will also lead to higher costs for your app.

  • Max Session Time - this is a watchdog timeout used to ensure that your experience doesn't get hung, leading to a server that can never be deallocated (and adds to your costs). If the max session time is hit, brainCloud will kill the container service.

  • Custom Environment - use this JSON section to specify environment variables to configure for your service. Check brainCloud API docs for details.

    {
    "PACKET_LOG_ENABLED": "true",
    "CONNECTION_TIMEOUT": "240",
    "MEMBER_TIMEOUT": "120",
    "END_MATCH_TIMEOUT": "600",
    "MAX_PLAYERS": "40",
    "ALLOW_REJOIN_BY_PROFILE_ID": "true"
    }

Room Servers include these additional parameters:

  • Docker Registry - the registry to retrieve your docker image from. Currently, only dockerhub is supported.

  • Docker Repo - the address of your docker image. Important - if your image is not publicly available, you need to give dockerhub user braincloudhost read-only access to the repo.

  • Exposed Ports - the ports that your image needs to be exposed, in the format: "80/tcp,888/udp"

And finally, all server types support:

  • Secret - the secret is used when the server communicates back to brainCloud. Each server type has its own unique secret.

Did this answer your question?