shardConnPoolStats

在本页面

Definition

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

shardConnPoolStats命令使用以下语法:

{ shardConnPoolStats: 1 }

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

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

Output

  • shardConnPoolStats. hosts

  • shardConnPoolStats.hosts.<host>. available
    {#shardConnPoolStats.hosts.<host>.available}

    • 可用于此主机连接到mongos的连接数。
  • shardConnPoolStats.hosts.<host>. created
    {#shardConnPoolStats.hosts.<host>.created}

    • 主机已创建的用于连接到mongos的连接数。
  • shardConnPoolStats. replicaSets

    • 显示特定于副本集的信息。
  • shardConnPoolStats.replicaSets.<name>. host
    {#shardConnPoolStats.replicaSets.<name>.host}

    • 包含一系列报告每个副本集成员的文档。这些值来自副本集状态值。
  • shardConnPoolStats.replicaSets.<name>.host[n]. addr
    {#shardConnPoolStats.replicaSets.<name>.host[n].addr}
    -主机地址,格式为[hostname]:[port]

  • shardConnPoolStats.replicaSets.<name>.host[n]. ok
    {#shardConnPoolStats.replicaSets.<name>.host[n].ok}
    -此字段仅供内部使用。当mongos无法连接到实例或收到连接异常或错误时报告false

  • shardConnPoolStats.replicaSets.<name>.host[n]. ismaster
    {#shardConnPoolStats.replicaSets.<name>.host[n].ismaster}
    -主机是副本集的primary(如果它是true)。

  • shardConnPoolStats.replicaSets.<name>.host[n]. hidden
    {#shardConnPoolStats.replicaSets.<name>.host[n].hidden}
    -主机是副本集的hidden member(如果它是true)。

  • shardConnPoolStats.replicaSets.<name>.host[n]. secondary
    {#shardConnPoolStats.replicaSets.<name>.host[n].secondary}
    -主机是副本集的hidden member(如果它是true)。

如果主机是true,则主机是副本集的secondary成员。

  • shardConnPoolStats.replicaSets.<name>.host[n]. pingTimeMillis
    {#shardConnPoolStats.replicaSets.<name>.host[n].pingTimeMillis}
    -从mongos到此成员的延迟(以毫秒为单位)。

  • shardConnPoolStats.replicaSets.<name>.host[n]. tags
    {#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

    • 显示每个传入的 Client 端连接。对于mongos,此数组字段在每个传入的 Client 端线程中显示一个文档。对于mongod,数组在每个传入的mapReduceClient 端分片线程中显示一个条目。
  • shardConnPoolStats.threads.hosts. host

    -使用连接的主机。主机可以是config serverreplica setstandalone instance

  • shardConnPoolStats.threads.hosts. created

    -主机从池中拔出连接的次数。

  • shardConnPoolStats.threads.hosts. avail

    -线程的可用性。

  • shardConnPoolStats.threads. seenNS

    • 到目前为止,此连接上使用的名称空间。