server2server problem

Options
mad_sir1
mad_sir1 ✭✭
edited June 2013 in Photon Server
hi,I am back ,I learn the photon server 2 server in recent days,I have a confusion question,
1: how many gameserver does a physical computer host!.
2. I use the loadbalancing tu my game, and players can enter the lobby ,join games and creat games,so how many rooms can a gameserver can host.
3.if I want to creat two region ,players can chose one to enter and there are 20 rooms in one region, playes can chose a room to enter the game,the 20rooms are the same game,can I ues the loadbalancing framework to my game, it means one region(for example Asia region,or America region)consist of a master and many gameservers?
4.the game server (such as the login server ,chat server,scene server ) run on the photon server,so if i have two region(for example Asia region,or America region),how many physcial computers can I finish one region.

5.I have noticed a question,what is the loadbanlacing work flows ,if we want to communicate with other players,someone says like this ,a client connect to the master and then the master pass the message to the players, others say,a client just connect to the chat server and send a message to the chat server,the message doesn't go through the master,which opinion is right? anyone can help me ,thanks!

Comments

  • Hi,

    sorry for the late response.

    1. In the Photon SocketServer SDK, we have a Photon Configuration that starts 2 game server applications. This is only for demonstration purposes.
    On a production machine, you usually have 1 Photon per machine, which loads 1 game server application.
    (Technically, it is also possible to run multiple Photons on one machine or load multiple Game Server applications - depending on your needs. But in most cases, 1 machine = 1 Photon = 1 GS is sufficient).

    2. There is no hard limit. You might have a CCU limit, based on your license, but no room limits.
    Depending on your game logic, a quad-core machine like an Intel Xenon 3440 can host ~ 1000 CCUs; if you have a bigger server, the network interface / bandwidth might become a bottleneck before you run out of CPU power. (This is only a rough guess and can vary A LOT for your application! Run your own load tests.)

    3. Right. You'll have a master + X Game Servers for one region. Your clients need to choose the correct Master - either hard-coded, or by ping roundtriptimes etc.

    4. There is no limit - you can connect an (almost ;)) infinite number of game servers to each master server.

    5. The Basic Workflow is described here: http://doc.exitgames.com/photon-server/LoadBalancing/
    The master only assigns players / rooms to a Game Server. The rooms are actually created on a Game Server, once the clients have joined a room, they disconnect from the master and all messages are only send through the Game Server.
    So your Master needs to be able to handle the "matchmaking" load, while the Game Servers need to handle the actual "game load", messaging etc.
    A rough guess is that the master has ~ 10% of the load and the Game Servers have ~ 90%, depending on how often your clients re-connect or how long they stay in a game.

    Hope this helps!
  • mad_sir1
    Options
    thanks Nicole!,I have know a lot that is very great ,as you say,a machine can host 1000CCUs, if I have open 50 rooms a gameserver ,dose it means that one room only can host 20 players? if so I think I have to realse the room to 25 rooms
  • As I said, it depends a lot on your game logic. :) I had small rooms with 2-4 players in mind. Be aware that larger rooms generate much more traffic:

    Example:
    4 players in 1 rooms, each calls 10 "RaiseEvent" operations per second = 40 incoming requests & 40 outgoing responses. Each event is also sent out to 3 other players in the room: 40 * 3 = 120 additional outgoing messages per second. Makes 40 incoming + 160 outgoing messages in total per room. Lets say you have 5 rooms (=20 players in total): 200 incoming + 800 outgoing messages.

    Now lets say these 20 players are all in one room:
    20 players in 1 room -> 10 "RaiseEvent" / s => 200 incoming requests & 200 outgoing responses. Each event is sent to 19 other players in that room: 3800 additional outgoing messages. In total: 200 incoming requests + 4000 outgoing messages. 5x the amount of the smaller game.

    The capacity of your server depends on: peers, room sizes, amount of messages per second and message size. The more players per room, the less messages per second should be sent.

    You'll need to make some upfront calculations and / or run load tests to estimate how much traffic you'll generate, what your requirements for your network infrastructure & bandwidth are. Computing power (CPU / memory wise) isn't the bottleneck in most cases.

    Hope this helps!