nebulaGraph2.5.1 连接hive 生成sst 文件现在有500个节点和边。每个sql 一个一个执行要好几个小时,问下怎样优化让多个sql 并发执行加快生成文件速度

提问参考模版:

nebula 版本:2.5.0
部署方式(分布式 rpm):
是否为线上版本:Y /
硬件信息
磁盘500ssd
CPU16c、32G内存信息
问题的具体描述
nebulaGraph2.5.1 连接hive 生成sst 文件现在有500个节点和边。每个sql 一个一个执行要好几个小时,问下怎样优化让多个sql 并发执行加快生成文件速度,数据量10亿100G

你看下这个帖子, 你要加一个spark.sql.shuffle.partitions的配置。 nebula exchange SST生成文件 Wrong strNum异常 - #8,来自 nicole
我们测试的ldbc的数据2.2亿点数据耗时7分钟

1 个赞

我配置文件加了 --conf spark.sql.shuffle.partitions=180 但是有第一个sql 1亿数据 分区512 起作用了用了6分钟。但是第二个sql 才500w 数据但只有4个task ,这个是为什么导致后面数据少反而慢

${SPARK_HOME}/bin/spark-submit \
–queue root.ipd.daily \
–name “nebula-import-sst” \
–master yarn \
–driver-cores 16 \
–driver-memory 48g \
–executor-memory 48g \
–deploy-mode cluster \
–num-executors 128 \
–executor-cores 16 \
–conf spark.port.maxRetries=1 \
–conf spark.yarn.maxAppAttempts=1 \
–conf spark.executor.memoryOverhead=8g \
–conf spark.driver.memoryOverhead=8g \
–conf spark.hadoop.fs.defaultFS="$ALG_HDFS" \
–conf spark.default.parallelism=48 \
–conf spark.executor.extraJavaOptions="-XX:MaxDirectMemorySize=7372m" \
–conf spark.sql.shuffle.partitions=180 \
–files “$conf” \
–class com.vesoft.nebula.exchange.Exchange \
lib/nebula-exchange-2.5.1-sst.jar -c $conf -h -d

这个配置生效的话, 页面中会显示任务数是180。 你这个怎么有个stage 任务数是2

就是不知道为什么不生效,帮忙看看

这个jar包是你们自己源码编译的么,改过代码么。 我看配置没啥问题,你试着把其中多余的配置去掉呢。
–conf spark.hadoop.fs.defaultFS=“$ALG_HDFS” \这个不需要,配置文件中有配置hdfs
–conf spark.default.parallelism=48 \ 这个去掉一下 (这个也没看到生效)
还有你的executor数量和executor-cores数太大了,可以适当降低到总cores 为180

包是我自己打的。但是代码我没有改什么,我只是加了一些日志看看执行到哪里了,
–num-executors 128
–executor-cores 16
是改小吗
–num-executors 48
–executor-cores 8 \
这个可以吗

根据你Exchang的配置文件中 配置的tags或edges里面的partition值来定, 不要让num-executors*executor-cores的值大于partition。

还是不行 配置文件分区512

${SPARK_HOME}/bin/spark-submit
–queue root.ipd.daily
–name “nebula-import-sst”
–master yarn
–driver-cores 16
–driver-memory 48g
–executor-memory 48g
–deploy-mode cluster
–num-executors 96
–executor-cores 4
–conf spark.port.maxRetries=1
–conf spark.yarn.maxAppAttempts=1
–conf spark.executor.memoryOverhead=8g
–conf spark.driver.memoryOverhead=8g
–conf spark.hadoop.fs.defaultFS=“$ALG_HDFS”
–conf spark.executor.extraJavaOptions=“-XX:MaxDirectMemorySize=7372m”
–files “$conf”
–class com.vesoft.nebula.exchange.Exchange
lib/nebula-exchange-2.5.1-sst.jar -c $conf -h -d

你上面的配置中 连–conf spark.sql.shuffle.patitions 都去掉了

