- Built-in defaults — sensible values for single-node deployment
- TOML config file — persistent configuration loaded from disk
- CLI arguments — runtime overrides with highest precedence
Configuration Precedence
Configuration sources are applied in order:CLI Arguments
Start Kora with command-line flags:Network Options
| Flag | Type | Default | Description |
|---|---|---|---|
--bind | string | 127.0.0.1 | Address to bind to |
--port, -p | u16 | 6379 | Port to listen on |
--unix-socket | string | none | Unix domain socket path |
Runtime Options
| Flag | Type | Default | Description |
|---|---|---|---|
--workers, -w | usize | auto | Number of shard worker threads (defaults to CPU cores) |
--log-level | string | info | Log level: trace, debug, info, warn, error |
--password | string | none | AUTH password (requirepass equivalent) |
Persistence Options
| Flag | Type | Default | Description |
|---|---|---|---|
--data-dir | string | none | Data directory for WAL, RDB, and cold storage |
--snapshot-interval-secs | u64 | none | Automatic RDB snapshot interval in seconds |
--snapshot-retain | usize | 24 | Number of timestamped snapshots to retain per shard |
Observability Options
| Flag | Type | Default | Description |
|---|---|---|---|
--metrics-port | u16 | 0 | Prometheus metrics HTTP endpoint port (0 = disabled) |
--cdc-capacity | usize | 0 | CDC ring buffer capacity per shard (0 = disabled) |
Config File
| Flag | Type | Default | Description |
|---|---|---|---|
--config, -c | path | kora.toml | Path to TOML config file |
TOML Config File
Create akora.toml file for persistent configuration:
Storage Section
The[storage] section configures persistence behavior:
| Key | Type | Default | Description |
|---|---|---|---|
data_dir | string | none | Base directory for all persistent data |
wal_sync | string | every_second | WAL sync policy (see below) |
wal_enabled | bool | true | Enable write-ahead log |
rdb_enabled | bool | true | Enable RDB snapshots |
snapshot_interval_secs | u64 | none | Automatic snapshot interval |
snapshot_retain | usize | 24 | Snapshots to keep per shard |
wal_max_bytes | u64 | 67108864 | Max WAL size before rotation (64MB) |
WAL Sync Policies
Thewal_sync option controls durability vs. performance tradeoffs:
| Policy | Description | Durability | Performance |
|---|---|---|---|
every_write | fsync after every write | Highest | Lowest |
every_second | fsync once per second (default) | Medium | High |
os_managed | No explicit fsync (OS decides) | Lowest | Highest |
every_second for most workloads. It provides good durability (1 second window) with minimal performance impact.
Configuration Examples
Minimal Config (Development)
Production Config
High-Throughput Config
Unix Socket Config
Environment Variables
Kora respects theRUST_LOG environment variable for fine-grained logging control:
log_level setting in the config file.
Built-in Defaults
When no config file exists and no CLI arguments are provided:| Setting | Default Value |
|---|---|
| Bind address | 127.0.0.1 |
| Port | 6379 |
| Workers | CPU core count |
| Log level | info |
| Persistence | Disabled |
| Password | None (no auth) |
| Metrics port | 0 (disabled) |
| CDC capacity | 0 (disabled) |
Worker Count Tuning
Theworkers option controls shard parallelism. Each worker runs an independent shard with its own data and I/O loop.
Guidelines:
- Default (auto): Set to
num_cpus::get()— optimal for most workloads - High core count: Match physical cores (not hyperthreads) to avoid contention
- Low memory: Reduce workers to decrease memory overhead (~2MB base per shard)
- NUMA systems: Consider pinning workers to NUMA nodes (requires OS-level tuning)
Data Directory Layout
Whendata_dir is configured, Kora creates the following structure:
Loading Config Files
Kora looks for the config file in this order:- Path specified by
--configflag kora.tomlin the current working directory- If neither exists, use built-in defaults
Validation
Kora validates configuration on startup and exits with an error if:- Port is already in use
- Data directory is not writable
- Invalid
wal_syncvalue - Invalid
log_levelvalue