SPARK mapToPair和saveToTextFile我应该使用分区来优化性能

问题描述 投票:0回答:2
spark.driver.memory=4g 
spark.executor.memory=39g
spark.yarn.executor.memoryoverhead=4
spark.dynamicAllocation.maxExecutors=10

Yarn Queue有750GB和150个vcore。

整体实现看起来像

JavaRDD<Collection<InternalObject>> finalRDD = parentJavaRDD
                                               .filter
                                               .mapToPair(<implementation of PairFunction>)
                                               .reduceByKey(<implemementation of Function2>)
                                               .values();
finalRDD
.map(<Impmenetation of Function)
.saveAsTextFile(outputHDFSPath);

[当我看到SPARK执行程序登录到YARN历史记录服务器时,我发现9个执行程序中有1个执行了appx。相较于几分钟之内完成的其他所有人,则需要2个小时。

YARN queue

我还能在这里调整什么?鉴于只有1个执行者要花费大约2个小时的时间,鉴于随机播放率很低,我应该使用分区吗?

。map(

spark.driver.memory = 4g spark.executor.memory = 39g spark.yarn.executor.memoryoverhead = 4 spark.dynamicAllocation.maxExecutors = 10纱线队列有750GB和150个内核。总体实现看起来像...

performance apache-spark yarn
2个回答
0
投票

我建议使用近似正态分布的密钥对数据进行重新分区,以使每个任务在几分钟内完成。


0
投票

而不是用reduceByKey尝试使用aggregateByKey:

© www.soinside.com 2019 - 2024. All rights reserved.