Scalability in Online Game and Virtual World
The latest issue of ACM Queue Magazine has an article titled "Scaling in Games & Virtual Worlds", which talks about SUN's efforts on the scalability problem in Online Game and Virtual World systems(A.K.A. MMORPG).
The author is a Distinguished Engineer in SUN, who had been involved in the scalable online game platform: DarkStar for about 2 years. He summarized many interesting points in this paper.
I - Unique Characteristics of Online Game:
1. Being Fun is the Prime Directive
2. Should be Easy to Learn, but Hard to Master
3. Client is Fat and Powerful
4. Network Latency is a Critical Factor
II - Current State of the Art of Techniques in Game & World:
1. Network protocol is simple and should be hold in one network packet
2. Server is artictured as doing small things fast with large scale concurrent requests
3. Predict & Adjust tricks are used to hide network latency
4. Servers act as player interaction hub and arbiter to avoid client cheating
III - Current Scaling Strategy:
Geographic Decomposition - Partitioned by Geography Information. For
example, all activities in an island/country are processed by one
2. Sharding - create noninteracting copies of parts of a world, players can only interact players within the same shard
The problems that SUN found are:
1. Chip Architecture is switching to multi-core style, which is suitable for parallel tasks
Server side game tasks are essentially parallelized: one thread for one
player, interactions among users are relatively small, compared with
3. Currently, most game implementation can't expoit parallel characteristic of multi-core cpu
SUN's proposal for next generation game development:
1. Hide concurrency and distribution for game logic developer
2. Server is architectured as event-based(maybe SEDA like, I guess) and one client request served by one server task
3. Communication is abstracted as Channel, physical address is hiden from developer
4. Data/State is moved from server memory to global data service, which is based on simplified DBMS technologies
5. Since little state in task logic and server mem, task imigration is possible, which enables hot load balance
The last valubale word in this paper: the darkstar is open sourced.
think the observation and current tech description are the most
interesting parts, the solution part is not that exciting, since the
idea is somewhat not so innovative.
One personal observation
is that, general platform will improve productivity of application
developer, but with the price of performance. So, what's future of the
darkstar project? It may be useful for small scale game, but when your
players grows to M or 10M level, productivity is not the primary
problem for dev team, but performance/stability is. So large scale
applications always use ad-hoc solutions. But if darkstar is not used
in REALLY LARGE scale environment, how can we evaluate the value of
this system, how can we say the project succeed or fail?