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

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  mongosnever 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" );

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

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

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

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

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值