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

Hugegraph-Tools加载数据过慢问题

Open big1white opened this issue 5 years ago • 7 comments

Expected behavior 期望表现

{type something here...}

Actual behavior 实际表现

{type something here...} 使用bin/hugegraph restore -t all -d data 加载26万节点,40万边的数据要花费35秒,速度过慢 tool版本1.4

Steps to reproduce the problem 复现步骤

  1. {step 1}
  2. {step 2}
  3. {step 3}

Status of loaded data 数据状态

Vertex/Edge summary 数据量

  • loaded vertices amount: {like 10 million}
  • loaded edges amount: {like 20 million}
  • loaded time: {like 200s}

Vertex/Edge example 数据示例

{type something here...}

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

{type something here...}

Specifications of environment 环境信息

  • hugegraph version: {like v0.7.4}
  • operating system: {like centos 7.4, 32 CPUs, 64G RAM}
  • hugegraph backend: {like cassandra 3.10, cluster with 20 nodes, 3 x 1TB HDD disk each node}

big1white avatar Mar 12 '21 09:03 big1white

@big1white restore的目标HG是什么存储后端?正常使用loader导入的速度是多少呢?

zhoney avatar Mar 16 '21 05:03 zhoney

@big1white restore的目标HG是什么存储后端?正常使用loader导入的速度是多少呢?

后端是HBase,loader导入的数据需要12秒,back up指令备份后,使用Tools的restore命令导入却需要35秒

big1white avatar Mar 16 '21 08:03 big1white

@big1white 那应该是两个方面的原因:

  1. tools backup和restore时是多线程将数据从HG和文件之间进行传输的,默认线程数是core数的1/2,没有loader的线程多
  2. 文件中的数据分布的不均匀,导致有的线程提前结束,有的线程会慢一些

zhoney avatar Mar 17 '21 08:03 zhoney

@big1white 那应该是两个方面的原因:

  1. tools backup和restore时是多线程将数据从HG和文件之间进行传输的,默认线程数是core数的1/2,没有loader的线程多
  2. 文件中的数据分布的不均匀,导致有的线程提前结束,有的线程会慢一些

能否通过修改tools的部分代码提高core数?目前加载太慢了

big1white avatar Mar 18 '21 03:03 big1white

@big1white 需要改源码: https://github.com/hugegraph/hugegraph-tools/blob/52e6a283722783b49e57390c3fa615e164b83704/src/main/java/com/baidu/hugegraph/base/RetryManager.java#L37。 如果着急用的话可以先自己修改源码重新打包tools。

后续我们会把这个线程数改为可配置参数

zhoney avatar Mar 18 '21 07:03 zhoney

@big1white 需要改源码: https://github.com/hugegraph/hugegraph-tools/blob/52e6a283722783b49e57390c3fa615e164b83704/src/main/java/com/baidu/hugegraph/base/RetryManager.java#L37。 如果着急用的话可以先自己修改源码重新打包tools。

后续我们会把这个线程数改为可配置参数

增加了CPU内核数目以及修改源码内线程数目,导入效率依然没有改善 private static int threadsNum = Math.min(10, Math.max(8, Runtime.getRuntime().availableProcessors()));

迫不得已把backup的的压缩文件转成text再用loader导入

big1white avatar Mar 20 '21 07:03 big1white

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

github-actions[bot] avatar Jun 01 '21 22:06 github-actions[bot]