Set User Limits

Set a minimum percentage of resources allocated to each leaf queue user.

The minimum-user-limit-percent property can be used to set the minimum percentage of resources allocated to each leaf queue user. For example, to enable equal sharing of the "services" leaf queue capacity among five users, you would set the minimum-user-limit-percent property to 20%:

To set user limits based on this example, perform the following:

  1. In Cloudera Manager, select the YARN service.
  2. Click the Configuration tab.
  3. Search for scheduler.
  4. In Capacity Scheduler Configuration Advanced Configuration Snippet (Safety Valve) field, add the following:
    Name: yarn.scheduler.capacity.root.support.services.minimum-user-limit-percent
    Value: 20

This setting determines the minimum limit that any user’s share of the queue capacity can shrink to. Irrespective of this limit, any user can come into the queue and take more than his or her allocated share if there are idle resources available.

The following table shows how the queue resources are adjusted as users submit jobs to a queue with a minimum-user-limit-percent value of 20%:



  • Queue resources are adjusted in the same manner for a single user submitting multiple jobs in succession. If no other users are requesting queue resources, the first job would receive 100% of the queue capacity. When the user submits a second job, each job receives 50% of queue capacity. When the user submits a third job, each job receives 33% of queue capacity. If a second user then submits a job, each job would receive 25% of queue capacity. When the number of jobs submitted by all users reaches a total of five, each job will receive 20% of queue capacity, and subsequent users must wait for queue capacity to free up (assuming preemption is not enabled).
  • The Capacity Scheduler also manages resources for decreasing numbers of users. As users’ applications finish running, other existing users with outstanding requirements begin to reclaim that share.
  • Note that despite this sharing among users, the FIFO application scheduling order of Capacity Scheduler does not change. This guarantees that users cannot monopolize queues by submitting new applications continuously. Applications (and thus the corresponding users) that are submitted first always get a higher priority than applications that are submitted later.

Capacity Scheduler’s leaf queues can also use the user-limit-factor property to control user resource allocations. This property denotes the fraction of queue capacity that any single user can consume up to a maximum value, regardless of whether or not there are idle resources in the cluster.

To set the maximum limit based on this example, perform the following:

  1. In Cloudera Manager, select the YARN service.
  2. Click the Configuration tab.
  3. Search for scheduler.
  4. In Capacity Scheduler Configuration Advanced Configuration Snippet (Safety Valve) field, add the following:
    Name: yarn.scheduler.capacity.root.support.user-limit-factor
    Value: 1

The default value of "1" means that any single user in the queue can at maximum only occupy the queue’s configured capacity. This prevents users in a single queue from monopolizing resources across all queues in a cluster. Setting the value to "2" would restrict the queue's users to twice the queue’s configured capacity. Setting it to a value of 0.5 would restrict any user from using resources beyond half of the queue capacity.

These settings can also be dynamically changed at run-time using yarn rmadmin - refreshQueues.