OPTIONS
翻译或纠错本页面

集群连接池状态

定义

shardConnPoolStats

返回集群连接池中被缓存的和在连接池中的连接信息.这个命令同样返回连接池中每个线程上的缓存连接.

命令 shardConnPoolStats 语法如下:

{ shardConnPoolStats: 1 }

集群中的连接池用于连接集群间的成员, mongos 使用此连接池来执行客户端的读写请求. mongod 在执行 mapReduce 时使用此连接池临时查询其他分片的数据.

在集群需要一个连接时,MongoDB从连接池中拿出一个线程放到每个线程的缓存池中,MongoDB在操作完成之后会归还连接.

输出

shardConnPoolStats.hosts

显示集群中每个 config server , replica set, 和 单个实例 的连接状态.

shardConnPoolStats.hosts.<host>.available

此节点下与 mongos 有效的连接数.

shardConnPoolStats.hosts.<host>.created

此节点创建过的与 mongos 的连接数.

shardConnPoolStats.replicaSets

与复制集相关的信息显示

shardConnPoolStats.replicaSets.<name>.host

显示复制集每个成员的文档信息,这些信息从 replica set status 获得.

shardConnPoolStats.replicaSets.<name>.host[n].addr

节点以 [hostname]:[port] 显示的地址.

shardConnPoolStats.replicaSets.<name>.host[n].ok

这个字段供内部使用,在 mongos 无法连接到实例或者接收连接或者异常时值为 false.

shardConnPoolStats.replicaSets.<name>.host[n].ismaster

如果这个值为 true,这个节点是复制集的 primary.

shardConnPoolStats.replicaSets.<name>.host[n].hidden

如果这个值为 true,这个节点是复制集的 hidden member.

shardConnPoolStats.replicaSets.<name>.host[n].secondary

如果这个值为 true,这个节点是复制集的 hidden member.

如果这个值为 true,这个节点是复制集的 secondary.

shardConnPoolStats.replicaSets.<name>.host[n].pingTimeMillis

mongos 到这个节点的延迟,以毫秒为单位.

shardConnPoolStats.replicaSets.<name>.host[n].tags

这个节点被配置了标记.

shardConnPoolStats.createdByType

集群的连接池中连接的数量.

shardConnPoolStats.createdByType.master

与一个分片的连接数目.

shardConnPoolStats.createdByType.set

与一个复制集的连接数目.

shardConnPoolStats.createdByType.sync

与配置服务器的连接数目.

shardConnPoolStats.totalAvailable

集群中由 mongos 到配置服务器,复制集和单独的 mongod 实例的有效连接数.

shardConnPoolStats.totalCreated

mongos 到集群中其他节点创建过的连接数目.

shardConnPoolStats.threads

显示每个线程的缓存连接信息.

shardConnPoolStats.threads.hosts

显示每个传入终端的连接,对于 mongos,这个数组存储的是来自应用端的连接,对于 mongod,数组显示的是来自每个使用 mapReduce 命令的分片连接.

shardConnPoolStats.threads.hosts.host

使用连接的节点,这些节点可能是 config server, replica set 或者是 独立的实例.

shardConnPoolStats.threads.hosts.created

节点从连接池取得连接的次数.

shardConnPoolStats.threads.hosts.avail

线程可用性.

shardConnPoolStats.threads.seenNS

到目前为止这个连接上的ns.

←   connPoolStats dbStats  →