Skip to content

Commit 5c8b0a2

Browse files
committed
docs(rivetkit): raise serverless start payload limit
1 parent 0e3a03e commit 5c8b0a2

6 files changed

Lines changed: 21 additions & 4 deletions

File tree

examples/kitchen-sink/package.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/kitchen-sink/src/index.ts

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rivetkit-typescript/packages/rivetkit/src/registry/config/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ import {
2525
isDev,
2626
} from "@/utils/env-vars";
2727
import { EnvoyConfigSchema } from "./envoy";
28-
import { ConfigurePoolSchema, ServerlessConfigSchema } from "./serverless";
28+
import {
29+
ConfigurePoolSchema,
30+
DEFAULT_SERVERLESS_MAX_START_PAYLOAD_BYTES,
31+
ServerlessConfigSchema,
32+
} from "./serverless";
2933

3034
export const ActorsSchema = z.record(
3135
z.string(),
@@ -505,7 +509,7 @@ export const DocServerlessConfigSchema = z
505509
.number()
506510
.optional()
507511
.describe(
508-
"Maximum POST /start body size in bytes. Default: 1048576",
512+
`Maximum POST /start body size in bytes. Default: ${DEFAULT_SERVERLESS_MAX_START_PAYLOAD_BYTES}`,
509513
),
510514
publicEndpoint: z
511515
.string()

rivetkit-typescript/packages/rivetkit/src/registry/config/serverless.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { z } from "zod/v4";
22
import { getRivetPublicEndpoint, getRivetPublicToken } from "@/utils/env-vars";
33

4+
export const DEFAULT_SERVERLESS_MAX_START_PAYLOAD_BYTES = 16 * 1024 * 1024;
5+
46
export const ConfigurePoolSchema = z
57
.object({
68
name: z.string().optional(),
@@ -17,7 +19,10 @@ export const ConfigurePoolSchema = z
1719
export const ServerlessConfigSchema = z.object({
1820
// MARK: Routing
1921
basePath: z.string().optional().default("/api/rivet"),
20-
maxStartPayloadBytes: z.number().optional().default(1_048_576),
22+
maxStartPayloadBytes: z
23+
.number()
24+
.optional()
25+
.default(DEFAULT_SERVERLESS_MAX_START_PAYLOAD_BYTES),
2126

2227
// MARK: Public Endpoint Configuration
2328
/**

website/src/content/docs/actors/limits.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ These limits apply to the [SQLite database](/docs/actors/state#sqlite-database)
9393

9494
### KV Preloading
9595

96-
When an actor starts, the engine can pre-fetch KV data declared in the actor name metadata and deliver it alongside the start command. This removes round-trips to storage during actor startup. RivetKit emits the preload manifest from its own key layout and exposes per-actor overrides via `options`. Operators can still enforce a global cap in the [engine config](/docs/self-hosting/configuration) with `pegboard.preload_max_total_bytes`.
96+
When an actor starts, the engine can pre-fetch KV data declared in the actor name metadata and deliver it alongside the start command. This removes round-trips to storage during actor startup. RivetKit emits the preload manifest from its own key layout and exposes per-actor overrides via `options`. Operators can still enforce a global cap in the [engine config](/docs/self-hosting/configuration) with `pegboard.preload_max_total_bytes`. In serverless mode, this data is serialized into the `/api/rivet/start` request body along with actor config and protocol metadata, so the accepted body size must be larger than the preload budget. RivetKit defaults `serverless.maxStartPayloadBytes` to 16 MiB to leave margin for the default 1 MiB preload budget and larger SQLite startup page preloads.
9797

9898
| Name | Soft Limit | Hard Limit | Description |
9999
|------|------------|------------|-------------|

website/src/content/docs/general/production-checklist.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ We recommend passing this page to your coding agent to verify your configuration
2121
### Serverless
2222

2323
- **Check platform timeouts.** Rivet handles migration between invocations automatically, but shorter timeouts increase migration frequency. See [Timeouts](/docs/general/runtime-modes#timeouts).
24+
- **Verify `/api/rivet/start` body size limits.** Serverless actor starts carry actor config and preloaded KV or SQLite startup data in the request body. Keep `serverless.maxStartPayloadBytes` and your platform or proxy body limit at **16 MiB or higher**, or lower the preload budget if your platform cannot accept that size. See [Limits](/docs/actors/limits#kv-preloading).
2425
- **Configure max runners.** Go to Settings > Providers > Edit Provider > Max Runners to set the limit. The default is 100,000 runners. This is effectively your max actor count.
2526

2627
### Runner

0 commit comments

Comments
 (0)