Skip to content

Commit aa0d02c

Browse files
committed
Add size limit for route options to RFC-0027
Add a new Size Limits section specifying that Cloud Controller must enforce a configurable maximum size (default: 1 KB) for route options to prevent excessive NATS bandwidth consumption. - Default limit: 1024 bytes - Configurable via cc.max_route_options_size BOSH property - CC returns HTTP 422 when limit is exceeded - Documents relationship with route emit interval for tuning This addresses feedback from the App-to-App mTLS RFC (PR #1438) where concerns were raised about NATS bandwidth impact of per-route options.
1 parent 2d2df6e commit aa0d02c

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

toc/rfc/rfc-0027-generic-per-route-features.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,36 @@ The following constraints apply (types are as specified in [RFC 8259](https://rf
3131
* The map MUST only use strings as keys.
3232
* The map MUST only use numbers, strings and the literal values `true` and `false` as values.
3333

34+
### Size Limits
35+
36+
To prevent excessive NATS bandwidth consumption, Cloud Controller MUST enforce a configurable
37+
maximum size for the serialized route options map. This limit applies to the total JSON-encoded
38+
size of the `options` field.
39+
40+
**Default limit**: 1024 bytes (1 KB)
41+
42+
**Behavior**:
43+
- Cloud Controller MUST validate the size of route options when a route is created or updated
44+
- If the serialized options exceed the configured limit, Cloud Controller MUST reject the request
45+
with an appropriate error (HTTP 422 Unprocessable Entity) and a message indicating the size
46+
limit was exceeded
47+
- The limit MUST be configurable by operators via the `cc.max_route_options_size` BOSH property
48+
49+
**Rationale**: Route registration messages are transmitted via NATS at a configurable interval
50+
(default: 20 seconds) from each app instance to each GoRouter instance. Large route options can
51+
significantly impact NATS bandwidth in deployments with many app instances. A 1 KB default
52+
accommodates most use cases (e.g., ~25 app GUIDs in an allowlist) while protecting platform
53+
stability.
54+
55+
**Operator guidance**: Operators can tune NATS bandwidth consumption for route options by
56+
adjusting two settings:
57+
- **Route options size limit**: Controls the maximum size per route (default: 1 KB)
58+
- **Route emit interval**: Controls how frequently routes are re-registered (default: 20s)
59+
60+
Operators with larger route options requirements MAY increase the size limit while also
61+
increasing the emit interval to maintain acceptable bandwidth usage, depending on their
62+
deployment characteristics.
63+
3464
### Required Changes
3565

3666
#### CLI

0 commit comments

Comments
 (0)