How jobs are assigned to executors in Spark Streaming?

孤者浪人 提交于 2019-12-17 16:33:11

问题


Let's say I've got 2 or more executors in a Spark Streaming application.

I've set the batch time of 10 seconds, so a job is started every 10 seconds reading input from my HDFS.

If the every job lasts for more than 10 seconds, the new job that is started is assigned to a free executor right?

Even if the previous one didn't finish?

I know it seems like a obvious answer but I haven't found anything about job scheduling in the website or on the paper related to Spark Streaming.

If you know some links where all of those things are explained, I would really appreciate to see them.

Thank you.


回答1:


Actually, in the current implementation of Spark Streaming and under default configuration, only job is active (i.e. under execution) at any point of time. So if one batch's processing takes longer than 10 seconds, then then next batch's jobs will stay queued.

This can be changed with an experimental Spark property "spark.streaming.concurrentJobs" which is by default set to 1. Its not currently documented (maybe I should add it).

The reason it is set to 1 is that concurrent jobs can potentially lead to weird sharing of resources and which can make it hard to debug the whether there is sufficient resources in the system to process the ingested data fast enough. With only 1 job running at a time, it is easy to see that if batch processing time < batch interval, then the system will be stable. Granted that this may not be the most efficient use of resources under certain conditions. We definitely hope to improve this in the future.

There is a little bit of material regarding the internals of Spark Streaming in this meetup slides (sorry, about the shameless self advertising :) ). That may be useful to you.



来源:https://stackoverflow.com/questions/23528006/how-jobs-are-assigned-to-executors-in-spark-streaming

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