2014-03-30 140 views
4

荫。我们想在几周内提高生产力。今天我打了“顶”,我很震惊我所看到的。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 

这对于elasticsearch使用这么多内存是正常的。我从来没有这样配置过。 如果我们在一台32 GB RAM的机器上最多有5个索引,那么完美的配置是什么? 我应该配置多少Replicas/Shards? 我如何控制内存使用情况?

我不想让我们使用Solr =>意外关机了同样的问题。

感谢您的帮助!

+0

?? – BlackPOP

+0

最新。 1.0。 – Stillmatic1985

回答

4

ES 1.0版本后。默认的文件存储模式是HD.But Mmapfs .the mamapfs存储数据是使用虚拟内存concept.though数据存在于HD,它看起来像读取数据从RAM.It比其他文件系统更加快捷。

所以mmapfs可能看起来消耗更多的空间,它会阻止某些地址space.But它是健康的,一点问题都没有。

配置最佳的分片和副本号refer this

为了摆脱意外停机和.configure下列用语的数据丢失..

1)的ulimit因为没有文件来打开某些用户必须增加高达即可。

2)没有螺纹的,应预先configured..following是一些示例性配置

# 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 
您使用的哪个ES的版本
+0

像MongoDB一样吗? (我的意思是一种RAM和HD数据之间的映射) –

+1

“线程数应预先配置。”? http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/_don_8217_t_touch_these_settings.html#_threadpools –