2015-12-22 340 views
1

我是這方面的新手。我已經設置了elasticsearch。它工作正常,但使用的CPU和內存變得非常高。這阻礙了服務器的性能。這是我的彈性搜索版本Elasticsearch高CPU和內存使用率

{ 
    "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 /統計/ 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 xm中配置湖 在此先感謝

回答

0

默認情況下,Elasticsearch默認情況下包含1 GB的堆大小。

對於幾乎所有的部署,這個數字太小了。如果 正在使用默認堆值,那麼您的羣集可能被錯誤地配置爲 。

你需要增加你的RAM或可以減少堆大小(如果你有少量數據的播放)

Setting Heap Size

+0

什麼數據量可以稱爲小 –

+0

「指數」:{ 「文檔」:{ 「計數」:13585142, 「已刪除」:0 }, 「索引」:{ 「index_total」:72005, 「index_time_in_millis」:11273670, 「index_cu rrent「:1, 」delete_total「:0, 」delete_time_in_millis「:0, 」delete_current「:0, 」noop_update_total「:0, 」is_throttled「:假, 」throttle_time_in_millis「:0 }, –

+0

例如,你的分片大小應該小於你的堆大小。 –