Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

热重启的性能如何? #59

Closed
xuxbuptisc opened this issue Dec 23, 2017 · 12 comments
Closed

热重启的性能如何? #59

xuxbuptisc opened this issue Dec 23, 2017 · 12 comments

Comments

@xuxbuptisc
Copy link

有没有测试过一个进程的entity数据量和热重启花费时间的关系,顿卡时间有多长

@xiaonanln
Copy link
Owner

有关系。稍微测试过一点。一个有1000个Entity左右的Game进程大概需要1秒。

@xuxbuptisc
Copy link
Author

用内存数据库会好点吧

@xiaonanln
Copy link
Owner

我在测试中发现存取文件的时间只占热重启很小 的 一部分
大部分时间都花在Entity的Marshal和Unmarshal上
所以可能不管用什么存速度都不会差多少

@xuxbuptisc
Copy link
Author

可以用简单点的marshal算法,没必要考虑压缩

@xiaonanln
Copy link
Owner

目前也没有用到压缩

@xuxbuptisc
Copy link
Author

msgpack吧,也算有压缩。。应该有优化空间。顿卡时间还挺重要的

@xiaonanln
Copy link
Owner

是msgpack,目前还没有找到更快的marshal方法

@xiaonanln
Copy link
Owner

想要更快可能得采用一些非常规的方法,比如一个game在热重启的时候用多核并发的方式进行marshal和unmarshal,这样可以借用更多的CPU能力来加快这个过程。

@xuxbuptisc
Copy link
Author

xuxbuptisc commented Dec 25, 2017

https://github.com/alecthomas/go_serialization_benchmarks
https://github.com/andyleap/gencode

这个快一点,不过你说的对,用多核应该是更好的思路。
如果实际部署是一个核一个进程,那貌似也还是不行。

@xiaonanln
Copy link
Owner

根据你发这个性能测试最快的是什么?太多了看都看不清

@xiaonanln
Copy link
Owner

哦,你说的是这个gencode,但是不太成熟的东西不太敢用

@xiaonanln
Copy link
Owner

一个核一个进程也可以的,你只要一个个进程轮流热更就行了。跟1个一秒,更30个也就半分钟。每热更一个进程的时候只有一部分玩家会体验到卡顿。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants