Skip to content

Commit f2471b2

Browse files
committed
update routelib docs a bit
1 parent 0fdf98b commit f2471b2

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

content/features/proxy/configure.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ Doing this involves the following steps:
408408

409409
1. Declare a _local zone_ in your proxy configuration file.
410410
1. Attach zone labels to the pools within your set definitions.
411-
1. In your route definitions, invoke a route handler that makes use of zone information. Handlers supporting this typically start with a 'z', like `route_zfailover`
411+
1. In your route definitions, invoke a route handler that makes use of zone information. Handlers supporting this are noted in their documentation (like `route_failover`)
412412

413413
To declare the local zone and attach zone labels to your defined pools, modify your configuration file's `pools{}` block like this:
414414

@@ -434,6 +434,10 @@ The following example excerpt from a proxy configuration file that declares a lo
434434

435435
```lua
436436
local_zone("west")
437+
-- This configures the zone from an environment variable:
438+
-- local_zone_from_env("ZONE")
439+
-- This configures the zone by reading a line from a file on disk:
440+
-- local_zone_from_file("./zonefile.txt")
437441

438442
pools {
439443
set_main_pools = {
@@ -474,16 +478,16 @@ pools {
474478
}
475479
```
476480

477-
The following proxy configuration excerpt extends the previous example with a `routes{}` block that uses [`route_zfailover`]({{<proxy_base_path>}}reference#route_zfailover).
481+
The following proxy configuration excerpt extends the previous example with a `routes{}` block that uses [`route_failover`]({{<proxy_base_path>}}reference#route_failover).
478482

479483
```lua
480484
routes {
481485
map = {
482-
main = route_zfailover {
486+
main = route_failover {
483487
children = "set_main_pools",
484488
},
485489
cust = cmdmap{
486-
set = route_zfailover {
490+
set = route_failover {
487491
children = "set_customer_pools",
488492
},
489493
},

content/features/proxy/reference.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ The proxy returns the first response that it receives from any pool.
4949

5050
```lua
5151
route_allfastest{
52-
children = {{<var>}}POOL_LIST_OR_SET_NAME{{</var>}}
52+
children = {{<var>}}POOL_LIST_OR_SET_NAME{{</var>}},
53+
miss = {{<var>}}MISS_BOOLEAN{{</var>}},
54+
wait = {{<var>}}WAIT_FLOAT{{</var>}},
5355
}
5456
```
5557

@@ -59,6 +61,9 @@ Replace <var>POOL_LIST_OR_SET_NAME</var> with either one of the following:
5961

6062
* The name of a set defined in the `pools{}` block of your configuration file—for example, `"set_cust_pools"`.
6163

64+
* <var>MISS_BOOLEAN</var>: if true, wait until first good (hit) response or all children return
65+
* <var>WAIT_FLOAT</var>: wait at most this amount of time in seconds before returning the best result we have so far (fractional time allowed)
66+
6267
### `route_split`
6368

6469
Routes a request to exactly two pools.
@@ -105,6 +110,8 @@ route_failover{
105110
failover_count = {{<var>}}FAILOVER_COUNT{{</var>}},
106111
shuffle = {{<var>}}SHUFFLE_BOOLEAN{{</var>}},
107112
miss = {{<var>}}MISS_BOOLEAN{{</var>}},
113+
wait = {{<var>}}WAIT_FLOAT{{</var>}},
114+
local_zone = {{<var>}}ZONE_NAME{{</var>}},
108115
}
109116
```
110117

@@ -113,12 +120,18 @@ Replace the following:
113120
* <var>POOL_LIST_OR_SET_NAME</var>: either one of the following:
114121
* A bracketed, comma-separated list of of pool names defined in the `pools{}` block of your configuration file—for example, `{ "cust_pool_1", "cust_pool_2" }`.
115122
* The name of a set defined in the `pools{}` block of your configuration file—for example, `"set_cust_pools"`.
123+
* See [Prioritize a route using local zones]({{<proxy_base_path>}}configure#zones) - if a zoned pool set is supplied and `local_zone` is configured, the local zone is tried first.
124+
* <var>LOCAL_ZONE</var>: Override the local zone.
116125
* <var>FAILOVER_COUNT</var>: the number of times we will try another pool in the list before returning an error.
117126
* <var>SHUFFLE_BOOLEAN</var>: if true, then the proxy randomizes the list of pools before routing the request. Otherwise, uses the list of pools in the given order.
118127
* <var>MISS_BOOLEAN</var>: if true, then the proxy treats both misses and errors as failures. Otherwise, the proxy counts only errors as failures.
128+
* <var>WAIT_FLOAT</var>: wait at most this amount of time in seconds before failing over to the next pool (fractional time allowed)
119129

120130
### `route_zfailover`
121131

132+
NOTE: This function has been deprecated. Its functionality is available in
133+
`route_failover` and `route_allfatest`
134+
122135
Routes the request to a named set of pools. You can tune the behavior of this handler by passing in additional arguments.
123136

124137
To use this handler, you need to define zones in your configuration file. For more information, see [Prioritize a route using local zones]({{<proxy_base_path>}}configure#zones).

0 commit comments

Comments
 (0)