Skip to content

Commit 68d51c4

Browse files
pecameronbrice
authored and
brice
committed
[online-3.7] Router - changes to A/B weights discussion
Bug: 1477685 https://bugzilla.redhat.com/show_bug.cgi?id=1477685 Trello: BhWCH3vu https://trello.com/c/BhWCH3vu/543-3-fix-problem-in-a-b-weight-algorithm (cherry picked from commit 591a32b) xref:openshift#5816
1 parent 514bfb7 commit 68d51c4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

architecture/topics/alternate_backends_weights.adoc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,23 @@ A route is usually associated with one service through the `to:` token with
33
the service based on the xref:load-balancing[load balancing strategy].
44

55
It is possible to have as many as four services supporting the route. The
6-
portion of requests that are handled by each service is governed by the service
6+
portion of requests that are handled by each service is governed by the service
77
`weight`.
88

99
The first service is entered using the `to:` token as before, and up to three
1010
additional services can be entered using the `alternateBackend:` token. Each
1111
service must be `kind: Service` which is the default.
1212

13-
Each service can have a `weight` associated with it. The portion of requests
13+
Each service has a `weight` associated with it. The portion of requests
1414
handled by the service is `weight` / `sum_of_all_weights`. When a service has
1515
more than one endpoint, the service's weight is distributed among the endpoints
1616
with each endpoint getting at least 1. If the service `weight` is 0 each
17-
endpoint will get 0.
17+
of the service's endpoints will get 0.
1818

1919
The `weight` must be in the range 0-256. The default is 1. When the `weight` is
2020
0 no requests are passed to the service. If all services have `weight` 0,
21-
requests are returned with a 503 error.
21+
requests are returned with a 503 error. When a sevice has no endpoints, the weight
22+
is effectively 0.
2223

2324
When using `alternateBackends` also use the `roundrobin`
2425
xref:load-balancing[load balancing strategy] to ensure requests are distributed
@@ -59,4 +60,5 @@ spec:
5960
<2> The first service name is `service-name` which may have 0 or more pods
6061
<3> The alternateBackend services may also have 0 or more pods
6162
<4> The total `weight` is 40. `service-name` will get 20/40 or 1/2 of the requests,
62-
`service-name2` and `service-name3` will each get 1/4 of the requests.
63+
`service-name2` and `service-name3` will each get 1/4 of the requests, assuming each
64+
service has 1 or more endpoints.

0 commit comments

Comments
 (0)