정의
connPoolStatsThe command
connPoolStatsreturns information regarding the open outgoing connections from the current database instance to other members of the sharded cluster or replica set.connPoolStats를 실행하려면db.runCommand( { <command> } )메서드를 사용합니다.참고
connPoolStatsonly returns meaningful results formongosinstances and formongodinstances in sharded clusters.
호환성
이 명령은 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.
- MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud
참고
This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.
MongoDB Enterprise: MongoDB의 구독 기반 자체 관리 버전
MongoDB Community: MongoDB의 소스 사용 가능 무료 자체 관리 버전
구문
명령은 다음과 같은 구문을 가집니다:
db.runCommand( { connPoolStats: 1 } )
인수 값(예: 1 )는 명령의 출력에 영향을 주지 않습니다.
행동
connPoolStats 는 출력에 집계된 통계를 포함합니다.
The
hostsfield displays the information aggregated by host.The
poolsfield displays the information aggregated by pool.
참고
To avoid interference with any running operations, connPoolStats does not take any locks. As such, the counts may change slightly as connPoolStats gathers information, resulting in slight differences between the hosts and pools connection counts.
예시
The following operation uses the db.runCommand() method to run the connPoolStats command on a mongos of a sharded cluster. The sharded cluster has 2 shards, each a single-member replica set, and a config server replica set. The mongos runs on a 4-core machine.
db.runCommand( { "connPoolStats" : 1 } )
이 명령은 다음 형식의 출력을 반환합니다.
참고
The connPoolStats output varies depending on the deployment and the member against which you run connPoolStats among other factors.
{ "numClientConnections" : <num>, "numAScopedConnections" : <num>, "totalInUse" : <num>, "totalAvailable" : <num>, "totalLeased" : <num>, "totalCreated" : <num>, "totalRefreshing" : <num>, "replicaSetMatchingStrategy" : <string>, "acquisitionWaitTimes" : { // Added in MongoDB 6.3 "(-inf, 0ms)" : { "count" : <num> }, "[0ms, 50ms)" : { "count" : <num> }, "[50ms, 100ms)" : { "count" : <num> }, "[100ms, 150ms)" : { "count" : <num> }, "[150ms, 200ms)" : { "count" : <num> }, "[200ms, 250ms)" : { "count" : <num> }, "[250ms, 300ms)" : { "count" : <num> }, "[300ms, 350ms)" : { "count" : <num> }, "[350ms, 400ms)" : { "count" : <num> }, "[400ms, 450ms)" : { "count" : <num> }, "[450ms, 500ms)" : { "count" : <num> }, "[500ms, 550ms)" : { "count" : <num> }, "[550ms, 600ms)" : { "count" : <num> }, "[600ms, 650ms)" : { "count" : <num> }, "[650ms, 700ms)" : { "count" : <num> }, "[700ms, 750ms)" : { "count" : <num> }, "[750ms, 800ms)" : { "count" : <num> }, "[800ms, 850ms)" : { "count" : <num> }, "[850ms, 900ms)" : { "count" : <num> }, "[900ms, 950ms)" : { "count" : <num> }, "[950ms, 1000ms)" : { "count" : <num> }, "[1000ms, inf)" : { "count" : <num> }, "totalCount" : <num> }, "pools" : { "NetworkInterfaceTL-TaskExecutorPool-0" : { "poolInUse" : <num>, "poolAvailable" : <num>, "poolLeased" : <num>, "poolCreated" : <num>, "poolRefreshing" : <num>, "acquisitionWaitTimes" : <document>, // Added in MongoDB 6.3 "cfg1.example.net:27019" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 }, }, "NetworkInterfaceTL-TaskExecutorPool-1" : { "poolInUse" : <num>, "poolAvailable" : <num>, "poolLeased" : <num>, "poolCreated" : <num>, "poolRefreshing" : <num>, "acquisitionWaitTimes" : <document>, // Added in MongoDB 6.3 "cfg1.example.net:27019" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 } }, "NetworkInterfaceTL-TaskExecutorPool-2" : { "poolInUse" : <num>, "poolAvailable" : <num>, "poolLeased" : <num>, "poolCreated" : <num>, "poolRefreshing" : <num>, "acquisitionWaitTimes" : <document>, // Added in MongoDB 6.3 "cfg1.example.net:27019" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 } }, "NetworkInterfaceTL-TaskExecutorPool-3" : { "poolInUse" : <num>, "poolAvailable" : <num>, "poolLeased" : <num>, "poolCreated" : <num>, "poolRefreshing" : <num>, "acquisitionWaitTimes" : <document>, // Added in MongoDB 6.3 "cfg1.example.net:27019" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 } }, "NetworkInterfaceTL-ShardRegistry" : { "poolInUse" : <num>, "poolAvailable" : <num>, "poolLeased" : <num>, "poolCreated" : <num>, "poolRefreshing" : <num>, "acquisitionWaitTimes" : <document>, // Added in MongoDB 6.3 "cfg1.example.net:27019" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 }, "cfg2.example.net:27019" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 }, "cfg3.example.net:27019" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 }, "shard1.example.net:27018" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 }, "shard2.example.net:27018" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 } }, "global" : { "poolInUse" : <num>, "poolAvailable" : <num>, "poolLeased" : <num>, "poolCreated" : <num>, "poolRefreshing" : <num>, "acquisitionWaitTimes" : <document>, // Added in MongoDB 6.3 "cfg3.example.net:27019" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 }, "cfg1.example.net:27019" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 }, "cfg2.example.net:27019" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 }, "shard2.example.net:27018" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 }, "shard1.example.net:27018" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 } } }, "hosts" : { "cfg3.example.net:27019" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 }, "cfg1.example.net:27019" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 }, "cfg2.example.net:27019" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 }, "shard2.example.net:27018" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 }, "shard1.example.net:27018" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 } }, "replicaSets" : { "csRS" : { "hosts" : [ { "addr" : "cfg1.example.net:27019", "ok" : <bool>, "ismaster" : <bool>, "hidden" : <bool>, "secondary" : <bool>, "pingTimeMillis" : <num> }, { "addr" : "cfg2.example.net:27019", "ok" : <bool>, "ismaster" : <bool>, "hidden" : <bool>, "secondary" : <bool>, "pingTimeMillis" : <num> }, { "addr" : "cfg3.example.net:27019", "ok" : <bool>, "ismaster" : <bool>, "hidden" : <bool>, "secondary" : <bool>, "pingTimeMillis" : <num> } ] }, "shardB" : { "hosts" : [ { "addr" : "shard2.example.net:27018", "ok" : <bool>, "ismaster" : <bool>, "hidden" : <bool>, "secondary" : <bool>, "pingTimeMillis" : <num> } ] }, "shardA" : { "hosts" : [ { "addr" : "shard1.example.net:27018", "ok" : <bool>, "ismaster" : <bool>, "hidden" : <bool>, "secondary" : <bool>, "pingTimeMillis" : <num> } ] } }, "ok" : 1, "$clusterTime" : { "clusterTime" : <timestamp>, "signature" : <document> }, "operationTime" : <timestamp> }
출력
connPoolStats.totalAvailable현재
mongod/mongos인스턴스에서 샤드 cluster 또는 복제본 세트의 다른 멤버로 발신하는 사용 가능한 총 연결 수를 보고합니다.
connPoolStats.totalLeased풀에서 빌린 후 반환될 것으로 예상되는 총 연결 수를 보고합니다. 이러한 연결은 임대 기간 동안 활성 상태로 유지되지 않을 수 있으며 관련 지표에서 제외됩니다. 이러한 연결은 임대 기간 동안에는 사용할 수 없습니다.
connPoolStats.totalCreated현재
mongod/mongos인스턴스에서 샤드 cluster 또는 복제본 세트의 다른 멤버에게 생성된 발신 연결의 총 건수를 보고합니다.
connPoolStats.totalInUse현재
mongod/mongos인스턴스에서 현재 사용 중인 샤딩된 클러스터 또는 복제본 세트 의 다른 멤버로 발신하는 연결의 총 건수를 보고합니다.
connPoolStats.totalRefreshing현재
mongod/mongos인스턴스에서 현재 새로 고쳐지고 있는 샤딩된 cluster 또는 복제본 세트 의 다른 멤버로 나가는 발신 연결의 총 건수를 보고합니다.
connPoolStats.totalWasNeverUsed현재
mongod/mongos인스턴스에서 사용되지 않은 채 닫힌 샤드 cluster 또는 복제본 세트 의 다른 멤버로 발신하는 연결의 총 건수를 보고합니다.
connPoolStats.replicaSetMatchingStrategy버전 5.0의 신규 항목입니다.
mongos인스턴스에서 이 값은 인스턴스에서 사용하는 정책을 보고하여 복제본 세트 내의 노드에 대한 연결 풀의 최소 크기 제한을 결정합니다.mongod인스턴스에서 이 값은 다른 복제본 세트 내의 노드에 대한 연결 풀의 최소 크기 제한을 결정하기 위해 인스턴스가 사용하는 정책을 보고합니다.mongos및mongod에 대한 정책은ShardingTaskExecutorPoolReplicaSetMatching매개 변수를 사용하여 설정할 수 있습니다.참고
If the
ShardingTaskExecutorPoolReplicaSetMatchingis set to"automatic", thereplicaSetMatchingStrategystill describes the actual policy being used, not"automatic". To find the value of theShardingTaskExecutorPoolReplicaSetMatching, usegetParameterwhich returns the value of the server parameter:db.adminCommand( { getParameter : 1, "ShardingTaskExecutorPoolReplicaSetMatching" : 1 } )
connPoolStats.acquisitionWaitTimes버전 6.3에 추가 되었습니다.
문서가
mongos에서mongod로 연결을 획득하기 위한 요청에 대한 대기 시간이 포함된 히스토그램을 보고합니다.이 문서에는 시간 범위(밀리초)와 각 범위 내의 연결 요청 수가 포함되어 있습니다.
-inf가 음의 무한대이고(-inf, 0ms)범위의 연결 요청이 대기하지 않은 상태입니다.inf가 양의 무한대이고[1000ms, inf)범위의 연결 요청이 1,000밀리초 이상 대기한 시간입니다.totalCount는 모든 시간 범위에 대한 연결 요청의 총 개수입니다.
"acquisitionWaitTimes" : { "(-inf, 0ms)" : { "count" : <num> }, "[0ms, 50ms)" : { "count" : <num> }, "[50ms, 100ms)" : { "count" : <num> }, "[100ms, 150ms)" : { "count" : <num> }, "[150ms, 200ms)" : { "count" : <num> }, "[200ms, 250ms)" : { "count" : <num> }, "[250ms, 300ms)" : { "count" : <num> }, "[300ms, 350ms)" : { "count" : <num> }, "[350ms, 400ms)" : { "count" : <num> }, "[400ms, 450ms)" : { "count" : <num> }, "[450ms, 500ms)" : { "count" : <num> }, "[500ms, 550ms)" : { "count" : <num> }, "[550ms, 600ms)" : { "count" : <num> }, "[600ms, 650ms)" : { "count" : <num> }, "[650ms, 700ms)" : { "count" : <num> }, "[700ms, 750ms)" : { "count" : <num> }, "[750ms, 800ms)" : { "count" : <num> }, "[800ms, 850ms)" : { "count" : <num> }, "[850ms, 900ms)" : { "count" : <num> }, "[900ms, 950ms)" : { "count" : <num> }, "[950ms, 1000ms)" : { "count" : <num> }, "[1000ms, inf)" : { "count" : <num> }, "totalCount" : <num> }
connPoolStats.numClientConnection현재
mongod/ 인스턴스에서 sharded clustermongos또는 복제본 세트 의 다른 멤버로 보내는 활성 및 저장된 발신 동기 연결의 수를 보고합니다.These connections are a part of a pool that is a subset of the data reported by
totalAvailable,totalCreated, andtotalInUse.
connPoolStats.numAScopedConnection현재
mongod/ 인스턴스에서 clustermongos또는 복제본 세트 의 다른 멤버로 활성 및 저장된 발신 범위 지정 동기 연결의 수를 보고합니다.These connections are a part of a pool that is a subset of the data reported by
totalAvailable,totalCreated, andtotalInUse.
connPoolStats.pools연결 풀을 기준으로 그룹화된 연결 통계(사용/사용 가능/생성/새로 고침)를 보고합니다.
mongod또는mongos에는 두 개의 서로 다른 발신 연결 풀 패밀리가 있습니다.DBClient 기반 풀("쓰기 경로") 및
NetworkInterfaceTL 기반 풀("읽기 경로").
각 풀에 대해 이 명령은 다음과 유사한 문서를 반환합니다.
{ "poolInUse" : <num>, "poolAvailable" : <num>, "poolLeased" : <num>, "poolCreated" : <num>, "poolRefreshing" : <num>, "acquisitionWaitTimes" : <document>, // Added in MongoDB 6.3 "[host1]" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 }, "[host2]" : { "inUse" : <num>, "available" : <num>, "leased" : <num>, "created" : <num>, "refreshing" : <num>, "acquisitionWaitTimes" : <document> // Added in MongoDB 6.3 }, ... } 참고
If there are no connections (in use/available/created/refreshing) for a particular pool, the
connPoolStatsdoes not return statistics for that pool.connPoolStats.pools.NetworkInterfaceTL-TaskExecutorPool-[n]TaskExecutor 풀과 관련된 연결 통계를 표시합니다. 일반적으로 코어당 하나의 TaskExecutorPool이 있습니다. 8코어 프로세서의 경우
pools.NetworkInterfaceTL-TaskExecutorPool-0...pools.NetworkInterfaceTL-TaskExecutorPool-7입니다.
connPoolStats.pools.NetworkInterfaceTL-ShardRegistry명령이 샤드 cluster의 멤버에서 실행되는 경우 사용할 수 있습니다.
현재
mongod/mongos인스턴스와 샤드 cluster의 다른 멤버 간의 연결에 대한 풀 통계를 표시합니다.
connPoolStats.pools.NetworkInterfaceTL-Replication명령이 복제본 세트의 멤버에서 실행되는 경우 사용할 수 있습니다.
현재
mongod인스턴스와 복제본 세트의 다른 멤버 간의 연결에 대한 풀 통계를 표시합니다.
connPoolStats.pools.[pool].acquisitionWaitTimes버전 6.3에 추가 되었습니다.
Reports the wait times for requests to acquire a connection from
mongostomongod. For details, seeconnPoolStats.acquisitionWaitTimes.
connPoolStats.hosts호스트별로 그룹화된 연결 통계(사용/사용 가능/생성됨/새로 고침)를 보고합니다.
현재
mongod/mongos인스턴스와 cluster 또는 복제본 세트의 각 멤버 간의 연결 보고서를 나타내는 문서 가 포함됩니다.connPoolStats.hosts.[host].leased풀에서 빌린 호스트와 반환될 것으로 예상되는 호스트의 총 연결 수를 보고합니다. 이러한 연결은 임대 기간 동안 활성 상태로 유지되지 않을 수 있으며 관련 지표에서 제외됩니다. 이러한 연결은 임대 기간 동안에는 사용할 수 없습니다.
connPoolStats.hosts.[host].wasNeverUsedhost에서 사용된 적이 없는 sharded cluster 또는 복제본 세트 의 다른 멤버로 나가는 발신 연결의 총 건수를 보고합니다.
connPoolStats.hosts.[host].acquisitionWaitTimes버전 6.3에 추가 되었습니다.
Reports the wait times for requests to acquire a connection from
mongostomongod. For details, seeconnPoolStats.acquisitionWaitTimes.
connPoolStats.replicaSets현재 / 에 연결된 각
mongod복제본 세트와 관련된 정보 보고서를 나타내는 문서 를mongos포함합니다.connPoolStats.replicaSets.replicaSet현재
mongod/ 에 연결된 각 복제본 세트 에mongos대해 보고합니다.
connPoolStats.replicaSets.[replicaSets].hosts복제본 세트 의 각 멤버에 대해 보고하는 문서배열을 보유합니다.
이러한 값은 복제본 세트 상태 값에서 파생됩니다.
connPoolStats.replicaSets.[replicaSet].hosts[n].addr복제본 세트 에 있는 멤버의 주소를
[hostname]:[port]형식으로 보고합니다.
connPoolStats.replicaSets.[replicaSet].hosts[n].ismasterReports
trueif thishostis the primary member of the replica set.
connPoolStats.replicaSets.[replicaSet].hosts[n].hiddenReports
trueif thishostis a hidden member of the replica set.
connPoolStats.replicaSets.[replicaSet].hosts[n].secondaryReports
trueif thishostis a secondary member of the replica set.
connPoolStats.replicaSets.[replicaSet].hosts[n].pingTimeMillisReports the ping time in milliseconds from the
mongosormongodto thishost.
connPoolStats.replicaSets.[replicaSet].hosts[n].tags세트의 이 멤버에 태그가 구성된 경우
members[n].tags을 보고합니다.
ok 상태 필드, operationTime 필드 및 $clusterTime 필드에 대한 자세한 내용은 응답을 참조하세요.