multiple servers under same domain
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
-
- Posts: 1
- Joined: Sun May 17, 2009 10:35 pm
multiple servers under same domain
Hi , we are about to build a l2j platform. We were talking about scalability when some doubts came up. If we reach a a peak of max players allowed in server, we will probably need to supply more game server room to players. IS there a way to host multiple servers under one domain and run them under same conditions, talking to the same database so when players connect to another server under that domain the playing experience is completely transparent for users ? That way users could always be playing without loosing their data. Hope to hear soon from you.
-
- Posts: 271
- Joined: Wed Mar 19, 2008 10:16 am
Re: multiple servers under same domain
DB is only used as a "data store". Live data is in the L2J process. For example, when a character connects, it's info are loaded from DB then character lives only in memory. when it disconnect, data is saved back to DB. (well, there are some save done during the time he is online but only from time to time)
I don't see any way to have several servers sharing the same world and players but running on separate computers...
I don't see any way to have several servers sharing the same world and players but running on separate computers...
-
- Posts: 7
- Joined: Wed May 20, 2009 9:00 am
Re: multiple servers under same domain
What I wanted to mean is : Imagine you have your database on a dedicated cluster, in to another server on the local network. You have redundancy and high availability on your databases. But now you want the same thing with the game servers. For that you could use four servers. Three of them for playing and one for testing new versions. Now. Is there a way to make users connect to any of the three servers, being the server IP transparent for them ? For example, hosting all three servers under the same domain ? That way, if the server now supports 2.000 players per host, you could host 8.000 players at the same time. If there is not such way to do that, how do you scale your gameplay servers ? It's clear that all the servers connect to the same database cluster, but the server scaling in terms of number of players and availability is the real doubt.
Thanks. ( I'm following the thread with a question because lazydog is a member of our crew, just extending it ! )
Thanks. ( I'm following the thread with a question because lazydog is a member of our crew, just extending it ! )
-
- Posts: 271
- Joined: Wed Mar 19, 2008 10:16 am
Re: multiple servers under same domain
That's what I was talking about...
Using PHP/JSP web pages,you may have all info (including session) in the DB. that way, people can connect on any server from the farm and see the same thing.
Here, the situation is different.
DB : saved characters (all characters, online or offline), span points, Mob characteristics, items characteristics, ...
L2J : online players (with all "active only" data, like info about the connexion), spawned mobs (a same mob may be spawned several times although he only appears once in the DB. Spawn points in DB are INITIAL position of mobs, once spawned, they move, data in DB holds initial HP/MP, L2J holds CURRENT HP/MP + buff/debuffs/...), ...
If you put two servers, they may share the same DB but if player a is on server A and player b on server B, player a WON'T see player b. If player a and player b are hitting the same mob (each on their respective server), they hit "different" mobs in reality (damages done by player a on server A don't appear on the mob that player b on server B is attacking)
That's the reason why on L2off (I mean official server, not the pirated server) you have the choice among several servers. You see the same thing for UO, WoW, ... AFAIK, the only big MMORPG (I mean with several thousands players online) where all players are in the same world is Eve Online (150.000 players in same universe).
Using PHP/JSP web pages,you may have all info (including session) in the DB. that way, people can connect on any server from the farm and see the same thing.
Here, the situation is different.
DB : saved characters (all characters, online or offline), span points, Mob characteristics, items characteristics, ...
L2J : online players (with all "active only" data, like info about the connexion), spawned mobs (a same mob may be spawned several times although he only appears once in the DB. Spawn points in DB are INITIAL position of mobs, once spawned, they move, data in DB holds initial HP/MP, L2J holds CURRENT HP/MP + buff/debuffs/...), ...
If you put two servers, they may share the same DB but if player a is on server A and player b on server B, player a WON'T see player b. If player a and player b are hitting the same mob (each on their respective server), they hit "different" mobs in reality (damages done by player a on server A don't appear on the mob that player b on server B is attacking)
That's the reason why on L2off (I mean official server, not the pirated server) you have the choice among several servers. You see the same thing for UO, WoW, ... AFAIK, the only big MMORPG (I mean with several thousands players online) where all players are in the same world is Eve Online (150.000 players in same universe).
-
- Posts: 10
- Joined: Wed Apr 15, 2009 7:15 am
Re: multiple servers under same domain
In theory it's possible to run lj2 in cluster over terracota (http://www.terracotta.org), but it was not designed from start to work in such way, so starting cluster would be extremely hard.
-
- Posts: 7
- Joined: Wed May 20, 2009 9:00 am
Re: multiple servers under same domain
That's interesting. In what terms you mean it is not designed to work with java clustering ? Can you explain a little more ? Didn't know that there was an opensource exclusive java clustering solution. We already have a clustered mysql server, so I want to really know where far we can get with this.
-
- Posts: 271
- Joined: Wed Mar 19, 2008 10:16 am
Re: multiple servers under same domain
Let's make a comparison with a simple server using an unique domain : IRC
IRC servers have to communicate so all messages are available from all servers... If user a send a message, the message moves to his server then is relayed to the other server then to user b.
With L2J, all "messages" that have to be relayed are :
- Characters in game
- NPC
This means an huge amount of data.
The DB don't hold the "runtime" data but static info. Object dropped on ground, inventory, current HP/MP of players and NPC, ... are all held in memory. From time to time, a backup may be done for some info but some other info are never backed up (for example, the NPC HP/MP) and some info is only backed up from time to time and not on every change... So DB is not a correct way of data exchange.
To have a cluster of L2J, you'd need to program the whole data sharing system... which is far from an easy task and would add much more work on server... There are lots more NPC than players... and every single NPC would have to be shared...
IRC servers have to communicate so all messages are available from all servers... If user a send a message, the message moves to his server then is relayed to the other server then to user b.
With L2J, all "messages" that have to be relayed are :
- Characters in game
- NPC
This means an huge amount of data.
The DB don't hold the "runtime" data but static info. Object dropped on ground, inventory, current HP/MP of players and NPC, ... are all held in memory. From time to time, a backup may be done for some info but some other info are never backed up (for example, the NPC HP/MP) and some info is only backed up from time to time and not on every change... So DB is not a correct way of data exchange.
To have a cluster of L2J, you'd need to program the whole data sharing system... which is far from an easy task and would add much more work on server... There are lots more NPC than players... and every single NPC would have to be shared...
-
- Posts: 10
- Joined: Wed Apr 15, 2009 7:15 am
Re: multiple servers under same domain
I mean that nobody thought about clustering while developing l2j.dcreatorx wrote:That's interesting. In what terms you mean it is not designed to work with java clustering ? Can you explain a little more ? Didn't know that there was an opensource exclusive java clustering solution. We already have a clustered mysql server, so I want to really know where far we can get with this.
-
- Posts: 271
- Joined: Wed Mar 19, 2008 10:16 am
Re: multiple servers under same domain
Some facts about clustering and big number of players :
1) all server must have the whole world status shared which means Players + NPC + items on ground + ...
2) the more players there are, the less zones are empty which means that you won't be able to "turn off" empty zones to lower load on servers (unload NPC, geodata, ... from empty zones)
3) to share the data among server will require low latency on such exchanges... If data packets are sent to players every 50ms, then the data sharing must also be every 50ms or better
A way that could help is to have NPC servers managing all info about NPC. They would use a "trusted" variant of the client protocol (which means that these servers would set the MP/HP/... of NPC, while the servers set the Players info). The NPC servers could send their info to all Game Servers and the game servers would only have to share the players info at send "item update" packets each time someone drops/picks up an item. That architecture *could* make clustering possible...
But L2J architecture is monolithic and very different from that cluster-architecture... So attempts at making it work in cluster would only result in having more losses than gains (like 1x200 players -> 2x80 players or even less).
Now, I'd refer to L2J core developpers and Java gurus, but I think that L2J uses many threads and as such, may get lots of improvements in capacity if you increase the number of cores/CPU and the RAM size...
1) all server must have the whole world status shared which means Players + NPC + items on ground + ...
2) the more players there are, the less zones are empty which means that you won't be able to "turn off" empty zones to lower load on servers (unload NPC, geodata, ... from empty zones)
3) to share the data among server will require low latency on such exchanges... If data packets are sent to players every 50ms, then the data sharing must also be every 50ms or better
A way that could help is to have NPC servers managing all info about NPC. They would use a "trusted" variant of the client protocol (which means that these servers would set the MP/HP/... of NPC, while the servers set the Players info). The NPC servers could send their info to all Game Servers and the game servers would only have to share the players info at send "item update" packets each time someone drops/picks up an item. That architecture *could* make clustering possible...
But L2J architecture is monolithic and very different from that cluster-architecture... So attempts at making it work in cluster would only result in having more losses than gains (like 1x200 players -> 2x80 players or even less).
Now, I'd refer to L2J core developpers and Java gurus, but I think that L2J uses many threads and as such, may get lots of improvements in capacity if you increase the number of cores/CPU and the RAM size...
-
- Posts: 7
- Joined: Wed May 20, 2009 9:00 am
Re: multiple servers under same domain
Thank you all for your kind and complete responses. Now I know more about the server architecture. What can I say, I hope that in a future ¿ Maybe lineage 3 ?
We start thinking on a clustered architecture.
Thanks again.

Thanks again.
-
- Posts: 271
- Joined: Wed Mar 19, 2008 10:16 am
Re: multiple servers under same domain
Well, clustered architecture is way more difficult... And for most private server, there are at most a few hundred players at the same time... which can be supported on most current server hardware.