Understanding resource allocation for spark jobs on mesos

淺唱寂寞╮ 提交于 2019-12-03 14:52:47

Question 1: In coarse-grained mode, Spark's executor (org.apache.spark.executor.CoarseGrainedExecutorBackend) is launched as Mesos task. Mesos Framework actually is Spark Driver. One Spark Driver could submit multiple Spark jobs. It depends on your Spark application. Spark and Mesos both come from AMPLab of UC Berkeley and are developed in parallel, so they use similar terminologies (executor, task ...) which may confuse you :-).

Question 2: In coarse-grained mode, Spark launch only one executor per host (please refer to https://issues.apache.org/jira/browse/SPARK-5095 for details). So for you case, Spark will launch one executor per host (each executor consume 16G memory, and all the available cores in the host which is 16 cores if there is no other workload) until total cores of executors reach 240 cores. There will be 240/16=15 executors.

Regard to spark.mesos.mesosExecutor.cores, it only works for fine-grained mode. In fine-grained mode, Spark will launch one executor (org.apache.spark.executor.MesosExecutorBackend) per host. The executor consumes the number of cores of spark.mesos.mesosExecutor.cores even though there is no task. Each task will consume another number of cores of spark.task.cpus.

Concerning 1)

This is my understanding as well. A Mesos Task is actually a Spark Executor (task).

Concerning 2)

From my understanding, you should be able to use the spark.mesos.mesosExecutor.cores configuration property:

(Fine-grained mode only) Number of cores to give each Mesos executor. This does not include the cores used to run the Spark tasks. In other words, even if no Spark task is being run, each Mesos executor will occupy the number of cores configured here. The value can be a floating point number.

See

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!