Building fast, scalable game server in
node.js

Charlie Crane
@xiecc
Who am I

 NASDAQ: NTES
 Senior engineer, architect(8 years) in NetEase Inc. ,

developed many web, game products
 Recently created the open source game server framework in

node.js: pomelo
Top cities for npm modules
https://gist.github.com/substack/7373338
Agenda
 State of pomelo
 Scalability
 Framework
 Performance
 Realtime application
The state of pomelo

Fast, scalable, distributed game server
framework for node.js
Open sourced in 2012.11.20
Newest version: V0.7
https://github.com/NetEase/pomelo
Pomelo position
 Game server framework
 Mobile game
 Web game
 Social game
 MMO RPG(middle scale)

Realtime Multiple User Interaction
 Realtime application server framework
State of pomelo
 Pomelo is not a

single project
 Almost 40 repos in total
Framework ---
https://github.com/NetEase/pomelo
Success cases
Card Game — ShenMu

http://shenmu.iccgame.com/index.shtml
Success cases
Combat Strategy Game — Ancient songs

http://www.ixuanyou.com/
Success cases
Realtime Communication Tools —
ZhongQingBangBang

Q&A

http://wap.youth.cn/bangbang/
Success cases
 The magic card hunter https://itunes.apple.com/cn/app/id6649640688
 Beauty Fried golden flower http://app.xiaomi.com/detail/41461
 Texas Hold ’ em poker http://www.yiihua.com/
 Metal Slug http://www.17erzhan.com/ww2/ww2index.php
 Coal instant messaging http://www.mtjst.com
 Yong Le golden flower http://pan.baidu.com/s/1pCmfD
 17 Bullfight http://app.91.com/Soft/Detail.aspx?Platform=iPhone
…
Job huntings
Agenda
 The state of pomelo
 Scalability
 Framework
 Performance

 Realtime appliation
Demo first
http://pomelo.netease.com/lordofpomelo
Scalability---Web and Game server
 Web server

unlimited scalability
 Game server

World record: world of tanks(bigworld), 74,536 online users
MMORPG:7k-8k maximum

Why?
Why does game server not scale?
 Reason 1: Long connection
 Response time

Web response time: 2000ms
Game、realtime web: <100ms
 Message direction

web: request/reponse
game: request/push/broadcast, bi-direction
How to solve
 Node.js to rescue

Perfect for:
Network-insentive application
Real-time application
Holding connections
Mqtt: 120,000 connections, 1 process, 10K/connection
Socket.io: 25,000 connections, 1 process, 50K/connection
Why does game server not scale
 Reason 2: stateful
 Web app -- stateless
 No coordinates, no adjacency
 Partition randomly, stateless

 Game server -- stateful
 Have coordinate, adjacency
 Partition by area, stateful
How to solve
 No good solution in technical level
 Depending on game design
 Don’t make one area too crowded
 Balance of area
Too crowded area
Disperse player
Why does game server not scale
Reason 3: Broadcast

MESSAGES IN

1

MESSAGES OUT

1

1

1
Why does game server not scale

1

2

MESSAGES IN

MESSAGES OUT

4

2
2

1
Why does game server not scale
MESSAGES IN

MESSAGES OUT

4

1

16

4

4

4

1

1
4

1
Why does game server not scale
MESSAGES IN

MESSAGES OUT

100

1

10000

100

100

100

1

1
100

1
Why does game server not scale
MESSAGES IN

MESSAGES OUT

1000

1

1000

1000000

1000

1000

1

1
1000

1
1、How to solve --- broadcast
 AOI --- area of interested

module: pomelo-aoi
2、How to solve -- broadcast
 Split process, seperate load , frontend is stateless

broadcast

Frontend
(connector)

Single Process

Game logic

Backend
(area)
3、How to solve – broadcast
 Game design, don’t make one place(in area) too crowded
 Map size
 Character density
 Disperse born place
Disperse born place
4、How to solve -- pushScheduler
app.set(‘pushSchedulerConfig’, {
scheduler: new MessageScheduler(app);
});
 Direct:send message directly
 Buffer:

buffer message in array, and flush it every 50ms
 Other Strategies: flexible, depending on client number
Why does game server not scale
 Reason 4: Tick (game loop)
 setInterval(tick, 100)

 What does every tick do?
 Update every entity in the scene(disappear,move, revive)
 Refresh monster
 Driving ai logic(monster, player)

