关于Mongodb的“无法从传输连接中读取数据”

系统 2276 0

1.初步判定是c#官方驱动没能及时释放连接: http://stackoverflow.com/questions/7446528/mongodb-c-sharp-driver-doesnt-release-connections-then-errors

How many connections does each mongos need?
In a sharded configuration will have 1 incoming connection from the client but may need 1 outgoing connection to each shard (possibly mongos times the number of nodes if the shard is backed by a replicaset).
This means that the possible number of open connections that a server requires could be  (1 + (N*M) * C)where N = number of mongos shards, M = number of replicaset nodes, and C = number of client connections.

Why does   mongos  never seem to give up connections? 
mongos uses a set of connection pools to communicate to each shard (or shard replicaset node). These pools of connections do not currently
constrict when the number of clients decreases. This will lead to a possibly large number of connections being kept if you have even used the mongos
instance before, even if it is currently not being used. 

How can I see the connections used by mongos 
Run this command on each instance: mongos
db._adminCommand("connPoolStats" ); 

https://jira.mongodb.org/browse/CSHARP-331

2.设置了sockettimeout=300000没能生效: http://www.mongodb.org/display/DOCS/Connections ,单位应该是ms,不行的话换sockettimeoutms试试~~

应该就是这个原因了,是sockettimeout的单位是tick,不是毫秒。

 

 

 

3.刚开始全部启动测试时,很有可能崩掉一大片

 

4.    社区给我的答案,没试过

  http://www.mongodb.org/display/DOCS/Troubleshooting#Troubleshooting-Socketerrorsinshardedclustersandreplicasets

 

5.2012-04-11补充,对mongo重新做了些测试,发现有两种情况会导致,一个连接超时,默认是30s,另外一个是连接的关闭,不要轻易调用connect.close

关于Mongodb的“无法从传输连接中读取数据”


更多文章、技术交流、商务合作、联系博主

微信扫码或搜索:z360901061

微信扫一扫加我为好友

QQ号联系: 360901061

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描下面二维码支持博主2元、5元、10元、20元等您想捐的金额吧,狠狠点击下面给点支持吧,站长非常感激您!手机微信长按不能支付解决办法:请将微信支付二维码保存到相册,切换到微信,然后点击微信右上角扫一扫功能,选择支付二维码完成支付。

【本文对您有帮助就好】

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描上面二维码支持博主2元、5元、10元、自定义金额等您想捐的金额吧,站长会非常 感谢您的哦!!!

发表我的评论
最新评论 总共0条评论