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
Copy file name to clipboardExpand all lines: docs/fault-tolerance/request-rejection.md
+70-1Lines changed: 70 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,18 +43,22 @@ When all workers exceed their configured busy thresholds, new requests receive a
43
43
44
44
### Frontend Arguments
45
45
46
-
Configure busy thresholds when starting the frontend. `--admission-control token-capacity` is required to activate the thresholds; the default (`none`) leaves them disabled.
46
+
Configure busy thresholds when starting the frontend. `--admission-control token-capacity` is required to activate the thresholds; the default (`none`) leaves them disabled. For decode-block rejection, start the frontend in KV router mode so the worker load metrics path is active.
47
47
48
48
```bash
49
49
python -m dynamo.frontend \
50
50
--admission-control token-capacity \
51
+
--router-mode kv \
51
52
--active-decode-blocks-threshold 0.85 \
53
+
--router-track-output-blocks \
52
54
--active-prefill-tokens-threshold 10000
53
55
```
54
56
55
57
| Argument | Type | Description |
56
58
|----------|------|-------------|
59
+
|`--router-mode kv`| enum | Required for decode-block rejection. Initializes the KV router worker-load plumbing that receives `active_decode_blocks` updates. Without KV mode, `--active-decode-blocks-threshold` will not produce 529s based on decode-block load. |
|`--router-track-output-blocks`| bool | Include generated output tokens in the router's active block count. Enable this for long-output workloads; otherwise only prompt/input blocks are counted and a long generation can fill KV without crossing the threshold seen by the router. |
58
62
|`--active-prefill-tokens-threshold`| int | Prefill token count threshold |
59
63
|`--active-prefill-tokens-threshold-frac`| float | Prefill token threshold as a fraction of `max_num_batched_tokens`|
60
64
|`--admission-control`|`token-capacity`\|`none`| Admission control mode. `token-capacity` applies the busy thresholds above; `none` (the default) clears them while leaving router queueing controlled by `--router-queue-threshold`. To enable busy-worker admission, you must pass `--admission-control token-capacity`|
@@ -63,6 +67,8 @@ python -m dynamo.frontend \
63
67
64
68
Thresholds can be adjusted at runtime via the `/busy_threshold` endpoint:
65
69
70
+
The API updates threshold values only. It does not enable `--admission-control token-capacity`, `--router-mode kv`, or `--router-track-output-blocks`; those must be set when the frontend starts.
71
+
66
72
#### Set Thresholds
67
73
68
74
```bash
@@ -98,6 +104,36 @@ Response:
98
104
99
105
Workers are marked as "busy" based on a dual-threshold system. A worker is considered busy when **either** threshold is exceeded.
100
106
107
+
### Decode-Block Rejection Requirements
108
+
109
+
Decode-block based rejection (`active_decode_blocks_threshold`) only works when all of these conditions are true:
110
+
111
+
1. The frontend is started with `--admission-control token-capacity`.
112
+
2. The frontend is started with `--router-mode kv`.
113
+
3. A decode-block threshold is configured (`--active-decode-blocks-threshold` or `/busy_threshold` API).
114
+
4. The frontend `KvWorkerMonitor` is receiving worker load events (`ActiveLoad`).
115
+
5. Workers are publishing `active_decode_blocks`.
116
+
6. Worker runtime config provides `kv_total_blocks` so utilization ratio can be computed.
117
+
7. For long-output workloads, `--router-track-output-blocks` is enabled so generated tokens add output blocks to the active block count.
118
+
119
+
If any prerequisite is missing, decode-block busy detection is effectively disabled for those workers. The most common production symptom is that `--active-decode-blocks-threshold` appears to be accepted but no HTTP 529 is returned when KV fills up.
120
+
121
+
Examples of missing prerequisites:
122
+
123
+
- Frontend was launched without `--router-mode kv`; the NATS/event client path used for worker load metrics is not initialized, so `active_decode_blocks` updates are not consumed and the threshold is ignored.
124
+
- Frontend cannot receive events because worker-load subscription is unavailable (for example, event transport not reachable or misconfigured).
125
+
- Workers are running in a mode/path that does not publish `active_decode_blocks` (for example, custom integrations without worker metrics publishing).
126
+
- Output-heavy traffic is served without `--router-track-output-blocks`; only prompt/input blocks are reflected in the router's active block accounting, so generated output blocks can exhaust KV before triggering decode-block rejection.
127
+
128
+
### Important: Different from `router_track_active_blocks`
129
+
130
+
`active_decode_blocks_threshold` and `router_track_active_blocks` are related to load, but they are not the same feature:
131
+
132
+
-`active_decode_blocks_threshold` drives busy/free worker classification and request rejection (HTTP 529 when all workers are busy).
133
+
-`router_track_active_blocks` controls KV router internal block bookkeeping used for routing decisions.
134
+
135
+
In disaggregated setups, prefill routing intentionally disables `router_track_active_blocks`; this does **not** disable decode-block rejection for decode workers.
136
+
101
137
### KV Cache Block Threshold
102
138
103
139
Monitors the percentage of KV cache blocks in use:
8. Verify event transport configuration between frontend and workers (`--event-plane`, NATS/ZMQ connectivity).
360
+
361
+
### Common confusion: `router_track_active_blocks`
362
+
363
+
If `active_decode_blocks_threshold` is configured but you suspect `router_track_active_blocks` is the blocker, treat that as a separate routing knob. Busy rejection depends on worker load events and threshold configuration, not on the router's internal active-block tracking flag.
364
+
296
365
## Worker-Side Request Admission
297
366
298
367
In addition to the frontend's metric-driven busy detection above, a worker can
0 commit comments