AI 에이전트의 경우: 문서 인덱스는 https://www.mongodb.com/ko-kr/docs/llms.txt에서 사용할 수 있으며, 모든 페이지의 마크다운 버전은 어떤 URL 경로에 .md를 추가하여 사용할 수 있습니다.
Docs Menu

connPoolStats (데이터베이스 명령)

connPoolStats

The command connPoolStats returns 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> } ) 메서드를 사용합니다.

참고

connPoolStats only returns meaningful results for mongos instances and for mongod instances 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.

명령은 다음과 같은 구문을 가집니다:

db.runCommand(
{
connPoolStats: 1
}
)

인수 값(예: 1 )는 명령의 출력에 영향을 주지 않습니다.

connPoolStats 는 출력에 집계된 통계를 포함합니다.

  • The hosts field displays the information aggregated by host.

  • The pools field 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 ShardingTaskExecutorPoolReplicaSetMatching is set to "automatic", the replicaSetMatchingStrategy still describes the actual policy being used, not "automatic". To find the value of the ShardingTaskExecutorPoolReplicaSetMatching, use getParameter which 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 cluster mongos또는 복제본 세트 의 다른 멤버로 보내는 활성 및 저장된 발신 동기 연결의 수를 보고합니다.

These connections are a part of a pool that is a subset of the data reported by totalAvailable, totalCreated, and totalInUse.

connPoolStats.numAScopedConnection

현재 mongod / 인스턴스에서 cluster mongos또는 복제본 세트 의 다른 멤버로 활성 및 저장된 발신 범위 지정 동기 연결의 수를 보고합니다.

These connections are a part of a pool that is a subset of the data reported by totalAvailable, totalCreated, and 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 connPoolStats does 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.global

DBClient 기반 풀 통계를 표시합니다.

connPoolStats.pools.[pool].poolWasNeverUsed

이 연결 풀에서 사용된 적이 없고 닫힌 연결의 수를 표시합니다.

connPoolStats.pools.[pool].acquisitionWaitTimes

버전 6.3에 추가 되었습니다.

Reports the wait times for requests to acquire a connection from mongos to mongod. For details, see connPoolStats.acquisitionWaitTimes.

connPoolStats.hosts

호스트별로 그룹화된 연결 통계(사용/사용 가능/생성됨/새로 고침)를 보고합니다.

현재 mongod / mongos 인스턴스와 cluster 또는 복제본 세트의 각 멤버 간의 연결 보고서를 나타내는 문서 가 포함됩니다.

connPoolStats.hosts.[host].available

[host] 에 연결하는 데 사용할 수 있는 총 연결 수를 보고합니다.

connPoolStats.hosts.[host].leased

풀에서 빌린 호스트와 반환될 것으로 예상되는 호스트의 총 연결 수를 보고합니다. 이러한 연결은 임대 기간 동안 활성 상태로 유지되지 않을 수 있으며 관련 지표에서 제외됩니다. 이러한 연결은 임대 기간 동안에는 사용할 수 없습니다.

connPoolStats.hosts.[host].created

생성된 [host] 에 대한 연결 수를 보고합니다.

connPoolStats.hosts.[host].inUse

현재 사용 중인 [host] 에 대한 연결 수를 보고합니다.

connPoolStats.hosts.[host].wasNeverUsed

host 에서 사용된 적이 없는 sharded cluster 또는 복제본 세트 의 다른 멤버로 나가는 발신 연결의 총 건수를 보고합니다.

connPoolStats.hosts.[host].acquisitionWaitTimes

버전 6.3에 추가 되었습니다.

Reports the wait times for requests to acquire a connection from mongos to mongod. For details, see connPoolStats.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].ok

다음과 같은 경우 false 을(를) 보고합니다.

  • 현재 mongos 또는 mongod 는 인스턴스에 연결할 수 없습니다.

  • 현재 mongos 또는 mongod 에 연결 예외 또는 오류가 발생했습니다.

이 필드는 내부용입니다.

connPoolStats.replicaSets.[replicaSet].hosts[n].ismaster

Reports true if this host is the primary member of the replica set.

connPoolStats.replicaSets.[replicaSet].hosts[n].hidden

Reports true if this host is a hidden member of the replica set.

connPoolStats.replicaSets.[replicaSet].hosts[n].secondary

Reports true if this host is a secondary member of the replica set.

connPoolStats.replicaSets.[replicaSet].hosts[n].pingTimeMillis

Reports the ping time in milliseconds from the mongos or mongod to this host.

connPoolStats.replicaSets.[replicaSet].hosts[n].tags

세트의 이 멤버에 태그가 구성된 경우 members[n].tags 을 보고합니다.

ok 상태 필드, operationTime 필드 및 $clusterTime 필드에 대한 자세한 내용은 응답을 참조하세요.

host

이 페이지 평가하기