Walrus provides flexible configuration through command-line flags and environment variables. This guide covers all available configuration options for both distributed and standalone deployments.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nubskr/walrus/llms.txt
Use this file to discover all available pages before exploring further.
Distributed Walrus Configuration
CLI Flags
When running a distributed Walrus node, use these command-line flags to configure the cluster:| Flag | Default | Description |
|---|---|---|
--node-id | (required) | Unique node identifier (integer) |
--data-dir | ./data | Root directory for storage |
--raft-port | 6000 | Raft/Internal RPC port |
--raft-host | 127.0.0.1 | Raft bind address |
--raft-advertise-host | (raft-host) | Advertised Raft address for peer discovery |
--client-port | 8080 | Client TCP port |
--client-host | 127.0.0.1 | Client bind address |
--join | - | Address of existing node to join (e.g., 127.0.0.1:6001) |
--initial-peer | - | List of initial peer addresses for bootstrapping leader |
--log-file | - | Optional file path for log output (defaults to stdout) |
Starting a 3-Node Cluster
The first node (
node-id 1) without a --join flag automatically becomes the bootstrap leader. All subsequent nodes must use --join to connect to an existing cluster member.Docker Deployment
When running Walrus in Docker containers, bind to0.0.0.0 and use advertised addresses:
Docker Example
Environment Variables
Configure runtime behavior with these environment variables:Segment Configuration
Number of entries before automatic segment rollover. Higher values reduce rollover frequency but increase segment size.
Monitor loop interval in milliseconds. Controls how frequently the system checks for segment rollover conditions.
Storage Backend Configuration
Disable io_uring backend on Linux and use mmap instead. Set to any value to disable io_uring.
Base directory for WAL storage files (standalone library usage).
Namespace isolation key for standalone library usage. Creates a subdirectory under
WALRUS_DATA_DIR.Logging Configuration
Log level for the application. Valid values:
trace, debug, info, warn, error.Suppress debug output from the storage layer. Set to any value to enable quiet mode.
Storage Engine Configuration
When using Walrus as a standalone library, configure these parameters via the API:Consistency Models
Fsync Scheduling
Storage Layout
Walrus organizes data in the following directory structure:File Characteristics
- WAL Files: Pre-allocated to 1GB (100 × 10MB blocks)
- Naming: Millisecond timestamp (monotonically increasing)
- Block Size: 10MB logical segments
- Entry Format: 64-byte metadata prefix + payload + FNV-1a checksum
Configuration Best Practices
Production Deployment
Production Deployment
- Use at least 3 nodes for fault tolerance
- Set
WALRUS_MAX_SEGMENT_ENTRIESbased on your write rate and rollover frequency needs - Keep default
WALRUS_MONITOR_CHECK_MS(10s) unless you need faster rollover detection - Use
--log-filefor persistent logging in production - Mount
--data-diron a fast SSD with adequate space
High-Throughput Workloads
High-Throughput Workloads
- Ensure io_uring is enabled (default on Linux)
- Use
FsyncSchedule::Milliseconds(500)or higher for write-heavy workloads - Consider
ReadConsistency::AtLeastOncewithpersist_every: 10000for maximum read throughput - Increase
WALRUS_MAX_SEGMENT_ENTRIESto reduce rollover overhead
Development and Testing
Development and Testing
- Single node is sufficient for local development
- Use
RUST_LOG=debugfor detailed logs - Smaller
WALRUS_MAX_SEGMENT_ENTRIES(e.g., 10000) for faster rollover testing - Set
WALRUS_MONITOR_CHECK_MS=1000for rapid rollover during tests
Configuration Validation
On startup, Walrus validates configuration and logs warnings for potential issues:If all components start successfully, your configuration is valid. Check logs for any
ERROR or WARN messages.Next Steps
Monitoring
Learn how to monitor cluster health and metrics
Performance Tuning
Optimize Walrus for your workload