You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a distribution policy, we specify one of the following distribution modes to define the strategy to use when distributing jobs to workers:
20
20
21
-
## Round Robin Mode
21
+
## Round robin mode
22
22
Jobs will be distributed in a circular fashion such that each available worker will receive jobs in sequence.
23
23
24
-
## Longest Idle Mode
24
+
## Longest idle mode
25
25
Jobs will be distributed to the worker that is least utilized first. If there's a tie, we'll pick the worker that has been available for the longer time. Utilization is calculated as a `Load Ratio` by the following algorithm:
26
26
27
27
Load Ratio = Aggregate of capacity consumed by all jobs assigned to the worker / Total capacity of the worker
@@ -53,19 +53,18 @@ TotalCapacity = 3
53
53
ConsumedScore = 0 (Currently idle)
54
54
LoadRatio = 0 / 4 = 0
55
55
LastAvailable: 2 min ago
56
-
```
57
-
Workers would be matched in order: D, C, A, B
58
56
59
-
Explanation:
57
+
Workers would be matched in order: D, C, A, B
58
+
```
60
59
61
60
Worker D has the lowest load ratio (0), so Worker D will be offered the job first. Workers A and C are tied with the same load ratio (0.6). However, Worker C has been available for a longer time (7 minutes ago) than Worker A (5 minutes ago), so Worker C will be matched before Worker A. Finally, Worker B will be matched last since Worker B has the highest load ratio (0.75).
62
61
63
-
## Best Worker Mode
62
+
## Best worker mode
64
63
The workers that are best able to handle the job are picked first. The logic to rank Workers can be customized, with an expression or Azure function to compare two workers by specifying a Scoring Rule. [See example][worker-scoring]
65
64
66
65
When a Scoring Rule isn't provided, this distribution mode will use the default scoring method instead, which evaluates workers based on how the job's labels and selectors match with the worker's labels. The algorithms are outlined below.
67
66
68
-
### Default Label Matching
67
+
### Default label matching
69
68
For calculating a score based on the job's labels, we increment the `Match Score` by 1 for every worker label that matches a corresponding label on the job and then divide by the total number of labels on the job. Therefore, the more labels that matched, the higher a worker's `Match Score`. The final `Match Score` will always be a value between 0 and 1.
70
69
71
70
##### Example
@@ -117,11 +116,11 @@ Worker C's match score = 1 (for matching english language label) / 2 (total numb
117
116
118
117
Worker A would be matched first. Next, Worker B or Worker C would be matched, depending on who was available for a longer time, since the match score is tied.
119
118
120
-
### Default Worker Selector Matching
119
+
### Default worker selector matching
121
120
In the case where the job also contains worker selectors, we'll calculate the `Match Score` based on the `LabelOperator` of that worker selector.
122
121
123
-
#### Equal/NotEqual Label Operators
124
-
If the worker selector has the `LabelOperator``Equal` or `NotEqual`, we increment the score by 1 for each job label that matches that worker selector, in a similar manner as the `Label Matching` above.
122
+
#### Equal/notEqual label operators
123
+
If the worker selector has the `LabelOperator``Equal` or `NotEqual`, we increment the score by 1 for each job label that matches that worker selector, in a similar manner as the `Label Matching` above.
125
124
126
125
##### Example
127
126
Job 2:
@@ -172,10 +171,10 @@ Worker F's match score = 1 (for segment not equal to vip) / 2 (total number of l
172
171
173
172
Worker E would be matched first. Next, Worker D or Worker F would be matched, depending on who was available for a longer time, since the match score is tied.
174
173
175
-
#### Other Label Operators
176
-
For worker selectors using operators that compare by magnitude (GreaterThan/GreaterThanEqual/LessThan/LessThanEqual), we'll increment the worker's `Match Score` by an amount calculated using the logistic function (See Fig 1). The calculation is based on how much the worker's label value exceeds the worker selector's value or a lesser amount if it doesn't exceed the worker selector's value. Therefore, the more worker selector values the worker exceeds, and the greater the degree to which it does so, the higher a worker's score will be.
174
+
#### Other label operators
175
+
For worker selectors using operators that compare by magnitude (`GreaterThan`/`GreaterThanEqual`/`LessThan`/`LessThanEqual`), we'll increment the worker's `Match Score` by an amount calculated using the logistic function (See Fig 1). The calculation is based on how much the worker's label value exceeds the worker selector's value or a lesser amount if it doesn't exceed the worker selector's value. Therefore, the more worker selector values the worker exceeds, and the greater the degree to which it does so, the higher a worker's score will be.
0 commit comments