정의
connPoolStats명령은 현재 데이터베이스 인스턴스 에서 샤딩된
connPoolStats클러스터 또는 복제본 세트 의 다른 멤버로의 열린 발신 연결에 관한 정보를 반환합니다.connPoolStats를 실행하려면db.runCommand( { <command> } )메서드를 사용합니다.참고
은(는 ) 샤딩된
connPoolStatsmongod클러스터의mongos인스턴스 및 인스턴스에 대해서만 의미 있는 결과를 반환합니다.
호환성
이 명령은 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.
- MongoDB Atlas: 클라우드에서의 MongoDB 배포를 위한 완전 관리형 서비스
참고
이 명령은 모든 MongoDB Atlas 클러스터에서 지원됩니다. 모든 명령에 대한 Atlas 지원에 관해 자세히 알아보려면 지원되지 않는 명령을 참조하세요.
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.
참고
실행 작업의 방해를 방지하기 위해 은(는) 잠금을 사용하지connPoolStats connPoolStats 않습니다. 따라서 가 pools hosts 정보를 수집할 때 개수가 약간 변경되어 연결 개수와 연결 개수 간에 약간의 차이가 발생할 수 있습니다.
예시
다음 작업은db.runCommand()메서드를 사용하여 샤딩된 클러스터 의mongos에서connPoolStats명령을 실행 . 샤딩된 클러스터 에는 각각 단일 멤버 복제본 세트 및 config 서버 복제본 세트 1개의 2 샤드가 있습니다. mongos는 4코어 머신에서 실행됩니다.
db.runCommand( { "connPoolStats" : 1 } )
이 명령은 다음 형식의 출력을 반환합니다.
참고
connPoolStats 출력은 배포서버 및 를 실행 멤버에 따라 connPoolStats 달라집니다.
{ "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매개 변수를 사용하여 설정할 수 있습니다.참고
을(를)(으)로
ShardingTaskExecutorPoolReplicaSetMatching설정하다"automatic"replicaSetMatchingStrategy경우에도 은(는) 가 아닌 사용 중인 실제 정책을"automatic"설명합니다. 의ShardingTaskExecutorPoolReplicaSetMatchinggetParameter값을 찾으려면 서버 매개변수의 값을 반환하는 를 사용합니다.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또는 복제본 세트 의 다른 멤버로 보내는 활성 및 저장된 발신 동기 연결의 수를 보고합니다.이러한 연결은,,
totalAvailabletotalCreated에서 보고한 데이터의 하위 집합인 풀의totalInUse일부입니다.
connPoolStats.numAScopedConnection현재
mongod/ 인스턴스에서 clustermongos또는 복제본 세트 의 다른 멤버로 활성 및 저장된 발신 범위 지정 동기 연결의 수를 보고합니다.이러한 연결은,,
totalAvailabletotalCreated에서 보고한 데이터의 하위 집합인 풀의totalInUse일부입니다.
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].ismastertrue이host가 복제본 세트 의 프라이머리 멤버인 경우 를 보고합니다.
connPoolStats.replicaSets.[replicaSet].hosts[n].hiddenReports
trueif thishostis a hidden member of the replica set.
connPoolStats.replicaSets.[replicaSet].hosts[n].tags세트의 이 멤버에 태그가 구성된 경우
members[n].tags을 보고합니다.
ok 상태 필드, operationTime 필드 및 $clusterTime 필드에 대한 자세한 내용은 응답을 참조하세요.