The AppWarp S2 game server is designed to deal with high volumes of traffic and CCUs (Concurrently Connected Users). Take a look at our benchmarking results to get an idea about the server performance. However depending on server side application logic, architecture and expected traffic – one may decide to deploy multiple AppWarp S2 game server instances. In such cases, a need for a central service to redirect clients to the desired game server instance arises. This page discusses these cases and how AppWarp S2 Master server can be used to facilitate the solution.

When are multiple AppWarp S2 server instances needed?

Following are two common cases where you might consider deploying multiple instances.

High volume of traffic and CCUs

It is encouraged to always keep an eye on the performance of your AppWarp S2 server application. Since the server runs in a JVM, popular tools such as JConsole can be used to monitor performance under different conditions. You should also vary JVM parameters (-server -Xms1G -Xmx1G etc.) and optimize for your application. If even after fixing any performance issues, the JVM is performing poorly under the expected load, you should consider scaling the server. Scaling vertically (buying better hardware) is easier and will suffice if the expected peak load is say 2X or 3X of what you can handle with your current hardware. If however the expected peak load is say 10X or more, then its better to consider scaling horizontally. To do this you will need to deploy multiple AppWarp S2 server instances.

Cover different geographies

It may be the case that the expected traffic to your game server is from different geographies. In this case, the ping time for clients can vary depending on their location with respect to the location of the AppWarp S2 server. For example the RTT (round trip time) for TCP message from a US server to a client in South Asia is about 600 ms. However the RTT to a client which is also in the US is only about 100 ms. So if your game is particularly sensitive to latency and if different clients have different latency impacts your game-play, then this is a problem. In such cases you would need to deploy different AppWarp S2 server instances at different geographies and the clients connect to the one that is closest to them.

What is a Master server?

Now lets assume that you have decided that your application will require multiple AppWarp S2 instances. Now the problem to be solved is how do the clients know which server to connect to. At a given point of time, a client will have more than one choice of server (and app zone) to connect to. There needs to be a central service through which clients can discover the game server address (and app zones). This central service needs to be at least aware of the addresses of the game servers and also their health i.e. if they are running or stopped (eg: during maintenance or crashed). Such a central server which provides clients with meta information about game servers is known as Master Server.

The following diagram illustrates how the master server fits in with the AppWarp S2 game server

Now you can either implement your own Master service that the clients query or you can use the AppWarp S2 Master server i.e. the master server provided by us.

What is the AppWarp S2 Master server?

AppWarp S2 Master Server is an implementation of master server provided by us. Its Java based server that works by connecting to the array of game server instances and monitors their status and maintains certain information about them. The AppWarp S2 client SDKs come equipped with APIs that can be used to communicate the AppWarp S2 Master Server. The master server interacts with game clients and game servers over TCP. Similar to the AppWarp S2 game server, the master server is also customizable and developers can extend it via the use of server side adaptors and interfaces. So using this developers can write their own customized load balancing logic for example.

The interaction between AppWarp S2 Master server with game client devices and game server instances is illustrated in the diagram below

Both sides of the interaction can be extended and modified by developers if required.

Getting Started

The way to get started with AppWarp S2 game server is to get your hands dirty with a sample.

Master Server Sample Walkthrough