我正在 AWS EMR(3 个节点 * m4.4xlarge 集群 - 每个节点 16vCPU 和 64G RAM)上运行 Spark Streaming 应用程序的 2 个副本(Spark 2.2.1、EMR 5.11、Scala)。
在内置 EMR 集群监控(Ganglia)中,我看到集群的 CPU 利用率低于 30%,内存使用量不超过 32GB,可用容量约为 200GB,网络也远未达到 100%。但应用程序几乎无法在批处理间隔内完成批处理。
以下是我使用客户端模式将应用程序的每个副本提交给 Master 的参数:
--master yarn
--num-executors 2
--executor-cores 20
--executor-memory 20G
--conf spark.driver.memory=4G
--conf spark.driver.cores=3
如何才能实现更好的资源利用率(应用性能)?
最佳答案
You can configure your executors to utilize the maximum resources possible on each node in a cluster by using the spark configuration classification to set
maximizeResourceAllocation
option totrue
. This EMR-specific option calculates the maximum compute and memory resources available for an executor on an instance in the core instance group. It then sets the corresponding spark-defaults settings based on this information.[ { "Classification": "spark", "Properties": { "maximizeResourceAllocation": "true" } } ]
进一步阅读
关于apache-spark - AWS EMR Spark 应用程序 - CPU 和内存利用率不佳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48211775/