apache-spark - 在纱线上使用火花流进行动态分配,而不是缩小执行程序
问题描述
我在纱线集群上使用火花流(火花版本 2.2),并试图为我的应用程序启用动态核心分配。
执行器的数量根据需要增加,但是一旦分配了执行器,即使流量减少,它们也不会被缩减,即一旦分配的执行器不会被释放。我还在纱线上启用了外部洗牌服务,如此处所述: https ://spark.apache.org/docs/latest/running-on-yarn.html#configuring-the-external-shuffle-service
我在 spark-submit 命令中设置的配置是:
--conf spark.dynamicAllocation.enabled=false \
--conf spark.streaming.dynamicAllocation.enabled=true \
--conf spark.streaming.dynamicAllocation.scalingInterval=30 \
--conf spark.shuffle.service.enabled=true \
--conf spark.streaming.dynamicAllocation.initialExecutors=15 \
--conf spark.streaming.dynamicAllocation.minExecutors=10 \
--conf spark.streaming.dynamicAllocation.maxExecutors=30 \
--conf spark.streaming.dynamicAllocation.executorIdleTimeout=60s \
--conf spark.streaming.dynamicAllocation.cachedExecutorIdleTimeout=60s \
如果我缺少任何特定的配置,有人可以帮忙吗?
谢谢
解决方案
作为此 JIRA 的一部分添加的文档帮助了我:https ://issues.apache.org/jira/browse/SPARK-12133 。
需要注意的关键点是,当比率(批处理时间/批处理持续时间)小于 0.5(默认值)时,执行器的数量会减少,这实际上意味着执行器有一半时间处于空闲状态。可用于更改此默认值的配置是“spark.streaming.dynamicAllocation.scalingDownRatio”
推荐阅读
- python - find_all 正在捕获我想要的标签,但 find_all_previous 没有(看起来应该是)
- c++ - 如何检查一个库是否可以被特定的 g++ 版本编译?
- node.js - Mongoose.connect 不是从其他文件导出后的函数
- jestjs - 有没有办法改变所需依赖项的模拟值?
- oracle - 自动扩展/自动分配混淆
- javascript - 如何在每次迭代中使用 for..of 和 async await 替换 let..of
- ios - 在 iOS 13 中 - 我们如何实现两种以上的颜色模式/主题?
- sql-server - SAS dsn 到 SQL 服务器
- jquery - Jquery ui 日期选择器被表单中的“以前的条目”阻止
- jquery - 在带参数的 jQuery 函数中使用 async & await