Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
PyCon2013China_ZhuHai_wangjian
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Zoom.Quiet
December 08, 2013
Technology
2
700
PyCon2013China_ZhuHai_wangjian
PyCon2013China 珠海场 | GDG Livin ZhuHai Life;-)
http://zhgdg.gitcafe.com/2013-12/et-pycon/
Zoom.Quiet
December 08, 2013
Tweet
Share
More Decks by Zoom.Quiet
See All by Zoom.Quiet
PyCon2014China-Zhuhai-high performance
zoomquiet
0
180
PyCon2014China-Zhuhai-meta programming
zoomquiet
1
160
PyCon2014China-Zhuhai-bpm.py
zoomquiet
0
130
PyCon2014China-Zhuhai-luna kv db
zoomquiet
0
110
PyCon2014China-Zhuhai-seed studio
zoomquiet
0
120
PyCon2014China-Zhuhai-Docker Registry Build By Python
zoomquiet
0
150
PyCon2014China-Zhuhai-jeff
zoomquiet
0
110
PyCon2014China-Zhuhai-pythonic front-end
zoomquiet
0
150
DevFest2014-Zhuhai-Polymer
zoomquiet
0
450
Other Decks in Technology
See All in Technology
事例に見るスマートファクトリーへの道筋〜工場データをAI Readyにする実践ステップ〜
hamadakoji
0
230
バクラクのSREにおけるAgentic AIへの挑戦/Our Journey with Agentic AI
taddy_919
2
1.1k
Oracle Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
5
1.1k
Yahoo!ショッピングのレコメンデーション・システムにおけるML実践の一例
lycorptech_jp
PRO
1
150
kintone開発のプラットフォームエンジニアの紹介
cybozuinsideout
PRO
0
840
S3はフラットである –AWS公式SDKにも存在した、 署名付きURLにおけるパストラバーサル脆弱性– / JAWS DAYS 2026
flatt_security
0
1.2k
白金鉱業Meetup_Vol.22_Orbital Senseを支える衛星画像のマルチモーダルエンベディングと地理空間のあいまい検索技術
brainpadpr
2
260
男(監査)はつらいよ - Policy as CodeからAIエージェントへ
ken5scal
5
780
ビズリーチにおける検索・推薦の取り組み / DEIM2026
visional_engineering_and_design
1
120
マルチアカウント環境でSecurity Hubの運用!導入の苦労とポイント / JAWS DAYS 2026
genda
0
120
マルチプレーンGPUネットワークを実現するシャッフルアーキテクチャの整理と考察
markunet
2
160
Kiro のクレジットを使い切る!
otanikohei2023
0
120
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
The Pragmatic Product Professional
lauravandoore
37
7.2k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.1k
Bash Introduction
62gerente
615
210k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
210
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
190
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Side Projects
sachag
455
43k
Ethics towards AI in product and experience design
skipperchong
2
220
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
370
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
Transcript
王健
None
战网:暗黑破坏神2/3 社区:QQ宠物,TNT,宝石总动员 特征: 多个线路 数据共享
线路通信 线路切换 全服商店(拍卖行) 全服社交(好友,邮件,聊天)
None
海量用户分布式数据库设计 海量用户数据缓存机制 线路负载均衡机制 线路通信事件机制
回顾2011届Pycon介绍的架构
None
None
Game无足够内存加载Mysql所有用户数据 Mysql不支持分布式 Gateway不支持海量客户端并发请求 Game,Admin更难以承担重负 …………
None
分离Mysql,建立分布式数据库集群(DMysql) 扩展DBFront为RDBFront和WDBFront,异步读写 数据,不再将所有数据驻留内存 Gateway,Game,RDBFront,WDBFront, Admin组成一个线路,作为单元嵌入新架构 新架构其实是线路集群,还要解决线路通信和调度
问题
缓存机制,采用分布式Redis完成,客户端分布 (类似共享内存机制) 增加Comm服务,连接所有线路(类似通道机制) 缓存记录各线路的运行及负载情况,比如各线路的 在线人数 增加HGateway,负责线路负载调度,将Client分
配到最合适的线路(http协议)
None
Gateway Game WDBFront RDBFront
None
Route Other Routes DMysql DCache HGateway Client Comm Gateway Game
Game WDBfront RDBfront Game Gateway 注:Client先向HGateway请求线路信息(host), 然后与对应线路的Gateway建立连接
None
根据UID范围分库/表 分析SQL语句,定位目标数据库/表 分布式对用户不可见,与操作单数据库无异
None
按需部署多个Redis服务 对key进行hash,定位目标Redis 分布式对用户不可见,与操作单Redis无异 支持上亿记录,保证性能 可应用于UID自增,角色名重复性检测,拍卖行等
功能
None
Comm连接所有线路的Game 扩展单线路的事件机制,实现远程RPC 事件派发,to为目标线路id,-1代表全服 def trigger_event(to, id, evt): pass
事件回调,from为来源线路id def event_handler(id, evt, from): pass
可应用于全服社交,公告,聊天,好友,邮件等功 能
None
在DCache中记录各线路的在线人数等信息 HGateway根据给定策略分析线路负载情况 Client向HGateway获取负载较低的线路信息,并 连接进入游戏 或支持游戏中切换线路
None
None
None
Game可以分拆为Game-Center和Game-Zone,将整 个游戏世界按区域划分,各区域之间通过中心服务器连 接: Game-Center: 游戏中心服务器,负责各场景服务器的连接,以及玩家 全局行为处理,例如登陆,聊天,公告等等。
Game-Zone: 游戏区域服务器,负责一个区域内的玩家行为处理,区 域可根据各游戏特点灵活划分,例如一般的网页游戏, 玩家行为大部分集中在主城,则区域数量不需要太多。
None
Game这部分可采用天生分布式的语言重写 Erlang函数式编程,开发效率低 Golang有Python的良好基因,是否未来的趋势
网名:风魔W QQ:4331436 微信:wangjianbecks 微博:http://weibo.com/wjbeckie 邮箱:
[email protected]
请联系我!
谢谢观赏