How to check the Elasticsearch node's RAM details
I have given with an ES link and some of my ES queries are timing out on that. As the first step of my debugging, I want to know the RAM configuration of my ES nodes.
Is there any API available which gives that information for me?
1 Answer
Elasticsearch has /stats
endpoint to know the Node stats. You can eighter know one particular node's stats by running the following
GET /_nodes/nodeId_1,nodeId_2/stats
or you can get all node stats by running the following
GET /_nodes/stats
This gives a verbose output. If you are looking for memory information you can actually check for JVM stats
by running the following
GET /_nodes/stats/jvm
For example, if you are running Elasticsearch on local with default port 9200 then you can call the following URL
http://localhost:9200/_nodes/stats/jvm
This gives the following output, from that you can check for heap_max_in_bytes
{
"_nodes": {
"total": 1,
"successful": 1,
"failed": 0
},
"cluster_name": "elasticsearch_username",
"nodes": {
"ngeh7O8lSD6qmDXFi8P2kg": {
"timestamp": 1563889858693,
"name": "ngeh7O8",
"transport_address": "127.0.0.1:9300",
"host": "127.0.0.1",
"ip": "127.0.0.1:9300",
"roles": ["master", "data", "ingest"],
"jvm": {
"timestamp": 1563889858693,
"uptime_in_millis": 51725,
"mem": {
"heap_used_in_bytes": 159842296,
"heap_used_percent": 15,
"heap_committed_in_bytes": 1037959168,
"heap_max_in_bytes": 1037959168,
"non_heap_used_in_bytes": 73089592,
"non_heap_committed_in_bytes": 78700544,
"pools": {
"young": {
"used_in_bytes": 83530696,
"max_in_bytes": 286326784,
"peak_used_in_bytes": 286326784,
"peak_max_in_bytes": 286326784
},
"survivor": {
"used_in_bytes": 35782656,
"max_in_bytes": 35782656,
"peak_used_in_bytes": 35782656,
"peak_max_in_bytes": 35782656
},
"old": {
"used_in_bytes": 40528944,
"max_in_bytes": 715849728,
"peak_used_in_bytes": 40528944,
"peak_max_in_bytes": 715849728
}
}
},
"threads": {
"count": 76,
"peak_count": 76
},
"gc": {
"collectors": {
"young": {
"collection_count": 5,
"collection_time_in_millis": 83
},
"old": {
"collection_count": 1,
"collection_time_in_millis": 32
}
}
},
"buffer_pools": {
"direct": {
"count": 27,
"used_in_bytes": 16873440,
"total_capacity_in_bytes": 16873439
},
"mapped": {
"count": 209,
"used_in_bytes": 2084221872,
"total_capacity_in_bytes": 2084221872
}
},
"classes": {
"current_loaded_count": 10579,
"total_loaded_count": 10579,
"total_unloaded_count": 0
}
}
}
}
}