If I want run my application with 100 cores, how can I configure number-of-executors
and executor-cores
to achieve best performance? Is 100 executors with 1 core better, or 20 executors with 5 cores better?
From this article, I know if there is too much cores running in one executor, it may exert pressure on HDFS IO. However if I use only one core per executor, where will be many executors, and bring about lots network IO because of shuffle/broadcast operations.
I am wondering how to banlance between number-of-executors
and executor-cores
. My questions are:
Is it possible that I set a constant executor core number? For example, I always take 4 cores from an 8 core machine. If I can't, what other conditions should I take into account?
However, when running Spark on YARN, Spark applications can't always get the amount of resources it requested. Given the previous example, if I choose 100 executors with 1 core, I may not get 100 executors, so maybe my application is 5 times slower. However if I choose 20 executors with 5 cores, I may get exactly 20 executors, so my application may run faster. How can we choose proper
number-of-executors
andexecutor-cores
then?