I am building a Spark App, in which I submit several jobs (pyspark). I am using threads to run them in parallel, and also I am setting: conf.set("spark.scheduler.mode", "FAIR")
Still, I see the jobs run serially in FIFO way. Am I missing something?
EDIT: After writing to the Spark Mailing List, I got a couple of things more:
- Spark's FairSchedulingAlgorithm is not round robin: https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/scheduler/SchedulingAlgorithm.scala#L43
- There is no preemption, that means even using scheduler.mode 'FAIR' you cannot be sure each stage will be executed 'a bit'. The scheduling happens just when resources (core) are available.
I was totally missing this last point