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

请问下mongodb的db.Ref建立了好多和MongoDB的连接,只有一个玩家,不应该只建立少量连接吗? #116

Closed
jjjjilyf opened this issue Aug 28, 2018 · 8 comments

Comments

@jjjjilyf
Copy link

image

@name5566
Copy link
Owner

实际连接数是可以配置的。

@jjjjilyf
Copy link
Author

image
请问是这里吗?如果配置的太少比如50个 会不会只登录几个玩家就已经把连接数占完了 其他玩家都访问不了数据库啦?

@name5566
Copy link
Owner

这个是数据库连接数,和玩家数量没关系。不是一个玩家一个数据库连接。

@jjjjilyf
Copy link
Author

好的 我试试改小一些 谢谢解答,主要是没看懂代码,看到每次都是取得第一个Session,heap也不知怎么用的
image

@name5566
Copy link
Owner

原理就是,如果有 20 个数据库连接,然后有 1000 个用户,这时候会尽量让每个数据库连接服务 50 个用户。

@jjjjilyf
Copy link
Author

多谢解答

@jjjjilyf jjjjilyf closed this as completed Sep 4, 2018
@15951836388
Copy link

话说 1个数据库链接,处理多少个用户,比较好? @name5566

@name5566
Copy link
Owner

可以实际测试决定。

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

3 participants