2014-03-30 57 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 –