Tick must be far less than 100ms
Problem of tick
 The entity number should be limited
 Pay attention to update algorithm: AI etc.

 GC, full gc should be limited
 V8 is good at GC when memory is under 500M, even full GC
 Memory must be limited
 Try to divide process
At last--- runtime architecture
How to solve complexity
 Too … complicated?

solution:

framework
Agenda
 The state of pomelo
 Scalability
 Framework
 Performance
 Realtime application
Pomelo Framework
The essence of pomelo:
A distributed, scalable, realtime application
framework.
Framework --- design goal
 Abstract of servers(processes)
 Auto extend server types
 Auto extend servers

 Abstract of request/response and broadcast/push
 Zero config request
 Simple broadcast api

 Servers communication---rpc framework
Framework -- some features
 Server scalability

 Network
 Plugins
Server scalability
Server Scalability-- dynamic
extensions
 pomelo add host=[host] port=[port] id=[id]

serverType=[serverType]
 node app.js env=production host=[host]

port=[port] id=[id] serverType=[serverType]
Network
Pomelo
component
Loader

MQTTConnector

Mobile client

Connector

SIOConnector

HybridConnector

Socket.io client

Socket, websocket
client
Network--Message encode, decode
Network--original protobuf
 Original protobuf
Network--pomelo protobuf
 Our protobuf
Network -- Proto compress
 Config:
Network---protobuf definition
 Handler return json, auto encoded to protobuf
Network--pomelo protobuf
https://github.com/pomelonode/pomelo-protobuf
As an independent project, supporting unity3d, iOS, android, C
Network -- Pomelo Netflow – V0.2
 Version 0.2, 400 online users

Out: 3645Kb/S in: 270Kb/s
Network -- Pomelo Netflow – V0.3
 Version 0.3, 400 online users

Out: 925KB/S, in: 217KB/S, 25% Netflow of 0.2
Plugins
 A mechanism to extend framework

 Example:
 pomelo-status-plugin , online status plugin, based on redis
Plugins example -- Reliability
 pomelo-masterha-plugin, based on zookeeper, master HA
 Servers auto reconnect

Zookeeper

Master

Slave

Slave
Agenda
 State of pomelo
 Scalability
 Framework
 Performance

 Realtime application
Performance --- overview
 The performance varies largely in different games,

applications
 The variation
 Application type: Game or realtime application
 Game type: round or realtime fight, room or infinite
 Game design: Map size, character density, balance of areas
 Test parameters: Think time, test action
Performance --- reference data
 Online users per process
 next-gen: support 20,000 concurrent players in one area

 World record – not one area
 world of tanks(bigworld), 74,536 online users

 But in real world(MMO rpg)
 The real online data: maximum 800 concurrent users per area, 7,000

concurrent users per group game servers
Performance--Server configuration
Openstack virtual machine
Performance --- stress testing
 Use Case 1: fight
 Stress on single area(area 3), increasing step by step,

login every 2 seconds
 Game logic: attack monstors or other players every

2~5 seconds
Performance --- stress testing
Performance--result
 486 onlines
Performance -- top
 Using toobusy, limit cpu 80%
Performance – stress test
 Use case 2 – move
 Stress on single area(area 3), increasing step by step,

login every 2 seconds
 Game logic: move in the map every 2~5 seconds
Performance – stress test
 800 online users
Performance --- stress testing
 Use Case 3: fight & move
 Stress on single area(area 3), increasing step by step,

login every 2 seconds
 Game logic: 50% attack monstors or other players

every 2~5 seconds, 50% move around
 Result: 558 onlines in one area
Agenda
 State of pomelo
 Scalability
 Framework
 Performance

 Realtime application
Realtime app and game
 Many success stories in realtime application
 Message push platform in NetEase
 ZhongQinBangBang

 Not that frequent messages as game
 Do do need that realtime (less than 50ms), we can use

different pushScheduler strategy
 Much more scalable than game
Message push platform
Supporting more than 10,000,000 online users
 Products using message push platform
 love.163.com
 music.163.com

 news.163.com
 note.youdao.com
 game.163.com
 yuehui.163.com

 yuedu.163.com
Message push platform
AMQP
Receiver
Receiver

publish

Receiver
Receiver

Redis,
Device

APNS publisher
APNS publisher

Channel push, socket

Connector

Connector

Connector

LVS
socket.io

Web client

