Elasticsearch高CPU和RAM使用率

3

我是这个领域的新手。我已经设置了elasticsearch。它能够正常工作,但是cpu使用率和内存使用量变得非常高。这影响了服务器的性能。我的elasticsearch版本如下:

{
  "status" : 200,
  "name" : "Aireo",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "1.4.4",
    "build_hash" : "c88f77ffc81301dfa9dfd81ca2232f09588bd512",
    "build_timestamp" : "2015-02-19T13:05:36Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.3"
  },
  "tagline" : "You Know, for Search"
}

服务器配置:

cpu family  : 6
model       : 62
model name  : Intel(R) Xeon(R) CPU E5-2630L v2 @ 2.40GHz
stepping    : 4
microcode   : 0x1
cpu MHz     : 2399.998
cache size  : 15360 KB
MemTotal:        2049964 kB
MemFree:          122056 kB
Buffers:           77396 kB
Cached:           184528 kB
SwapCached:            0 kB
Active:          1685792 kB
Inactive:         139420 kB
Active(anon):    1569940 kB
Inactive(anon):     8332 kB
Active(file):     115852 kB
Inactive(file):   131088 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:             0 kB
SwapFree:              0 kB

系统使用:

 PID  USER      PR      NI    VIRT        RES          SHR     S    %CPU     %MEM       TIME+      COMMAND
27029 elastic+  20      0     4361248     1.186g       7372    S     110.7    60.7       1037:36    java  

_nodes/stats/jvm

{  
   "cluster_name":"elasticsearch",
   "nodes":{  
      "cYUNisljRXmeLSiMk6kY_Q":{  
         "timestamp":1450761255965,
         "name":"Aireo",
         "transport_address":"inet[128.199.229.70/128.199.229.70:9300]",
         "host":"TLM",
         "ip":[  
            "inet[128.199.229.70/128.199.229.70:9300]",
            "NONE"
         ],
         "jvm":{  
            "timestamp":1450761255965,
            "uptime_in_millis":64493824,
            "mem":{  
               "heap_used_in_bytes":1051633552,
               "heap_used_percent":99,
               "heap_committed_in_bytes":1056309248,
               "heap_max_in_bytes":1056309248,
               "non_heap_used_in_bytes":85983832,
               "non_heap_committed_in_bytes":87912448,
               "pools":{  
                  "young":{  
                     "used_in_bytes":139591680,
                     "max_in_bytes":139591680,
                     "peak_used_in_bytes":139591680,
                     "peak_max_in_bytes":139591680
                  },
                  "survivor":{  
                     "used_in_bytes":12757624,
                     "max_in_bytes":17432576,
                     "peak_used_in_bytes":17432576,
                     "peak_max_in_bytes":17432576
                  },
                  "old":{  
                     "used_in_bytes":899284872,
                     "max_in_bytes":899284992,
                     "peak_used_in_bytes":899284992,
                     "peak_max_in_bytes":899284992
                  }
               }
            },
            "threads":{  
               "count":50,
               "peak_count":52
            },
            "gc":{  
               "collectors":{  
                  "young":{  
                     "collection_count":844,
                     "collection_time_in_millis":4550
                  },
                  "old":{  
                     "collection_count":20606,
                     "collection_time_in_millis":54410384
                  }
               }
            },
            "buffer_pools":{  
               "direct":{  
                  "count":49,
                  "used_in_bytes":6269492,
                  "total_capacity_in_bytes":6269492
               },
               "mapped":{  
                  "count":1202,
                  "used_in_bytes":863065239,
                  "total_capacity_in_bytes":863065239
               }
            }
         }
      }
   }
}

我正在使用elasticsearch xml中的默认配置。

提前感谢。

1个回答

1

默认情况下,Elasticsearch 的堆大小为 1 GB。

对于几乎所有的部署来说,这个数字都太小了。如果您使用默认的堆值,则您的集群可能配置不正确。

您需要增加RAM或者可以减少堆大小(如果您处理的数据量很小)。

设置堆大小


可以称之为小数据量的数据有多少? - Tushar Kundra
"indices":{
"docs":{
"count":13585142, "deleted":0 }, "indexing":{
"index_total":72005, "index_time_in_millis":11273670, "index_current":1, "delete_total":0, "delete_time_in_millis":0, "delete_current":0, "noop_update_total":0, "is_throttled":false, "throttle_time_in_millis":0 },
- Tushar Kundra
例如,您的分片大小应小于堆大小。 - Pandiyan Cool

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接