How jobs are assigned to executors in Spark Streaming?

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.

Leave a Comment