2

How does Spark limit the usage of cpu cores and memory?Does it use cgroups? How about Yarn?

luchy0120
  • 55
  • 1
  • 6

2 Answers2

0

In standalone cluster Spark only manages application predefined resource configs with provided resource pool. Resource pool combined based on executors which added as salves to cluster. Yarn uses containers and resource limitation applies config of container which defines minimum and maximum core and memory allocation.

FaigB
  • 2,271
  • 1
  • 13
  • 22
0

In YARN NodeManager is monitoring spark executors' memory usage and killing them if they use above spark.executor.memory

In case of CPU, spark.executor.cores is the amount of concurrent tasks executor can run. More information on Spark Configuration Documentation

You can enable cgroups in yarn and limit CPU usage or YARN containers (spark executors).

Artur Sukhenko
  • 602
  • 3
  • 12