incubator-hugegraph icon indicating copy to clipboard operation
incubator-hugegraph copied to clipboard

restserver.min_free_memory 这个是做什么的

Open 306495389li opened this issue 7 years ago • 3 comments

Expected behavior 期望表现

长时间稳定运行

Actual behavior 实际表现

在做压测时报错: com.baidu.hugegraph.exception.ServerException: The server available memory 109(MB) is below than threshold 256(MB) and can't process the request, you can config restserver.min_free_memory to adjust it or try again later

Specifications of environment 环境信息

  • hugegraph version: 0.10.2
  • operating system: {like centos 7.4, 32 CPUs, 64G RAM}

306495389li avatar Sep 05 '19 07:09 306495389li

@306495389li 这个是为了防止服务因内存问题陷入响应缓慢的机制,解决方法:

  1. 可以分配更大的内存,也可以调小min_free_memory的值(不过256M本身已经很小了)。
  2. 可在客户端处理一下这个异常,减慢发送速度。

ps. 如果是缓存占用了大量内存,可以调小缓存的capacity值。

javeme avatar Sep 11 '19 04:09 javeme

The server available memory 475(MB) is below than threshold 500(MB) and can't process the request, you can config restserver.min_free_memory to adjust it or try again later,今天上线2周,出现这个问题,要怎么处理,我们这个是给app查询用,没法限制访问速度

306495389li avatar Sep 16 '19 02:09 306495389li

  1. 修改bin目录下hugegraph-server.sh的JAVA_OPTIONS="-Xms${MIN_MEM}m -Xmx${XMX}m -javaagent:$LIB/jamm-0.3.0.jar"中Xmx的值,手动调大JVM的最大内存
  2. 在rest-server.properties文件中修改(没有则添加)restserver.min_free_memory为一个更小的值,单位为MB,调低最小内存限制

Linary avatar Sep 16 '19 03:09 Linary