gpt4 book ai didi

elasticsearch - Elasticsearch 支持 30.5Gb 堆(总共 256 Gb 内存)有多少虚拟内存?

转载 作者:行者123 更新时间:2023-12-03 01:03:00 27 4
gpt4 key购买 nike

假设我有一台具有 256gb 内存和 12TB SSD 的机器。索引文档大小为 100TB。我为 Elasticsearch 堆分配了 30.5 GB。剩下的用于 Lucene 和 OS。

我的问题是,Elasticsearch 支持多少虚拟内存?换句话说,我可以在每台机器的虚拟内存中放入多少索引文档?

谢谢

最佳答案

virtual memory ES 可以使用的数量由 vm.max_map_count 中的 /etc/sysctl.conf 设置的值定义。默认情况下,它设置为 262144,但您可以使用以下方法更改此值:

sysctl -w vm.max_map_count=262144

linux documentation :

This file contains the maximum number of memory map areas a process may have. Memory map areas are used as a side-effect of calling malloc, directly by mmap and mprotect, and also when loading shared libraries.

While most applications need less than a thousand maps, certain programs, particularly malloc debuggers, may consume lots of them, e.g., up to one or two maps per allocation.

The default value is 65536.



所以这个设置不会强加 ES/Lucene 可用的特定 大小 ,而是给定进程可以使用的 离散内存区域 数量。究竟使用了多少内存取决于 ES/Lucene 分配的内存块的大小。 By default , Lucene 使用
  • 1<<30 = 1,073,741,824 ~= 64 位 JRE 和
  • 上的 1GB block
  • 1<<28 = 268,435,456 ~= 32 位 JRE 上的 256MB block

  • 因此,如果您进行数学计算, vm.max_map_count 的默认值可能足以满足您的情况,如果不是,您可以调整它并监控您的虚拟内存使用情况。

    关于elasticsearch - Elasticsearch 支持 30.5Gb 堆(总共 256 Gb 内存)有多少虚拟内存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34755792/

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