Hot thread API
Sometimes your cluster slows down due to massive CPU usage and you need to understand why.
Elasticsearch provides the ability to monitor hot threads to be able to understand where the problem is.
Note
In Java, hot threads are threads that are using a lot of CPU and take a long time to execute.
Getting ready
You need an up-and-running Elasticsearch installation as we described in the Downloading and installing Elasticsearch recipe in Chapter 2, Downloading and Setup.
To execute curl
via the command-line, you need to install curl
for your operating system.
How to do it...
For getting task information, we will perform the following steps:
To retrieve the node information, the HTTP method is
GET
and the curl command is as follows:curl -XGET 'http://localhost:9200/_nodes/hot_threads'curl -XGET 'http://localhost:9200/_nodes/{nodesIds}/hot_threads'
The result will be something similar to the preceding one:
::: {7NwnFF1}{7NwnFF1JTPOPhOYuP1AVNQ}{OL2uVn3BQ-qMAg32eq_ouQ...