Example: Convert weights of Fair Scheduler queues

An example of how weights can be converted into Capacity Scheduler's queue capacity (percentage relative to its parents).

Table 1. Weight conversion example

Queue Path

Weight

Capacity Scheduler equivalent (capacity)

yarn.scheduler.capacity.<queue-path>.capacity

root 1 100%
root.default 10 25%
root.users 30 75%
root.users.alice 1 33.333%
root.users.bob 1 33.333%
root.users.charlie 1 33.334%

The fs2cs conversion utility ensures that all percentages of direct children under one parent queue add up exactly to 100.000%, as it is demonstrated in the table. For example, all queues under root.users: root.users.alice + root.users.bob + root.users.charlie = 100.000%.

Weights are converted into percentage-based capacities the following way: On queue-level root, there are 2 queues: default and users. Since we specified 10 + 30 weights (40 altogether), 1 “unit of weight” is 2.5%. This is why root.default has 25% and root.users has 75% of the capacity. This calculation can be applied to all queue-levels.