Enable preemption for YARN workflow queues
With Preemption enabled, under-served queues can begin to claim their allocated cluster resources almost immediately, without having to wait for other queues' applications to finish running.
In Ambari Web, browse to . In YARN Features, click
The button label changes to indicate that Preemption is enabled.
Browse and scroll to Add Property and use the Add
Property pop-up to add a new property in the following format:
yarn.resourcemanager.monitor.capacity.preemption.total_preemption_per_round=<(memory-of-one-NodeManager)/(total-cluster-memory)>This is the maximum percentage of resources preempted in a single round. You can use this value to restrict the pace at which Containers are reclaimed from the cluster. After computing the total desired preemption, the policy scales it back to this limit. This should be set to (memory-of-one-NodeManager)/(total-cluster-memory). For example, if one NodeManager has 32 GB, and the total cluster resource is 100 GB, the total_preemption_per_round should set to 32/100 = 0.32. The default value is 0.1 (10%):
Click Add Property again and use the Add Property pop-up to
add the following Custom yarn-site property:
yarn.resourcemanager.monitor.capacity.preemption.natural_termination_factor=1.0Similar to total_preemption_per_round, you can apply this factor to slow down resource preemption after the preemption target is computed for each queue (for example, “give me 5 GB back from queue-A”). For example, if 5 GB is needed back, in the first cycle preemption takes back 1 GB (20% of 5GB), 0.8 GB (20% of the remaining 4 GB) in the next, 0.64 GB (20% of the remaining 3.2 GB) next, and so on. You can increase this value to speed up resource reclamation. The recommended value for this parameter is 1.0, meaning that 100% of the target capacity is preempted in a cycle.
Click Save to save the new configuration settings. On the
Save Configuration pop-up, type a description of the
changes in the Notes box, then click
On the Dependent Configurations pop-up, click
OK to accept the recommended value of
Click OK on the Save Configuration
to restart the YARN service and load the new configuration.
- Click Confirm Restart All on the confirmation pop-up to confirm the YARN
For more information about Preemption, see Better SLAS Via Resource Preemption in the YARN Capacity Scheduler.