CAT Thread Pool API
CAT Thread Pool API는 각 노드의 다양한 스레드 풀(thread pool)에서 활성(active), 대기(queued), 거부(rejected)된 스레드 목록을 보여주는 작업이에요. 노드가 어떻게 부하를 처리하고 있는지 한눈에 파악하고 싶을 때 유용해요. 이 기능은 OpenSearch 1.0에서 처음 소개되었어요.
출처: OpenSearch 문서
본문
엔드포인트
GET /_cat/thread_pool
GET /_cat/thread_pool/{thread_pool_patterns}
쿼리 매개변수
다음 표는 사용 가능한 쿼리 매개변수 목록이에요. 모든 쿼리 매개변수는 선택 사항이에요.
| Parameter | Data type | Description | Default | | cluster_manager_timeout | String | A timeout for connection to the cluster manager node. | N/A | | format | String | A short version of the Accept header, such as json or yaml. | N/A | | h | List | A comma-separated list of column names to display. | N/A | | help | Boolean | Returns help information. | false | | local | Boolean | Returns local information but does not retrieve the state from the cluster manager node. | false | | s | List | A comma-separated list of column names or column aliases to sort by. | N/A | | size | Integer | The multiplier in which to display values. | N/A | | v | Boolean | Enables verbose mode, which displays column headers. | false |
예제 요청
다음 예제 요청은 모든 노드의 스레드 풀 정보를 보여줘요:
GET /_cat/thread_pool?v
response = client.cat.thread_pool(
params = { "v": "true" }
)
여러 스레드 풀의 정보를 한 번에 얻고 싶다면 스레드 풀 이름을 쉼표로 구분하면 돼요:
GET /_cat/thread_pool/thread_pool_name_1,thread_pool_name_2,thread_pool_name_3
response = client.cat.thread_pool(
thread_pool_patterns = "thread_pool_name_1,thread_pool_name_2,thread_pool_name_3"
)
정보를 특정 스레드 풀로 제한하고 싶다면 쿼리 뒤에 스레드 풀 이름을 붙이면 돼요:
GET /_cat/thread_pool/?v
response = client.cat.thread_pool(
thread_pool_patterns = "",
params = { "v": "true" }
)
예제 응답
node_name name active queue rejected
odfe-node2 ad-batch-task-threadpool 0 0 0
odfe-node2 ad-threadpool 0 0 0
odfe-node2 analyze 0 0 0s
필요한 권한
Security 플러그인을 사용한다면 적절한 권한이 있는지 확인해 주세요: cluster:monitor/nodes/info.
더 알아보기 (Learn more)
스레드 풀과 관련된 더 자세한 내용을 확인하고 싶다면 원문 OpenSearch 문서를 참고해 주세요.