Configuration
Rivet Engine can be configured through environment variables or configuration files.
The full JSON Schema for the configuration is available at /docs/engine-config-schema.json.
Configuration Sources
Rivet supports JSON, JSON5, JSONC, YAML, YML, and environment variable configurations.
Environment Variables
Use the RIVET__ prefix with __ as separator to configure properties in the config. For example: set the RIVET__database__postgres__url environment variable for database.postgres.url.
Configuration Paths
Configuration files are automatically discovered in platform-specific directories:
- Linux:
/etc/rivet/config.json - macOS:
/Library/Application Support/rivet/config.json - Windows:
C:\ProgramData\rivet\config.json
Multiple Files
Multiple configuration files in the same directory are loaded and merged together. For example: /etc/rivet/config.json and /etc/rivet/database.json will be merged together.
Override Configuration Path
You can override the default configuration path using the --config flag:
Configuration Reference
Configuration for the private API service.
Configuration for the public API service.
Flag to respect the X-Forwarded-For header for client IP addresses. Will be ignored in favor of CF-Connecting-IP if DNS provider is configured as Cloudflare.
Flag to enable verbose error reporting.
Configuration for the cache layer.
URL to the HTTP access port for ClickHouse.
URL to the native access port for ClickHouse.
Host for HTTP traffic
Port for HTTP traffic
Configuration for the metrics service.
How long to wait after creating and not receiving a starting state before setting actor as lost. Unit is in milliseconds. **Experimental**
How long to wait after stopping and not receiving a stop state before setting actor as lost. Unit is in milliseconds. **Experimental**
Time to delay an actor from rescheduling after a rescheduling failure. Unit is in milliseconds. **Experimental**
How long after last ping before considering a hibernating request disconnected. Unit is in milliseconds. **Experimental**
Global pool desired max.
Maximum exponent for the reschedule backoff calculation. This controls the maximum backoff duration when rescheduling actors. **Experimental**
How long an actor goes without retries before it's retry count is reset to 0, effectively resetting its backoff to 0. Unit is in milliseconds. **Experimental**
How long after last ping before considering a runner ineligible for allocation. Unit is in milliseconds. **Experimental**
How long to wait after last ping before forcibly removing a runner from the database and deleting its workflow, evicting all actors. Note that the runner may still be running and can reconnect. Unit is in milliseconds. **Experimental**
Number of consecutive successes required to clear an active runner pool error. This prevents a single success from clearing an error during flapping conditions. Higher values provide more stability but slower recovery from transient errors. **Experimental**
Maximum exponent for the serverless backoff calculation. This controls the maximum backoff duration when serverlessly connecting to runners. **Experimental**
Time to delay a serverless runner from attempting a new outbound connection after a connection failure. Unit is in milliseconds. **Experimental**
How long a serverless runner goes without connection failures before it's retry count is reset to 0, effectively resetting its backoff to 0. Unit is in milliseconds. **Experimental**
Whether or not to allow running the engine when the previous version that was run is higher than the current version.
Time (in seconds) to allow for guard to wait for pending requests after receiving SIGTERM. Defaults to 1 hour.
Adjusts worker curve around this value (in millicores, i.e. 1000 = 1 core). Is not a hard limit. When unset, uses /sys/fs/cgroup/cpu.max, and if that is unset uses total host cpu.
Time (in seconds) to allow for the gasoline worker engine to stop gracefully after receiving SIGTERM. Defaults to 30 seconds.
Must be included in `datacenters`
List of all datacenters, including this datacenter.
URL of the api-peer service
URL of the guard service that other datacenters can access privately. Goes to the same place as
Public origin that can be used to connect to this region.
List of hosts that are valid to connect to this region with. This is used in regional endpoints to validate that incoming requests to this datacenter are going to a region-specific domain. IMPORTANT: Do not use a global origin that routes to multiple different regions. This will cause unpredictable behavior when requests are expected to go to a specific region.
Path to the client certificate file Used for client certificate authentication Equivalent to PostgreSQL's `sslcert` parameter
Path to the client private key file Used for client certificate authentication Equivalent to PostgreSQL's `sslkey` parameter
Path to the root certificate file for verifying the server's certificate Required when using custom certificate authorities (e.g., Supabase) Equivalent to PostgreSQL's `sslrootcert` parameter
UNSTABLE: Disable lock timeout customization When `false` (default), the driver sets `lock_timeout = '0'` and `deadlock_timeout = '10ms'` during transaction commits to optimize conflict detection. When `true`, these settings are NOT applied, which may be necessary for some PostgreSQL configurations or hosted services that don't support these settings. **This is an unstable feature and may change or be removed in future versions.**
Related
- PostgreSQL: Configure PostgreSQL for production
- File System: Configure file system storage for development