gpt4 book ai didi

Elasticsearch 内存占用过高

转载 作者:行者123 更新时间:2023-11-29 02:52:14 25 4
gpt4 key购买 nike

我目前在我们的开发机器上使用 elasticsearch。我们想在几周内提高生产力。今天我输入了“top”,我对所看到的感到震惊。

 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 个索引,那么完美的配置是什么?我应该配置多少个副本/碎片?我如何控制内存使用量?

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

感谢您的帮助!

最佳答案

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

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

配置分片和副本的最佳数量 refer this .

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

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

关于Elasticsearch 内存占用过高,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22748200/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com