Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/kitchen-sink/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions examples/kitchen-sink/src/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ import {
isDev,
} from "@/utils/env-vars";
import { EnvoyConfigSchema } from "./envoy";
import { ConfigurePoolSchema, ServerlessConfigSchema } from "./serverless";
import {
ConfigurePoolSchema,
DEFAULT_SERVERLESS_MAX_START_PAYLOAD_BYTES,
ServerlessConfigSchema,
} from "./serverless";

export const ActorsSchema = z.record(
z.string(),
Expand Down Expand Up @@ -505,7 +509,7 @@ export const DocServerlessConfigSchema = z
.number()
.optional()
.describe(
"Maximum POST /start body size in bytes. Default: 1048576",
`Maximum POST /start body size in bytes. Default: ${DEFAULT_SERVERLESS_MAX_START_PAYLOAD_BYTES}`,
),
publicEndpoint: z
.string()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { z } from "zod/v4";
import { getRivetPublicEndpoint, getRivetPublicToken } from "@/utils/env-vars";

export const DEFAULT_SERVERLESS_MAX_START_PAYLOAD_BYTES = 16 * 1024 * 1024;

export const ConfigurePoolSchema = z
.object({
name: z.string().optional(),
Expand All @@ -17,7 +19,10 @@ export const ConfigurePoolSchema = z
export const ServerlessConfigSchema = z.object({
// MARK: Routing
basePath: z.string().optional().default("/api/rivet"),
maxStartPayloadBytes: z.number().optional().default(1_048_576),
maxStartPayloadBytes: z
.number()
.optional()
.default(DEFAULT_SERVERLESS_MAX_START_PAYLOAD_BYTES),

// MARK: Public Endpoint Configuration
/**
Expand Down
2 changes: 1 addition & 1 deletion website/src/content/docs/actors/limits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ These limits apply to the [SQLite database](/docs/actors/state#sqlite-database)

### KV Preloading

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`.
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.

| Name | Soft Limit | Hard Limit | Description |
|------|------------|------------|-------------|
Expand Down
1 change: 1 addition & 0 deletions website/src/content/docs/general/production-checklist.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ We recommend passing this page to your coding agent to verify your configuration
### Serverless

- **Check platform timeouts.** Rivet handles migration between invocations automatically, but shorter timeouts increase migration frequency. See [Timeouts](/docs/general/runtime-modes#timeouts).
- **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).
- **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.

### Runner
Expand Down
Loading