330 likes | 426 Views
CPU scheduling and enforcement. (screenshots of live demo). Andrew Ferguson July 10, 2012. Cores in the web GUI. Cores in the web GUI. Cores in the web GUI. Unfair sharing. S tart four threads spinning. Unfair sharing. S tart four threads spinning. Then, a second 16 threads spinning.
E N D
CPU scheduling and enforcement (screenshots of live demo) Andrew Ferguson July 10, 2012
Unfair sharing Start four threads spinning
Unfair sharing Start four threads spinning Then, a second 16 threads spinning
Unfair sharing Start four threads spinning Second process gets more CPU Then, a second 16 threads spinning
Let’s use Kitten! Same programs as before
Let’s use Kitten! Same programs as before Added: CPU cores request
Playing with YARN Launch one application in YARN
Playing with YARN Launch one application in YARN Gets all cores, even though requested only one
Playing with YARN Launch second application, again with more threads
Playing with YARN Now CPU is shared equally! Launch second application, again with more threads
Request all the cores two cores per container x two containers = 4 cores
Request all the cores First application is running
Request all the cores First application is running Second application Is waiting
Request all the cores First application is running First application has all the cores Second application Is waiting
Pieces of YARN Node Manager Resource Manager Node Manager Application Master Node Manager
Pieces of YARN Node Manager Resource Manager Node Manager Application Master Node Manager
Pieces of YARN Node Manager Resource Manager Node Manager Application Master Node Manager
Node Manager Internals Node Manager Launched by ContainerExecutor
Node Manager Internals Node Manager Monitors memory usage, and kills tasks over limit Reports killed or failed tasks back to ResourceManager Deletes temporary files created by executor Containers Monitor Launched by ContainerExecutor
Node Manager Internals Node Manager Monitors memory usage, and kills tasks over limit Reports killed or failed tasks back to ResourceManager Deletes temporary files created by executor Containers Monitor Launched by ContainerExecutor Made pluggable, like executor, in MAPREDUCE-4351
Node Manager Internals CgroupsCM in MAPREDUCE-4334 Node Manager Creates Cgroup for container, places processes in it Reports killed or failed tasks back to ResourceManager Deletes temporary files created by executor Deletes Cgroup when finished Containers Monitor Launched by ContainerExecutor
Cgroups hierarchy Controller cpu memory (find by reading mount table) $ sudo mount -t cgroup -o memory none /cgroups/mem
Cgroups hierarchy Controller cpu memory (find by reading mount table) . . . hadoop-yarn . . . hadoop-yarn Top of Hierarchy yarn.nodemanager. cgroups.path $ sudocgcreate -a hadoop_user_name -g memory:hadoop-yarn
Cgroups hierarchy Controller cpu memory (find by reading mount table) . . . hadoop-yarn . . . hadoop-yarn Top of Hierarchy yarn.nodemanager. cgroups.path . . . . . . container_..._001 container_..._002 container_..._003 container_..._001 container_..._002 container_..._003
Container Cgroup CPU process from before Isolated CPU cgroup