Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spark executor on yarn-client does not take executor core count configuration.

Irrespective of the spark executor core count, yarn container for the executor does not use more than 1 core.

like image 966
Santosh Kumar Avatar asked Oct 20 '15 22:10

Santosh Kumar


1 Answers

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

like image 75
banjara Avatar answered Oct 24 '22 05:10

banjara