incorporating loadbalancing to custom game server

Options
miguel_hughes
edited June 2012 in Photon Server
Hi!
My company has developed a game that works with a custom photon server, and we're analyzing the possibility of integrating the loadbalancing logic. I've been browsing round the forum and the exitgames site without much luck on how to get around doing this.

I've found the LoadBalancing code source on the downloads and also a brief explanation on how it works:
The “LoadBalancing” application doesn’t add a lot of in-game features but allows you to run
multiple “game servers” to handle more games. A “master server” is the partner for clients to
connect to, find or create games. Game servers continuously report how busy they are and
the master assigns a server per room.
This is covered by a LoadBalancing API on the client side.

Is there anywhere I can find more details about the loadbalancing logic, and how it works? I can't locate the "loadbalancing api on the client side". Suggestions on how to integrate into an existing server would be much appreciated as well!

Thanks

Comments

  • Tobias
    Options
    Good pointer. We will have to catch up on that topic.

    LoadBalancing extends the Lite solution, which is maybe the base for your server logic, too.
    The LoadBalancing server is basically running multiple Lite instances which coordinate by a "Master". Your game logic would move into the game server instances (Lite).

    Client side: The API is in the client SDKs and comes with a reference documentation and samples. The Loadbalancing API uses the master server to pick rooms and then handled the re-connect to the actual game server for you.

    Which client are you using?
    The downloads are here: http://www.exitgames.com/download
  • Hi Tobias, thanks for your response and further explanation. I'll take your pointers as starting point.

    We're using the client for Unity3d and based on the lite solution.
    I just downloaded the DotNet client and found the api, although the same folder is not present in the unity3d client download. Is the loadbalancing functionality not supported on for unity?

    I found the api reference documentation on the IOS client download. It's not the same but it will do!

    Thanks a bunch.
  • dreamora
    Options
    For Unity, LoadBalancing / Photon Cloud is exposed through Photon Unity Networking (available on the asset store), wrapped into a Unity Networking alike external interface.
  • Ok, thanks for the heads up!
  • Tobias
    Options
    I just downloaded the DotNet client and found the api, although the same folder is not present in the unity3d client download. Is the loadbalancing functionality not supported on for unity?
    It is. But Unity needs all code of a project in the Assets folder, so we included the LoadBalancing API in there. A hidden feature if you will ;)
    Thanks for the heads up. It's really not clear.

    Photon Unity Networking is yet another implementation. It also does load balancing but also re-implements Unity's networking features one to one. However, those are not directly supported by the server.

    I found the api reference documentation on the IOS client download. It's not the same but it will do!
    We don't build reference documentation for the LoadBalancing API at the moment. It's available in source and it should be well commented in a way that MonoDevelop and Visual Studio could show as tooltip when you enter a method's name. Please have a look in the code whenever something is unclear.
  • Thanks Tobias, I found the loadbalancing API on the unity3d download as well. I'm going through the source code comments now.. lot's of info.

    You are correct, our code is based on the Lite solution, so using this load balancing api seem like the way to go. Than sounds easier than using PUN, right?

    Our project has 2 photon servers, a game server which handles the lobby and interaction between players; and a db server, which persists players' information and equipment.
    As far as i've read on forums and discussions, there's no support of communication between servers, so load balancing a server that does db persistence becomes a problem. The easiest way for our set up would be to load balance the game server, and leave the db server as is. I'm not too happy with this set up, as we'd like to be able to scale the db server as well. This is covered on this post: http://forum.exitgames.com/viewtopic.php?f=5&t=1514

    Any thoughts?
  • dreamora
    Options
    Right, if you use the Lite SDK already its easier to use the normal SDK cause you are used to the 'deeper complexity' already (PUN simplifies things but makes deeper access more complex)
  • Tobias
    Options
    > As far as i've read on forums and discussions, there's no support of communication between servers
    That's outdated information.
    Photon 3 supports server to server communication. Like in client to server, you can call operations, send events, etc. You could setup a distinct connector for those connections and treat the connections in a special way.

    There are special solutions for scaling a db server, so I would try out those, before attempting it myself.
  • Very well, thanks a lot both for your insights and information.