Skip to content

Commit 3702264

Browse files
committed
docs: Document runtime.source_rate_control and connector rate control params
Add documentation for the new runtime.source_rate_control configuration section that enables cluster-wide rate control state persistence through object storage. Update GitHub connector docs to reference the new github_concurrent_connections_limit setting (deprecating the old runtime.params.github_max_concurrent_connections). Add per-dataset rate control parameters to Databricks connector docs.
1 parent d1bf5cf commit 3702264

3 files changed

Lines changed: 51 additions & 3 deletions

File tree

website/docs/components/data-connectors/databricks/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,17 @@ The following parameters apply only when `mode` is `sql_warehouse` and control c
9191
| `statement_max_retries` | Optional. Maximum number of poll retries when waiting for async statement completion. Default: `14`. |
9292
| `disable_on_permanent_error` | Optional. When `true`, non-retryable errors (401, 403, 404) permanently disable the connector. Default: `true`. |
9393

94+
#### Rate control
95+
96+
The Databricks connector supports per-dataset rate control parameters when `mode` is `spark_connect` or `sql_warehouse`. These override [`runtime.params`](/reference/spicepod/runtime#runtimeparams) HTTP rate control defaults. When [`runtime.source_rate_control.state_location`](/reference/spicepod/runtime#runtimesource_rate_control) is configured, rate limits are coordinated across the cluster.
97+
98+
| Parameter Name | Description |
99+
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
100+
| `requests_per_second_limit` | Optional. Maximum HTTP requests per second to the Databricks endpoint. Overrides `runtime.params.http_requests_per_second_limit`. |
101+
| `requests_per_minute_limit` | Optional. Maximum HTTP requests per minute to the Databricks endpoint. Overrides `runtime.params.http_requests_per_minute_limit`. |
102+
| `rate_control_jitter_min` | Optional. Minimum random delay before HTTP requests when rate control is active. Defaults to `5ms` when a rate limit is configured. Accepts durations like `5ms`. |
103+
| `rate_control_jitter_max` | Optional. Maximum random delay before HTTP requests when rate control is active. Defaults to `10ms` when a rate limit is configured. Accepts durations like `10ms`. |
104+
94105
## Authentication
95106

96107
### Personal access token

website/docs/components/data-connectors/github/index.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,19 @@ With GitHub App Installation authentication, the connector's functionality depen
7777

7878
### Rate Limiting
7979

80-
When using multiple GitHub datasets sharing the same GitHub token or GitHub app credentials, it is possible to exceed GitHub's primary and secondary rate limits. To mitigate this, use the `github_max_concurrent_connections` runtime parameter. This connections limit applies per GitHub token and per GitHub app installation, following GitHub's rate limit policy.
80+
When using multiple GitHub datasets sharing the same GitHub token or GitHub app credentials, it is possible to exceed GitHub's primary and secondary rate limits. To mitigate this, use the `github_concurrent_connections_limit` setting under [`runtime.source_rate_control`](/reference/spicepod/runtime#runtimesource_rate_control). This connections limit applies per GitHub token and per GitHub app installation, following GitHub's rate limit policy.
81+
82+
:::warning[Deprecated]
83+
`runtime.params.github_max_concurrent_connections` is deprecated. Use `runtime.source_rate_control.github_concurrent_connections_limit` instead.
84+
:::
8185

8286
Example Configuration:
8387

8488
```yaml
8589
# ... other configuration ...
8690
runtime:
87-
params:
88-
github_max_concurrent_connections: 5 # Defaults to 10
91+
source_rate_control:
92+
github_concurrent_connections_limit: 5 # Defaults to 10
8993

9094
datasets:
9195
- from: github:github.com/spiceai/spiceai/files/v0.17.2-beta

website/docs/reference/spicepod/runtime.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,39 @@ runtime:
145145
http_requests_per_minute_limit: 200
146146
```
147147

148+
## `runtime.source_rate_control`
149+
150+
Optional. Configures how Spice limits outbound requests to upstream data sources, and optionally enables cluster-wide coordination through persisted state in object storage.
151+
152+
Without `state_location`, rate limits are local to each Spice instance. When `state_location` is set, Spice instances coordinate through object storage so that a configured limit is shared across the cluster. For example, `requests_per_second_limit: 20` means approximately 20 RPS total across all replicas, not 20 RPS per replica.
153+
154+
```yaml
155+
runtime:
156+
source_rate_control:
157+
state_location: s3://my-bucket/spice/rate-control/
158+
refresh_interval: 30s
159+
params:
160+
s3_region: us-west-2
161+
s3_key: ${ secrets:AWS_ACCESS_KEY_ID }
162+
s3_secret: ${ secrets:AWS_SECRET_ACCESS_KEY }
163+
github_concurrent_connections_limit: 10
164+
```
165+
166+
| Parameter Name | Optional | Default | Description |
167+
| ------------------------------------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
168+
| `state_location` | Yes | - | Root URI for globally persisted rate-control state (e.g. `s3://bucket/path/`). Enables cluster-wide rate control when set. Without this, limits are local to each Spice instance. |
169+
| `params` | Yes | - | Object-store authentication parameters for `state_location`. Supports the same keys as other object-store configurations (e.g. `s3_region`, `s3_key`, `s3_secret` for S3; `account`, `access_key` for Azure). Supports `${ secrets:NAME }` references. |
170+
| `refresh_interval` | Yes | `30s` | How often each instance refreshes and persists per-source rate-control state. Longer intervals reduce object-store writes but adapt more slowly to demand changes. |
171+
| `github_concurrent_connections_limit` | Yes | `10` | Maximum number of concurrent GitHub HTTP requests per authentication context. Replaces the deprecated `runtime.params.github_max_concurrent_connections`. |
172+
173+
HTTP/API rate limits are configured through [`runtime.params`](#runtimeparams) (cluster defaults) and per-dataset overrides. Precedence is:
174+
175+
```text
176+
dataset param > runtime.params.http_* default > unset
177+
```
178+
179+
When `state_location` is set, the configured RPS/RPM quota is converted into a token budget per lease window and distributed across replicas using a demand-weighted leased token-bucket model.
180+
148181
## `runtime.functions`
149182

150183
Controls whether [functions](../../features/functions) declared in the top-level `functions:` section (and `tools:` entries with `as_sql: true`) are registered with the SQL engine. Defaults to disabled.

0 commit comments

Comments
 (0)