mqtt
Android
client

mqtt

iOS client
Message push systems
 High load, More than 10,000,000 online users

 Realtime, broadcast to 5 million users in 1minute
 Reliability, qos=1 in any conditions
 Save power and network

 Support all the clients
 iOS(APNS, mqtt)
 android(mqtt)
 browser(socket.io)

 windows desktop application(mqtt)
Q&A
@xiecc
https://github.com/NetEase/pomelo

More Related Content

PDF
Multiplayer Game Sync Techniques through CAP theorem
PPTX
Next-generation MMORPG service architecture
PDF
Akka.NET 으로 만드는 온라인 게임 서버 (NDC2016)
PPTX
Ndc14 분산 서버 구축의 ABC
PDF
혼자서 만드는 MMO게임 서버
PPTX
게임 기획자의 생존 전략
PDF
게임 디자이너와 게임 서버
PDF
Windows Registered I/O (RIO) vs IOCP
Multiplayer Game Sync Techniques through CAP theorem
Next-generation MMORPG service architecture
Akka.NET 으로 만드는 온라인 게임 서버 (NDC2016)
Ndc14 분산 서버 구축의 ABC
혼자서 만드는 MMO게임 서버
게임 기획자의 생존 전략
게임 디자이너와 게임 서버
Windows Registered I/O (RIO) vs IOCP

What's hot (20)