我已经刚从官网下载了一个exchange2.5.2 也还是不行, ,在帮看看
${SPARK_HOME}/bin/spark-submit
–queue root.ipd.daily
–name “nebula-import-sst”
–master yarn
–driver-cores 16
–driver-memory 48g
–executor-memory 48g
–deploy-mode cluster
–num-executors 96
–executor-cores 4
–conf spark.port.maxRetries=1
–conf spark.yarn.maxAppAttempts=1
–conf spark.executor.memoryOverhead=8g
–conf spark.driver.memoryOverhead=8g
–conf spark.hadoop.fs.defaultFS=“$ALG_HDFS”
–conf spark.executor.extraJavaOptions=“-XX:MaxDirectMemorySize=7372m”
–conf spark.sql.shuffle.partitions=180
–files “$conf”
–class com.vesoft.nebula.exchange.Exchange
lib/nebula-exchange-2.5.2.jar -c $conf -h -d

图里面的一个sql 3个stages 这个是什么意思,前2个512 的分区用到了,后面的就是是数量越多task 才分配的多,这个到底什么原因啊,大神帮看看,这边急这用

  1. 配置文件贴一下看看吧,512 是对源数据做了重分区之后的数据的分区数,这个是没问题的。 然后是做shuffle操作,该操作后tasks数就应该是配置的180了,但你的stage 2 被跳过了。
  2. 还有你按照上面提到的,把 多于的配置先去掉,用最主要的几个配置参数提交试试。

${SPARK_HOME}/bin/spark-submit
–queue root.ipd.daily
–name “nebula-import-sst”
–master yarn
–driver-cores 16
–driver-memory 48g
–executor-memory 48g
–deploy-mode cluster
–num-executors 96
–executor-cores 4
–conf spark.port.maxRetries=1
–conf spark.yarn.maxAppAttempts=1
–conf spark.executor.memoryOverhead=8g
–conf spark.driver.memoryOverhead=8g
–conf spark.hadoop.fs.defaultFS="$ALG_HDFS"
–conf spark.executor.extraJavaOptions="-XX:MaxDirectMemorySize=7372m"
–conf spark.sql.shuffle.partitions=180
–files “$conf”
–class com.vesoft.nebula.exchange.Exchange
lib/nebula-exchange-2.5.1-sst.jar -c $conf -h -d

{
name: Thing
type: {
source: hive
sink: SST
}
exec: “select thing_id, thing_name, thing_title, thing_namech, thing_nameen, thing_abbreviation, thing_tag, thing_alias, thing_abstract, thing_image, thing_video, thing_audio, thing_gmtcreated, thing_gmtmodified, thing_popularity, thing_prior, thing_datasource, thing_urls, thing_class, thing_imagejson, thing_embedding, thing_sourceids, thing_videocover from oppo_kg_dw.dwd_kg_release_spo_thing_df_v3_4_ht_v6 where ds = ‘20211011’”
fields: [thing_name, thing_title, thing_namech, thing_nameen, thing_abbreviation, thing_tag, thing_alias, thing_abstract, thing_image, thing_video, thing_audio, thing_gmtcreated, thing_gmtmodified, thing_popularity, thing_prior, thing_datasource, thing_urls, thing_class, thing_imagejson, thing_embedding, thing_sourceids, thing_videocover]
nebula.fields: [Thing_name, Thing_title, Thing_nameCh, Thing_nameEn, Thing_abbreviation, Thing_tag, Thing_alias, Thing_abstract, Thing_image, Thing_video, Thing_audio, Thing_gmtCreated, Thing_gmtModified, Thing_popularity, Thing_prior, Thing_dataSource, Thing_urls, Thing_class, Thing_imageJson, Thing_embedding, Thing_sourceIds, Thing_videoCover]
vertex: {field:thing_id}
header: true
batch: 512
partition: 512
}

配置中只有一个tag? 你用这个命令测一下,先不加其他的配置。

spark-submit  --class com.vesoft.nebula.exchange.Exchange \
--master yarn \
--deploy-mode cluster \
–num-executors 96 \
–executor-cores 4 \
–executor-memory 48g \
–conf spark.sql.shuffle.partitions=180 \
--files "$conf" \
--spark.executor.extraClassPath=./ \
lib/nebula-exchange-2.5.1-sst.jar -c $conf -h

好的我试试这个参数,是很多tag ,我只是举个例子,其他tag 参数 都和这个一样的

现在好像可以了,第3个任务是180,但是感觉不是很快还是要跑10分钟1.2亿数据 ,但是第一个为什么是50 可以调大吗,

第一个50是因为你的源数据的partition就是50吧,那是读数据的partition