文档菜单
文档首页
/
MongoDB 手册
/ / /

shardConnPoolStats

本页内容

  • 定义
  • 兼容性
  • 输出
shardConnPoolStats

自MongoDB 5.0起删除。 使用connPoolStats 代替。

返回关于分片连接池中池化和缓存的连接的信息。该命令还返回关于连接池中每个线程的连接缓存的信息。

命令shardConnPoolStats 使用以下语法

{ shardConnPoolStats: 1 }

分片连接池是特定于分片集群成员之间的连接。集群中的mongos实例使用连接池来执行客户端的读取和写入。集群中的mongod实例在执行mapReduce 时使用该池来查询其他分片上的临时集合。

当集群需要连接时,MongoDB将从分片连接池中拉取一个连接到每个线程的连接缓存中。MongoDB在每次操作后将连接返回到连接池。

此命令在以下环境中部署的部署中可用

  • MongoDB Atlas:云中MongoDB部署的全托管服务

重要

此命令不支持无服务器实例。有关更多信息,请参阅不受支持的命令。

shardConnPoolStats.hosts

显示集群中每个配置服务器副本集独立实例的连接状态。

shardConnPoolStats.hosts.<host>.available

该主机连接到mongos可用的连接数。

shardConnPoolStats.hosts.<host>.created

主机曾经创建的用于连接到mongos的连接数。

shardConnPoolStats.replicaSets

显示与副本集相关的特定信息。

shardConnPoolStats.replicaSets.<name>.host

包含一个文档数组,报告每个副本集成员的信息。这些值来自副本集状态值。

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

主机地址格式为[hostname]:[port]

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

该字段用于内部使用。当mongos无法连接到实例或收到连接异常或错误时,报告false

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

如果这个值为 true,则主机是该副本集的 主节点

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

如果这个值为 true,则主机是该副本集的 隐藏成员

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

如果这个值为 true,则主机是该副本集的 隐藏成员

如果这个值为 true,则主机是该副本集的 次要成员

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

mongos到该成员的延迟,单位为毫秒。

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

tags文档包含用于副本集成员的用户定义的标签字段和值对。

{ "<tag1>": "<string1>", "<tag2>": "<string2>",... }

有关更多信息,请参阅配置副本集标签集。

提示

另请参阅

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

使用连接的主机。主机可以是配置服务器副本集独立实例

shardConnPoolStats.threads.hosts.created

主机从连接池中拉取连接的次数。

shardConnPoolStats.threads.hosts.avail

线程的可用性。

shardConnPoolStats.threads.seenNS

迄今为止在此连接上使用的命名空间。

返回

serverStatus