Irrespective of the spark executor core count, yarn container for the executor does not use more than 1 core.
Asked
Active
Viewed 2,466 times
6
-
Can you post a working example? – Justin Pihony Oct 20 '15 at 23:11
-
Here is the spark configuration: – Santosh Kumar Oct 20 '15 at 23:55
-
Here is the spark configuration: spark.executor.cores=2 and spark.executor.instances=5. Number of executors started in yarn is 5 but each of them only uses 1 core. Spark properties in driver UI does show executor core as 2 but in Yarn UI, it shows using 1 core per container(executor). – Santosh Kumar Oct 21 '15 at 00:00
1 Answers
10
YARN is showing 1 core per executor irrespective of spark.executor.cores
because by default DefaultResourceCalculator is used. It considers only memory.
public int computeAvailableContainers(Resource available, Resource required) {
// Only consider memory
return available.getMemory() / required.getMemory();
}
Use DominantResourceCalculator, It uses both cpu and memory.
Set below config in capacity-scheduler.xml
yarn.scheduler.capacity.resource-calculator=org.apache.hadoop.yarn.util.resource.DominantResourceCalculator
More about DominantResourceCalculator

banjara
- 3,800
- 3
- 38
- 61