单机模式standalone-config.json配置优化

优化建议:

单机版默认使用MySQL存储统计结果数据,Mysql的读写压力较大,需要预留服务器内存的30%~40%给MySQL服务。 所以lighthouse相关进程和redis进程占用最多不要超过服务器总内存的40%。redis的主从模式可能会存在单点写入故障问题,所以单机版的redis仍使用集群模式,即启动6个节点。

本服务按照以下规则进行配置:

redis_max_memory * 6 + standalone_xmx_memory + insights_xmx_memory < 系统总内存的*40%。

如果服务器资源较为紧张,请务必关注服务器的内存使用率相关数据,内存使用率如果超过70%,请及时进行相关参数调整或扩容,防止内存刷满,导致服务故障(严重时可能会导致服务器无法登录的情况,需要重启解决)!

1. standalone-config.json快速配置参考

如果您对于各组件优化缺乏相关经验,可以按照自身服务器配置情况,直接拷贝以下配置即可!

1.1. 单节点8G内存配置参考

  • standalone-config.json配置
    {
    "lighthouse": {
      "timezone": "Asia/Shanghai",
      "standalone_xmx_memory": "900M",
      "standalone_xms_memory": "900M",
      "insights_xmx_memory": "256M",
      "insights_xms_memory": "256M"
    },
    "redis": {
      "max_memory": "256M"
    }
    }
    

1.2. 单节点16G内存配置参考

  • standalone-config.json配置
    {
    "lighthouse": {
      "timezone": "Asia/Shanghai",
      "standalone_xmx_memory": "1300M",
      "standalone_xms_memory": "1300M",
      "insights_xmx_memory": "300M",
      "insights_xms_memory": "300M"
    },
    "redis": {
      "max_memory": "500M"
    }
    }
    

1.3. 单节点32G内存配置参考

  • standalone-config.json配置
    {
    "lighthouse": {
      "timezone": "Asia/Shanghai",
      "standalone_xmx_memory": "2000M",
      "standalone_xms_memory": "2000M",
      "insights_xmx_memory": "500M",
      "insights_xms_memory": "500M"
    },
    "redis": {
      "max_memory": "1000M"
    }
    }
    

1.4. 单节点64G内存配置参考

  • standalone-config.json配置

    {
    "lighthouse": {
      "timezone": "Asia/Shanghai",
      "standalone_xmx_memory": "3000M",
      "standalone_xms_memory": "3000M",
      "insights_xmx_memory": "1024M",
      "insights_xms_memory": "1024M"
    },
    "redis": {
      "max_memory": "2000M"
    }
    }
    

    1.5. 单节点128G内存配置参考

  • standalone-config.json配置

    {
    "lighthouse": {
      "timezone": "Asia/Shanghai",
      "standalone_xmx_memory": "4000M",
      "standalone_xms_memory": "4000M",
      "insights_xmx_memory": "1024M",
      "insights_xms_memory": "1024M"
    },
    "redis": {
      "max_memory": "4000M"
    }
    }
    

1.6. 单节点256G内存配置参考

  • standalone-config.json配置
    {
    "lighthouse": {
      "timezone": "Asia/Shanghai",
      "standalone_xmx_memory": "5000M",
      "standalone_xms_memory": "5000M",
      "insights_xmx_memory": "2048M",
      "insights_xms_memory": "2048M"
    },
    "redis": {
      "max_memory": "5000M"
    }
    }
    

results matching ""

    No results matching ""