【问题标题】:Elasticsearch High CPU and RAM usageElasticsearch 高 CPU 和 RAM 使用率
【发布时间】:2015-12-22 05:19:35
【问题描述】:

我是这个领域的新手。我已经设置了弹性搜索。它工作正常,但使用的 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/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 中使用默认配置。 提前致谢

【问题讨论】:

    标签: elasticsearch


    【解决方案1】:

    默认情况下,Elasticsearch 默认包含 1 GB 堆大小。

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

    你需要增加你的内存或者你可以减少堆大小(如果你玩的是少量数据)

    Setting Heap Size

    【讨论】:

    • 什么数据量才算小
    • "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 },
    • 例如,你的分片大小应该小于你的堆大小。
    猜你喜欢
    • 1970-01-01
    • 2014-08-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-05
    相关资源
    最近更新 更多