• 请不要在回答技术问题时复制粘贴 AI 生成的内容
alwayshere
V2EX  ›  程序员

怎样防止 ES 因为内存过大而首当其冲被系统 kill 掉?

  •  
  •   alwayshere · Nov 1, 2018 · 3116 views
    This topic created in 2784 days ago, the information mentioned may be changed or developed.

    手上几台服务器,ES 都是耗内存大户,跑其它进程时有时候没优化好内存,内存爆了的时候,ES 首先就被 kill 了,怎样防止 ES 始终不被杀掉,而去终止其它任何进程都可以

    3 replies    2018-11-01 16:28:07 +08:00
    zerofiny
        1
    zerofiny  
       Nov 1, 2018
    1. 开启 swap 物理内存被用完不被 kill 只会慢很多
    2. 设置 jvm 最大内存不要超过物理内存的 80%
    cozybz
        2
    cozybz  
       Nov 1, 2018
    Linux OOM-killer
    echo -17 > /proc/$(pidof xxx)/oom_adj
    参考 https://learning-kernel.readthedocs.io/en/latest/mem-management.html
    jbiao520
        3
    jbiao520  
       Nov 1, 2018
    写段脚本,内存用光的时候 kill 指定程序?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5835 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 49ms · UTC 03:26 · PVG 11:26 · LAX 20:26 · JFK 23:26
    ♥ Do have faith in what you're doing.