繁体   English   中英

Elasticsearch高内存使用率

[英]Elasticsearch high memory usage

我目前在我们的开发机器上使用elasticsearch。 我们希望在几周内提高工作效率。 今天我输入了“顶级”,我感到很震惊。

 PID   USER      PR   NI  VIRT  RES   SHR S  %CPU %MEM    TIME+   COMMAND
 28972 elastics  20   0   27.4g 1.4g  39m S  186  4.3     2:11.19 java

弹性搜索使用如此多的内存是否正常? 我从来没有这样配置过。 如果我们在一台具有32 GB RAM的机器上拥有多达5个索引,那么完美配置是什么? 我应该配置多少副本/碎片? 我如何控制内存使用量?

我不想得到与Solr =>意外停机相同的问题。

谢谢你的帮助!

Es 1.0版之后。 默认文件存储模式是Mmapfs.mamapfs以HD格式存储数据。但是它使用虚拟内存概念。虽然数据存在于HD中,但它看起来像是从RAM中获取数据。它比其他文件系统更快。

因此mmapfs可能看起来消耗更多的空间并且它阻止了一些地址空间。但它是健康的并且完全没有问题。

要配置分片和副本的最佳数量, 请参阅 此处

要摆脱意外停机和数据丢失。请配置以下条款..

1) ulimit对于某些用户无法打开的文件必须增加尽可能多。

2)不应预先配置线程数。以下是一些示例配置

    # Search pool
threadpool.search.type: fixed
threadpool.search.size: 5
threadpool.search.queue_size: 200

# Bulk pool
threadpool.bulk.type: fixed
threadpool.bulk.size: 5
threadpool.bulk.queue_size: 300

# Index pool
threadpool.index.type: fixed
threadpool.index.size: 5
threadpool.index.queue_size: 200

# Indices settings
indices.memory.index_buffer_size: 30%
indices.memory.min_shard_index_buffer_size: 12mb
indices.memory.min_index_buffer_size: 96mb

# Cache Sizes
indices.fielddata.cache.size: 15%
indices.fielddata.cache.expire: 6h
indices.cache.filter.size: 15%
indices.cache.filter.expire: 6h

# Indexing Settings for Writes
index.refresh_interval: 30s
index.translog.flush_threshold_ops: 50000

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM