Comments (8)
挂了不是问题,因为go程序本身非常稳定
满连也不会出现,因为中心分发器只和game和gate连接,而不是和玩家的客户端连接,因此连接数目有限。
之所以加入中心分发器是因为游戏服务器中对象(Entity)会频繁得在Game之间迁移,在迁移的过程中还需要保证RPC的时序的正确性。
目前我碰到的最大问题是所有的位置同步数据都需要经过中心分发器的时候有较大的开销,目前正在优化中。如果优化效果没有达到所期待的性能要求,我就考虑让gate可以直连game,然后使用这条链路发送所有的位置同步数据。
相信到时候中心分发器不会成为瓶颈,因为游戏服务器真正的瓶颈一般都在角色、怪物的行为和战斗逻辑等方面。
from goworld.
中心分发器本来就废掉了分布式。。因为所有数据都要过。。
正确的设计 应该是 网关 - > server 即可。。
网关承担负载均衡选优的责任。
客户端通过HTTP请求网关 获取服务器的IP地址。
之后在server层面,互相内部转发处理。
中心转发器是最不合理的。如果你看过hadoop等一些经典分布式 你会感觉你这种分布式是伪分布式。。
因为好不容易分开了。又用中心分发器聚集在一起了。。
from goworld.
而且你加了个中心分发器,这样做耦合性很大。。。 互相都有耦合。
如果用以上我说的这种,你可以想想有没有耦合。
只是在server层面加一些内部转发通讯的逻辑即可
from goworld.
另外有个作品和你这个架构一样。这也是我没用他们的原因。。
cellnet 应该叫这个。。
只要这种架构 必然出现这种问题。因为中心分发器绕不过。必过。而且它承上启下,在高速公路上也是个最拥堵的堵点
from goworld.
网关的作用是健康检查 负载均衡 选最优服务器IP 返回给客户端。
服务端server的作用是 内部通讯 处理消息。即可。
服务端和网关无任何耦合
from goworld.
多谢宝贵意见。一开始设计中心分发器注意是因为游戏服务器和通用的服务器之间的一些不同点。
另外一方面,一开始就是想好了如果一个中心分发器不够,我可以扩展出多个中心分发器,不过这个不在第一版的目标里。
from goworld.
之前看cellnet 编程架构挺好。但是通信架构就跟你这样、感觉很可惜。。。。 写个程序不容易挺费劲,希望思路走对。。谢谢
from goworld.
最新优化了位置同步数据,做了个测试
模拟玩家数目:3000
客户端位置同步频率:100毫秒一次
玩家视野内平均邻居个数:10个
这种情况下,平均每秒中心分发器要转发30万+条位置同步信息,占用CPU 6%。所以在多核高性能服务器上跑一个中心分发器支持个几万人在线应该是没问题的。
from goworld.
Related Issues (20)
- can not install goworld,win10/go version go1.13.4 windows/amd64 HOT 4
- 不维护了吗?库都拉不齐,能不能改go mod啊 HOT 6
- 感觉像用go抄了一遍messiah server? HOT 4
- 一定得linux环境吗?Windows Demo跑不通啊? HOT 2
- DEMO 问题 HOT 1
- 全局逻辑设计决策
- @latest found (v0.1.6), but does not contain package
- rpc调用失败
- 请问是否支持无缝大地图 HOT 1
- is it reasonable for goword.GetSpace returing *space object instead of Ispace? HOT 1
- 请问profobuf支持预计在那个版本发布
- 如何用goworld实现踢球这种互动性较强的场景 HOT 1
- qq群加不了
- 这个项目是不维护了吗
- v0.1.6版本有明显错误?
- Stopped at this stage and did not want to move on
- 为什么我在服务端游戏逻辑中开启多个GoRoutine时,dispatcher就断开连接了? HOT 2
- 在game和gate之间加入Dispatcher主要出于什么设计目的?以及主要解决什么问题? HOT 4
- QQ群号是错的,不能进群,求修复 HOT 1
- Samples does not work. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goworld.