Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Fairshare is a tree.  There are fairshare groups and entities (e.g., users).  A job belongs to one entity.  Each fairshare group has children which can be either another fairshare group or an entity.  All entities don't have to be at the same level.  For example, root can have 3 children which are two groups and one entity.  The two groups will have entities within them.  Each group or entity has a number of shares assigned to them.  This is a relative percentage between the siblings of that group.  The relative percentage between siblings times the parents target fairshare_perc is the entity/group's targetfairshare_perc.  The shares are turned into a fairshare target fairshare_perc which is a percentage number between 0 and 1.  If you add up all the targets fairshare_percs of all of the entities, you will reach 100%.

...

The most deserving entity is determined by walking the tree.  At each level in the tree, the most deserving group is chosen, and we descend to its children and continue on until we reach an entity.  The most deserving group/entity is a function of the target fairshare_perc and the usage.  What does this mean?  It means that low usage entities in high usage groups will be negatively affected by its sibling entities/groups.

...

The easiest way to map fairshare to the formula would be to take the actual usage and target fairshare_perc of each entity and compare them.  This doesn't work because low usage entities of high usage groups will no longer be negatively affected by its siblings.  We effectively flatten the tree.   

...

Here is a formula to provide a direct comparison between entities.  It results in a number between 0 and 1.  A result of .5 means the entity is on targetfairshare_perc.

2^-(fairshare_tree_usage / entity's fairshare_perc)

...

Share numbers do not need to add up to 100, it just makes the example easier to understand.  Entities don't need to all be at the same level of the tree.  For example, root could own an entity.

Tree:

  • Root targetfairshare_perc: 1.0 usage: 1200
    • group1 shares: 40 targetfairshare_perc: .4 actual usage: 200
      • Bob shares 50 target fairshare_perc .2 actual usage: 100
      • Cathy shares 50 target fairshare_perc .2 actual usage: 100
    • group2: shares: 60 targetfairshare_perc: .6 actual usage: 1000
      • Suzy shares 60 target fairshare_perc .36 actual usage: 0
      • Scott shares 40 target fairshare_perc .24 actual usage: 1000


Bob:

...

Even though Suzy had a higher target fairshare_perc than Bob and less usage than Bob, her fairshare formula value is quite a bit lower than his.  This is due to the huge amount of usage her group mate used. 

...