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

好像存在性能瓶颈 #1

Closed
netaxcess opened this issue May 9, 2017 · 6 comments
Closed

好像存在性能瓶颈 #1

netaxcess opened this issue May 9, 2017 · 6 comments

Comments

@netaxcess
Copy link

通过mongostat分析了下mongodb的连接数。发现只要是该程序在运行,mongodb连接数就加1,连接数一直在增加。直到mongodb连接数用完了

@henson
Copy link
Owner

henson commented May 10, 2017

哦,完成写入之后连接就没有断掉,谢谢你提醒

@henson
Copy link
Owner

henson commented May 10, 2017

查了下,是mgo的问题,有童鞋遇到过了:

本司礼物系统使用了golang的 mongo库 mgo,中间踩了一些坑,总结下避免大家再踩坑

golang的mgo库说明里是说明了开启连接复用的,但观察实验发现,这并没有根本实现连接的控制,连接复用仅在有空闲连接时生效,高并发时无可用连接会不断创建新连接,所以最终还是需要程序员自行去限制最大连接才行

http://www.cnblogs.com/shenguanpu/p/5318727.html

@henson
Copy link
Owner

henson commented May 10, 2017

我已经优化了,麻烦您再测试一下并反馈,谢谢

@netaxcess
Copy link
Author

我测试下看

@netaxcess
Copy link
Author

测试过。连接数下来了。牛 。。

@henson
Copy link
Owner

henson commented May 10, 2017

好的,谢谢反馈

@henson henson closed this as completed May 10, 2017
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