incubator-hugegraph
incubator-hugegraph copied to clipboard
求教出错:The rest server is too busy to write
多线访问 hugegraphServer 时,当并发量大于一定程度会导致server繁忙报错,错误如下: com.baidu.hugegraph.HugeException: The rest server is too busy to write
请问如何配置可以延长 hugegraphServer 的超时时间(或者增大连接池数量),而非快速地给出失败响应,谢谢!
- 修改(如果没有则增加)
rest-server.properties的batch.max_write_ratio=90,这个配置项表示机器有多大比例的线程用于批量写数据,默认值是 50(0-100之间),相当于比例为 0.5,那线程数就是CPU个数 * 2 * 0.5。 - 除了修改比例,也可以直接指定写线程数,在
rest-server.properties中添加batch.max_write_threads=xxx。如果这两个配置都写了,batch.max_write_threads会生效。 - 请问你是使用什么工具或组件访问的HugeGraphServer,如果是通过了
HugeClient,那在new HugeClient时可以指定第三个参数(tiemout),默认20秒。如果是Loader,可以通过--timeout指定该参数,在Loader中默认60秒。
@Linary 现在是使用的HugeClient访问的HugeGraphServer。 非常感谢,20秒的超时应该是够了,增大write_thread数量就没有报错了。