Skip to content

Commit 0ff6412

Browse files
author
Brice Fallon-Freeman
authored
Merge pull request openshift#5816 from pecameron/bz1477685
Router - changes to A/B weights discussion
2 parents 131fcbd + 591a32b commit 0ff6412

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)