PDF
〈야생의 땅: 듀랑고〉 서버 아키텍처 Vol. 3
PDF
임태현, MMO 서버 개발 포스트 모템, NDC2012
PDF
[야생의 땅: 듀랑고] 서버 아키텍처 Vol. 2 (자막)
PDF
PDF
[IGC 2017] 아마존 구승모 - 게임 엔진으로 서버 제작 및 운영까지
PDF
테라로 살펴본 MMORPG의 논타겟팅 시스템
PDF
홍성우, 게임 서버의 목차 - 시작부터 출시까지, NDC2019
PDF
코루틴(Coroutine)
PDF
중앙 서버 없는 게임 로직
PDF
임태현, 게임 서버 디자인 가이드, NDC2013
PPTX
ndc 2017 어쩌다 신입 - 초보 게임 개발자 2년 간의 포스트모템
PDF
[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버
PDF
오딘: 발할라 라이징 MMORPG의 성능 최적화 사례 공유 [카카오게임즈 - 레벨 300] - 발표자: 김문권, 팀장, 라이온하트 스튜디오...
PDF
잘 알려지지 않은 숨은 진주, Winsock API - WSAPoll, Fast Loopback
PDF
게임제작개론 : #6 게임 시스템 구조에 대한 이해
PPT
GCGC- CGCII 서버 엔진에 적용된 기술 (2) - Perfornance
PDF
[NDC17] Unreal.js - 자바스크립트로 쉽고 빠른 UE4 개발하기
PDF
ran-introicbasictroubleshooting3-230122164831-426c58cd.pdf
PPTX
마비노기듀얼 이야기-넥슨 김동건
PPTX
게임 분산 서버 구조
〈야생의 땅: 듀랑고〉 서버 아키텍처 Vol. 3
임태현, MMO 서버 개발 포스트 모템, NDC2012
[야생의 땅: 듀랑고] 서버 아키텍처 Vol. 2 (자막)
[IGC 2017] 아마존 구승모 - 게임 엔진으로 서버 제작 및 운영까지
테라로 살펴본 MMORPG의 논타겟팅 시스템
홍성우, 게임 서버의 목차 - 시작부터 출시까지, NDC2019
코루틴(Coroutine)
중앙 서버 없는 게임 로직
임태현, 게임 서버 디자인 가이드, NDC2013
ndc 2017 어쩌다 신입 - 초보 게임 개발자 2년 간의 포스트모템
[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버
오딘: 발할라 라이징 MMORPG의 성능 최적화 사례 공유 [카카오게임즈 - 레벨 300] - 발표자: 김문권, 팀장, 라이온하트 스튜디오...
잘 알려지지 않은 숨은 진주, Winsock API - WSAPoll, Fast Loopback
게임제작개론 : #6 게임 시스템 구조에 대한 이해
GCGC- CGCII 서버 엔진에 적용된 기술 (2) - Perfornance
[NDC17] Unreal.js - 자바스크립트로 쉽고 빠른 UE4 개발하기
ran-introicbasictroubleshooting3-230122164831-426c58cd.pdf
마비노기듀얼 이야기-넥슨 김동건
게임 분산 서버 구조
Ad

Viewers also liked (15)

PPTX
Game server development in node.js
PPTX
Game server development in node.js in jsconf eu
PPTX
Game development with Node.js
PDF
Building multiplayer games with angular, node, socket.io, and phaser.io
PPT
Introduction to Go-Lang
KEY
Realtime webapp with node.js
PDF
NodeJs, une introduction
PDF
A brief introduction to SPDY - 邁向 HTTP/2.0
PPT
Scalability using Node.js
PPTX
20 Game Ideas You Should Steal
PPTX
소셜게임 서버 개발 관점에서 본 Node.js의 장단점과 대안
PPTX
M-6 MQTTの使いどころ (JJUG CCC 2015 Spring)
PPTX
Introduction to Node.js
PPTX
Introduction à Node.js
ODP
Présentation de nodejs
 
Game server development in node.js
Game server development in node.js in jsconf eu
Game development with Node.js
Building multiplayer games with angular, node, socket.io, and phaser.io
Introduction to Go-Lang
Realtime webapp with node.js
NodeJs, une introduction
A brief introduction to SPDY - 邁向 HTTP/2.0
Scalability using Node.js
20 Game Ideas You Should Steal
소셜게임 서버 개발 관점에서 본 Node.js의 장단점과 대안
M-6 MQTTの使いどころ (JJUG CCC 2015 Spring)
Introduction to Node.js
Introduction à Node.js
Présentation de nodejs
 
Ad

Similar to Building fast,scalable game server in node.js (20)

ODP
Scaling a Game Server: From 500 to 100,000 Users
PPTX
Scalable game-servers-tgc
PPTX
Game On! Exploring Microservices with a Text-Based Adventure Game
PDF
ngServer and-collaboratived-development-between-san-francisco-and-tokyo
PDF
How to Plan for Performance and Scale for Multiplayer Games
PDF
Real time web apps
PDF
Orleans gdc2019
PDF
Scalable Socket Server by Aryo
PDF
Real-Time Stats for Candy Box
PPTX
CampJS - Making gaming more fun and efficient
PPTX
Scalable Social Architectures by Biren Gandhi
PDF
A service platform for development deployment and runtime management of real-...
PDF
What is Reactive programming?
PPTX
Outburst 3D
PDF
Server side game_development
PDF
Anton Moldovan "Building an efficient replication system for thousands of ter...
PDF
Akka for realtime multiplayer mobile games
PDF
Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...
PDF
Node.js scaling in highload
PPTX
How does the Cloud Foundry Diego Project Run at Scale, and Updates on .NET Su...
Scaling a Game Server: From 500 to 100,000 Users
Scalable game-servers-tgc
Game On! Exploring Microservices with a Text-Based Adventure Game
ngServer and-collaboratived-development-between-san-francisco-and-tokyo
How to Plan for Performance and Scale for Multiplayer Games
Real time web apps
Orleans gdc2019
Scalable Socket Server by Aryo
Real-Time Stats for Candy Box
CampJS - Making gaming more fun and efficient
Scalable Social Architectures by Biren Gandhi
A service platform for development deployment and runtime management of real-...
What is Reactive programming?
Outburst 3D
Server side game_development
Anton Moldovan "Building an efficient replication system for thousands of ter...
Akka for realtime multiplayer mobile games
Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...
Node.js scaling in highload
How does the Cloud Foundry Diego Project Run at Scale, and Updates on .NET Su...

Recently uploaded (20)

PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
Hindi spoken digit analysis for native and non-native speakers
PPT
Geologic Time for studying geology for geologist
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
A review of recent deep learning applications in wood surface defect identifi...
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Getting Started with Data Integration: FME Form 101
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
A comparative study of natural language inference in Swahili using monolingua...
sustainability-14-14877-v2.pddhzftheheeeee
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Benefits of Physical activity for teenagers.pptx
NewMind AI Weekly Chronicles – August ’25 Week III
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
Taming the Chaos: How to Turn Unstructured Data into Decisions
Final SEM Unit 1 for mit wpu at pune .pptx
DP Operators-handbook-extract for the Mautical Institute
Hindi spoken digit analysis for native and non-native speakers
Geologic Time for studying geology for geologist
A contest of sentiment analysis: k-nearest neighbor versus neural network
Module 1.ppt Iot fundamentals and Architecture
Enhancing emotion recognition model for a student engagement use case through...
A review of recent deep learning applications in wood surface defect identifi...
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Getting Started with Data Integration: FME Form 101
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
How ambidextrous entrepreneurial leaders react to the artificial intelligence...

Building fast,scalable game server in node.js

  • 1. Building fast, scalable game server in node.js Charlie Crane @xiecc
  • 2. Who am I  NASDAQ: NTES  Senior engineer, architect(8 years) in NetEase Inc. , developed many web, game products  Recently created the open source game server framework in node.js: pomelo
  • 3. Top cities for npm modules https://gist.github.com/substack/7373338
  • 4. Agenda  State of pomelo  Scalability  Framework  Performance  Realtime application
  • 5. The state of pomelo Fast, scalable, distributed game server framework for node.js Open sourced in 2012.11.20 Newest version: V0.7 https://github.com/NetEase/pomelo
  • 6. Pomelo position  Game server framework  Mobile game  Web game  Social game  MMO RPG(middle scale) Realtime Multiple User Interaction  Realtime application server framework
  • 7. State of pomelo  Pomelo is not a single project  Almost 40 repos in total
  • 10. Success cases Card Game — ShenMu http://shenmu.iccgame.com/index.shtml
  • 11. Success cases Combat Strategy Game — Ancient songs http://www.ixuanyou.com/
  • 12. Success cases Realtime Communication Tools — ZhongQingBangBang Q&A http://wap.youth.cn/bangbang/
  • 13. Success cases  The magic card hunter https://itunes.apple.com/cn/app/id6649640688  Beauty Fried golden flower http://app.xiaomi.com/detail/41461  Texas Hold ’ em poker http://www.yiihua.com/  Metal Slug http://www.17erzhan.com/ww2/ww2index.php  Coal instant messaging http://www.mtjst.com  Yong Le golden flower http://pan.baidu.com/s/1pCmfD  17 Bullfight http://app.91.com/Soft/Detail.aspx?Platform=iPhone …
  • 15. Agenda  The state of pomelo  Scalability  Framework  Performance  Realtime appliation
  • 17. Scalability---Web and Game server  Web server unlimited scalability  Game server World record: world of tanks(bigworld), 74,536 online users MMORPG:7k-8k maximum Why?
  • 18. Why does game server not scale?  Reason 1: Long connection  Response time Web response time: 2000ms Game、realtime web: <100ms  Message direction web: request/reponse game: request/push/broadcast, bi-direction
  • 19. How to solve  Node.js to rescue Perfect for: Network-insentive application Real-time application Holding connections Mqtt: 120,000 connections, 1 process, 10K/connection Socket.io: 25,000 connections, 1 process, 50K/connection
  • 20. Why does game server not scale  Reason 2: stateful  Web app -- stateless  No coordinates, no adjacency  Partition randomly, stateless  Game server -- stateful  Have coordinate, adjacency  Partition by area, stateful
  • 21. How to solve  No good solution in technical level  Depending on game design  Don’t make one area too crowded  Balance of area
  • 24. Why does game server not scale Reason 3: Broadcast MESSAGES IN 1 MESSAGES OUT 1 1 1
  • 25. Why does game server not scale 1 2 MESSAGES IN MESSAGES OUT 4 2 2 1
  • 26. Why does game server not scale MESSAGES IN MESSAGES OUT 4 1 16 4 4 4 1 1 4 1
  • 27. Why does game server not scale MESSAGES IN MESSAGES OUT 100 1 10000 100 100 100 1 1 100 1
  • 28. Why does game server not scale MESSAGES IN MESSAGES OUT 1000 1 1000 1000000 1000 1000 1 1 1000 1
  • 29. 1、How to solve --- broadcast  AOI --- area of interested module: pomelo-aoi
  • 30. 2、How to solve -- broadcast  Split process, seperate load , frontend is stateless broadcast Frontend (connector) Single Process Game logic Backend (area)
  • 31. 3、How to solve – broadcast  Game design, don’t make one place(in area) too crowded  Map size  Character density  Disperse born place
  • 33. 4、How to solve -- pushScheduler app.set(‘pushSchedulerConfig’, { scheduler: new MessageScheduler(app); });  Direct:send message directly  Buffer: buffer message in array, and flush it every 50ms  Other Strategies: flexible, depending on client number
  • 34. Why does game server not scale  Reason 4: Tick (game loop)  setInterval(tick, 100)  What does every tick do?  Update every entity in the scene(disappear,move, revive)  Refresh monster  Driving ai logic(monster, player) Tick must be far less than 100ms
  • 35. Problem of tick  The entity number should be limited  Pay attention to update algorithm: AI etc.  GC, full gc should be limited  V8 is good at GC when memory is under 500M, even full GC  Memory must be limited  Try to divide process
  • 36. At last--- runtime architecture
  • 37. How to solve complexity  Too … complicated? solution: framework
  • 38. Agenda  The state of pomelo  Scalability  Framework  Performance  Realtime application
  • 39. Pomelo Framework The essence of pomelo: A distributed, scalable, realtime application framework.
  • 40. Framework --- design goal  Abstract of servers(processes)  Auto extend server types  Auto extend servers  Abstract of request/response and broadcast/push  Zero config request  Simple broadcast api  Servers communication---rpc framework
  • 41. Framework -- some features  Server scalability  Network  Plugins
  • 43. Server Scalability-- dynamic extensions  pomelo add host=[host] port=[port] id=[id] serverType=[serverType]  node app.js env=production host=[host] port=[port] id=[id] serverType=[serverType]
  • 48. Network -- Proto compress  Config:
  • 49. Network---protobuf definition  Handler return json, auto encoded to protobuf
  • 51. Network -- Pomelo Netflow – V0.2  Version 0.2, 400 online users Out: 3645Kb/S in: 270Kb/s
  • 52. Network -- Pomelo Netflow – V0.3  Version 0.3, 400 online users Out: 925KB/S, in: 217KB/S, 25% Netflow of 0.2
  • 53. Plugins  A mechanism to extend framework  Example:  pomelo-status-plugin , online status plugin, based on redis
  • 54. Plugins example -- Reliability  pomelo-masterha-plugin, based on zookeeper, master HA  Servers auto reconnect Zookeeper Master Slave Slave
  • 55. Agenda  State of pomelo  Scalability  Framework  Performance  Realtime application
  • 56. Performance --- overview  The performance varies largely in different games, applications  The variation  Application type: Game or realtime application  Game type: round or realtime fight, room or infinite  Game design: Map size, character density, balance of areas  Test parameters: Think time, test action
  • 57. Performance --- reference data  Online users per process  next-gen: support 20,000 concurrent players in one area  World record – not one area  world of tanks(bigworld), 74,536 online users  But in real world(MMO rpg)  The real online data: maximum 800 concurrent users per area, 7,000 concurrent users per group game servers
  • 59. Performance --- stress testing  Use Case 1: fight  Stress on single area(area 3), increasing step by step, login every 2 seconds  Game logic: attack monstors or other players every 2~5 seconds
  • 62. Performance -- top  Using toobusy, limit cpu 80%
  • 63. Performance – stress test  Use case 2 – move  Stress on single area(area 3), increasing step by step, login every 2 seconds  Game logic: move in the map every 2~5 seconds
  • 64. Performance – stress test  800 online users
  • 65. Performance --- stress testing  Use Case 3: fight & move  Stress on single area(area 3), increasing step by step, login every 2 seconds  Game logic: 50% attack monstors or other players every 2~5 seconds, 50% move around  Result: 558 onlines in one area
  • 66. Agenda  State of pomelo  Scalability  Framework  Performance  Realtime application
  • 67. Realtime app and game  Many success stories in realtime application  Message push platform in NetEase  ZhongQinBangBang  Not that frequent messages as game  Do do need that realtime (less than 50ms), we can use different pushScheduler strategy  Much more scalable than game
  • 68. Message push platform Supporting more than 10,000,000 online users  Products using message push platform  love.163.com  music.163.com  news.163.com  note.youdao.com  game.163.com  yuehui.163.com  yuedu.163.com
  • 69. Message push platform AMQP Receiver Receiver publish Receiver Receiver Redis, Device APNS publisher APNS publisher Channel push, socket Connector Connector Connector LVS socket.io Web client mqtt Android client mqtt iOS client
  • 70. Message push systems  High load, More than 10,000,000 online users  Realtime, broadcast to 5 million users in 1minute  Reliability, qos=1 in any conditions  Save power and network  Support all the clients  iOS(APNS, mqtt)  android(mqtt)  browser(socket.io)  windows desktop application(mqtt)