Hai I run elasticsearch version 2.1.1 when I run this command use curl curl -XGET 'http://localhost:9200/_cluster/stats?human&pretty'
I get response like this
"os" : { "available_processors" : 2, "allocated_processors" : 2, "mem" : { "total" : "0b", "total_in_bytes" : 0 }, "names" : [ { "name" : "Linux", "count" : 1 } ] }, "process" : { "cpu" : { "percent" : 57 }, "open_file_descriptors" : { "min" : 356, "max" : 356, "avg" : 356 } },"jvm" : { "max_uptime" : "11.9h", "max_uptime_in_millis" : 42904238, "versions" : [ { "version" : "1.8.0_66", "vm_name" : "Java HotSpot(TM) 64-Bit Server VM", "vm_version" : "25.66-b17", "vm_vendor" : "Oracle Corporation", "count" : 1 } ], "mem" : { "heap_used" : "244.9mb", "heap_used_in_bytes" : 256844296, "heap_max" : "505.3mb", "heap_max_in_bytes" : 529924096 },
in this response my cpu usage only 57%, but when I run use top
in my ubuntu
I get
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 813 elastic+ 20 0 3063688 658044 4556 S 116.5 32.1 335:29.70 java
my question is, my cpu usage 116.5 % use top
or 57% use curl -XGET 'http://localhost:9200/_cluster/stats?human&pretty'
By default, top
operates in Irix mode (CPU usage is as a percent of a single CPU) but you can switch to Solaris mode (CPU usage is as a percent of the total number of CPUs) by hitting I
in top
. However, the stats being reported by Elasticsearch are in Solaris mode.
Since you have a machine with two logical CPUs, it explains everything because 0.57 * 2 * 100
is 114
, pretty much the same as top
.
See man top
for more details.