3.8 KiB
layout, title, parent, nav_order, has_children, redirect_from
| layout | title | parent | nav_order | has_children | redirect_from | |
|---|---|---|---|---|---|---|
| default | CAT thread pool | CAT APIs | 75 | false |
|
CAT Thread Pool API
Introduced 1.0 {: .label .label-purple }
The CAT thread pool operation lists the active, queued, and rejected threads of different thread pools on each node.
Endpoints
GET /_cat/thread_pool
GET /_cat/thread_pool/{thread_pool_patterns}
Query parameters
The following table lists the available query parameters. All query parameters are optional.
| 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. Valid values are: cbor, json, smile, text, and yaml. |
text |
h |
List | A comma-separated list of column names to display. | N/A |
help |
Boolean | Returns help information. | false |
limit |
Integer | The maximum number of rows to return. Must be greater than 0. Applied after sorting (s). |
N/A |
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 |
Example requests
The following example request gives information about thread pools on all nodes:
{% capture step1_rest %} GET /_cat/thread_pool?v {% endcapture %}
{% capture step1_python %}
response = client.cat.thread_pool( params = { "v": "true" } )
{% endcapture %}
{% include code-block.html rest=step1_rest python=step1_python %}
If you want to get information for more than one thread pool, separate the thread pool names with commas:
{% capture step1_rest %} GET /_cat/thread_pool/thread_pool_name_1,thread_pool_name_2,thread_pool_name_3 {% endcapture %}
{% capture step1_python %}
response = client.cat.thread_pool( thread_pool_patterns = "thread_pool_name_1,thread_pool_name_2,thread_pool_name_3" )
{% endcapture %}
{% include code-block.html rest=step1_rest python=step1_python %}
If you want to limit the information to a specific thread pool, add the thread pool name after your query:
{% capture step1_rest %} GET /_cat/thread_pool/<thread_pool_name>?v {% endcapture %}
{% capture step1_python %}
response = client.cat.thread_pool( thread_pool_patterns = "<thread_pool_name>", params = { "v": "true" } )
{% endcapture %}
{% include code-block.html rest=step1_rest python=step1_python %}
Example response
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
Required permissions
If you use the Security plugin, make sure you have the appropriate permissions: cluster:monitor/nodes/info.