apache / incubator-hugegraph

A graph database that supports more than 100+ billion data, high performance and scalability (Include OLTP Engine & REST-API & Backends)
https://hugegraph.apache.org
Apache License 2.0
2.66k stars 520 forks source link

[Question] oltp时,客户端多线程查询时,报“Interrupted, maybe it is timed out” #2469

Closed LiJie20190102 closed 7 months ago

LiJie20190102 commented 8 months ago

Problem Type (问题类型)

rest-api (结果不合预期)

Before submit

Environment (环境信息)

Your Question (问题描述)

我使用hugegraph-clint多线程(100)调用oltp时,发现返回异常信息,但是当我减小线程时,这种错误现象就会现象就会减少,请问是内存原因么,就是我给的内存比较小导致的么? image

Vertex/Edge example (问题点 / 边数据举例)

No response

Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

No response

dosubot[bot] commented 8 months ago

你好,@LiJie20190102!很高兴再次见到你在这里提出问题。希望这次我们能一起找到解决方案。🚀

您在使用hugegraph-client进行OLTP操作时遇到的"Interrupted, maybe it is timed out"异常可能是由于CoreOptions.java文件中的配置设置引起的。这个问题可能源于限制系统有效处理大量并发请求的配置。以下是一些可能影响此行为的配置:

  1. RAFT RPC Threads (RAFT_RPC_THREADS):此配置设置jraft RPC层的RPC线程数。默认值设置为Math.max(CPUS * 2, 80)。如果您使用的线程数(100线程)超过了RPC层处理并发请求的能力,可能会导致超时。

  2. RAFT Queue Size (RAFT_QUEUE_SIZE):此选项配置jraft RaftNode、StateMachine和LogManager的disruptor缓冲区大小。默认值为16384。如果队列大小相对于请求量太小,可能会导致拥塞和超时。

  3. RAFT Queue Publish Timeout (RAFT_QUEUE_PUBLISH_TIMEOUT):此设置在发布事件到disruptor时的超时秒数。默认值为60秒。如果操作处理时间超过这个时间,可能会导致"Interrupted, maybe it is timed out"异常。

减少线程数或增加内存分配可能会通过减少系统负载和防止超时来解决问题。具体来说:

值得一提的是,还应该检查其他与超时、队列大小和线程数相关的配置,以确保它们根据您的工作负载需求和系统能力进行调整。调整这些配置应该小心谨慎,并进行全面测试,以找到适合您特定用例的最佳设置。

参考资料:

Sources

#### About Dosu This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot.
github-actions[bot] commented 8 months ago

Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label