How resource reclaim works based on share ratio
When resource reclaim based on share ratio is enabled, resources are reclaimed according to share ratio across the entire consumer tree.
Scenario: Three Consumers, 18 slots
Let us use the same example that is used for when the feature is not enabled.
Total share pool: 18 slots
There are three consumers: A, B, C. There are no sub-consumers.
The lowest priority consumer is consumer B.
The share ratio is equal for all consumers (1:1:1).
Example 1: Demand exists for all consumers
All consumers have demand for 6 slots.
Behavior is the same as when resource reclaim based on share ratio is not enabled.
Example 2: No demand for consumer C
Behavior is the same as when resource reclaim based on share ratio is not enabled.
Example 3: Demand exists again for consumer C
Building on the previous example:
Consumer A has demand for 10 slots, allocated 9 slots.
Consumer B has demand for 10 slots, allocated 9 slots.
Consumer C now has demand for 2 slots.
To determine from which consumer slots should be reclaimed, the system looks at the share ratio across the entire consumer tree. The share ratio is 1:1:1.
Scenario: sub-consumers, 100 slots
Total share pool: 100 slots
There are two first-level consumers: Consumer A and Consumer B. The share ratio is Consumer A: 1, Consumer B: 4
In Consumer B, we have leaf consumers B1 and B2. The share ratio is: Consumer B1:25, Consumer B2: 75.
Example 1: Only consumer A has demand
Example 2: B1 has demand for 500 slots
Building on the previous example, consumer A is now allocated 100 slots.
B1 now has demand for 500 slots.
Since consumer B1 has demand, consumer B is considered to have demand by the system.
The system considers the share ratio across the entire tree to reclaim slots. Consumer A’s ratio is 1, consumer B’s ratio is 4, so out of 100 slots, consumer A should get 20, consumer B, 80.
80 slots are reclaimed from consumer A and allocated to consumer B. Consumer B is a first-level consumer, so its leaf consumers are considered.
Example 3: All consumers have demand for slots, B2 has demand for 100 slots
Building on the previous example, consumer A now has no demand. Consumer B1 has demand for 500 and is allocated 100 slots.
B2 now has demand for 100 slots.
As a result, slots need to be reclaimed. The system evaluates the share ratio of the entire consumer tree. There is demand across all consumers.