Jelajahi Sumber

AMBARI-20821. Update default values for YARN preemption in Ambari.(vbrodetskyi)

Vitaly Brodetskyi 8 tahun lalu
induk
melakukan
6a00748819

+ 12 - 0
ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/configuration/yarn-site.xml

@@ -41,6 +41,18 @@
     </depends-on>
     <on-ambari-upgrade add="false"/>
   </property>
+  <property>
+    <name>yarn.resourcemanager.monitor.capacity.preemption.total_preemption_per_round</name>
+    <value>0.1</value>
+    <description>This option controls the pace at which containers-marked-for-preemption are actually preempted in each period.</description>
+    <on-ambari-upgrade add="false"/>
+  </property>
+  <property>
+    <name>yarn.resourcemanager.monitor.capacity.preemption.natural_termination_factor</name>
+    <value>1</value>
+    <description>Similar to total_preemption_per_round, we can apply this factor to slowdown resource preemption after preemption-target is computed for each queue.</description>
+    <on-ambari-upgrade add="false"/>
+  </property>
   <property>
     <name>yarn.timeline-service.entity-group-fs-store.app-cache-size</name>
     <value>10</value>

+ 5 - 0
ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py

@@ -190,6 +190,11 @@ class HDP26StackAdvisor(HDP25StackAdvisor):
       else:
         putYarnSiteProperty('yarn.scheduler.capacity.ordering-policy.priority-utilization.underutilized-preemption.enabled', "false")
 
+    # calculate total_preemption_per_round
+    total_preemption_per_round = str(round(max(float(1)/len(hosts['items']), 0.1),2))
+    putYarnSiteProperty('yarn.resourcemanager.monitor.capacity.preemption.total_preemption_per_round', total_preemption_per_round)
+
+
     if 'yarn-env' in services['configurations'] and 'yarn_user' in services['configurations']['yarn-env']['properties']:
       yarn_user = services['configurations']['yarn-env']['properties']['yarn_user']
     else:

+ 3 - 0
ambari-server/src/test/python/stacks/2.6/common/test_stack_advisor.py

@@ -1162,6 +1162,7 @@ class TestHDP26StackAdvisor(TestCase):
           'yarn.timeline-service.entity-group-fs-store.app-cache-size': '10',
           'yarn.scheduler.minimum-allocation-mb': '256',
           'yarn.timeline-service.entity-group-fs-store.group-id-plugin-classpath': '',
+          'yarn.resourcemanager.monitor.capacity.preemption.total_preemption_per_round': '1.0',
           'yarn.nodemanager.resource.cpu-vcores': '4',
           'yarn.scheduler.maximum-allocation-mb': '768',
           'yarn.nodemanager.linux-container-executor.group': 'hadoop',
@@ -1336,6 +1337,7 @@ class TestHDP26StackAdvisor(TestCase):
           'yarn.nodemanager.resource.memory-mb': '1280',
           'yarn.scheduler.minimum-allocation-mb': '256',
           'yarn.timeline-service.entity-group-fs-store.group-id-plugin-classpath': '',
+          'yarn.resourcemanager.monitor.capacity.preemption.total_preemption_per_round': '1.0',
           'yarn.nodemanager.resource.cpu-vcores': '4',
           'yarn.scheduler.maximum-allocation-mb': '1280',
           'yarn.nodemanager.linux-container-executor.group': 'hadoop',
@@ -1442,6 +1444,7 @@ class TestHDP26StackAdvisor(TestCase):
           'yarn.nodemanager.resource.memory-mb': '1280',
           'yarn.scheduler.minimum-allocation-mb': '256',
           'yarn.timeline-service.entity-group-fs-store.group-id-plugin-classpath': '',
+          'yarn.resourcemanager.monitor.capacity.preemption.total_preemption_per_round': '1.0',
           'yarn.nodemanager.resource.cpu-vcores': '4',
           'yarn.scheduler.maximum-allocation-mb': '1280',
           'yarn.nodemanager.linux-container-executor.group': 'hadoop',