Deploy
Configuration
Nexir loads configuration at startup. Change TOML or environment variables, then restart the node; runtime CONFIG SET is not supported.
Loading and precedence
- Load a local
.envfile if present. - Load
config/default.tomlif present relative to the working directory. - Apply
NEXIR__*environment variables.
Environment variables override TOML. Existing shell variables override values from .env. Nested names use double underscores:
NEXIR__SERVER__REDIS_BIND=127.0.0.1:16379
NEXIR__SERVER__TLS__CLIENT__MODE=require
NEXIR__STORAGE__PATH=/var/lib/nexirEssential settings
| TOML field | Environment variable | Default |
|---|---|---|
server.redis_bind | NEXIR__SERVER__REDIS_BIND | 127.0.0.1:6379 |
server.grpc_bind | NEXIR__SERVER__GRPC_BIND | 127.0.0.1:50051 |
server.default_read_mode | NEXIR__SERVER__DEFAULT_READ_MODE | LINEARIZABLE |
server.enable_admin_commands | NEXIR__SERVER__ENABLE_ADMIN_COMMANDS | true |
raft.node_id | NEXIR__RAFT__NODE_ID | 1 |
storage.path | NEXIR__STORAGE__PATH | ./data/nexir |
prometheus.bind | NEXIR__PROMETHEUS__BIND | 127.0.0.1:9090 |
TLS settings
Both TLS surfaces default to disabled. require means mutual TLS and requires a certificate, matching private key, and CA bundle.
| Surface | Fields under server.tls | Environment prefix |
|---|---|---|
| RESP clients | client.mode, cert_file, key_file, ca_bundle | NEXIR__SERVER__TLS__CLIENT__* |
| Raft peers | cluster.mode, cert_file, key_file, ca_bundle | NEXIR__SERVER__TLS__CLUSTER__* |
Use separate client and cluster CA bundles. Startup rejects the same resolved CA file for both required surfaces. TLS files are read at startup; rotation requires restart.
Server resource defaults
| Field | Default | Purpose |
|---|---|---|
max_connections | 10,000 | Concurrent RESP clients |
max_inflight_commands_global | 100,000 | Unfinished commands across clients |
max_inflight_commands_per_connection | 1,000 | Per-client command budget |
max_inflight_bytes_global | 512 MiB | Global in-flight request payload budget |
max_inflight_bytes_per_connection | 64 MiB | Per-client payload budget |
max_client_buffer_bytes | 64 MiB | Unread input per socket |
max_buffered_client_bytes_global | 512 MiB | Buffered input across clients |
client_idle_timeout_secs | 300 | Idle RESP socket timeout |
max_concurrent_reads_per_connection | 16 | Concurrent reads for one client |
max_buffered_response_bytes_per_connection | 64 MiB | Queued output per client |
max_buffered_response_bytes_global | 512 MiB | Queued output globally |
Storage defaults
| Field | Default | Notes |
|---|---|---|
block_cache_size_mb | 0 (auto) | 25% of system memory, minimum 64 MiB |
write_buffer_size_mb | 128 | State DB buffer; log DB uses twice this |
max_write_buffers | 4 | Storage-engine write buffers |
enable_bloom_filters | true | Point lookup filters |
read_io_threads | 0 (auto) | Available cores clamped to 4–64 |
scan_io_threads | 0 (auto) | Available cores clamped to 2–8 |
write_io_threads | 2 | Blocking write workers |
cleanup_io_threads | 1 | Background cleanup worker |
max_read_reply_bytes | 0 → 64 MiB | Resolves to per-client response limit |
max_reader_pin_ms | 300,000 | Five-minute maximum read lifetime |
max_snapshot_files | 10,000 | Accepted snapshot file count |
max_snapshot_size_bytes | 5 GiB | Extracted snapshot cap |
max_archive_bytes | 5 GiB | Snapshot archive cap |
max_retained_snapshot_bytes | 20 GiB | Retained archive budget |
min_free_disk_bytes | 1 GiB | Snapshot free-space reserve |
Raft defaults
| Field | Default |
|---|---|
snapshot_policy_logs | 100,000 |
max_pending_write_tasks | 10,000 |
max_pending_write_bytes | 256 MiB |
max_inflight_read_barriers | 10 |
max_queued_linearizable_reads | 100,000 |
membership_preflight_timeout_ms | 3,000 |
membership_change_timeout_ms | 30,000 |
add_learner_catchup_timeout_ms | 300,000 |
transfer_leader_timeout_ms | 10,000 |
heartbeat_interval_ms | 1,000 |
election_timeout_min_ms / max_ms | 3,000 / 5,000 |
Logging
RUST_LOG controls tracing output and defaults to info. Use warn for quieter operation or debug temporarily while diagnosing a problem.
Startup validation
Nexir rejects invalid addresses and modes, zero required limits, inconsistent global/per-connection budgets, request budgets below 60 MiB, invalid I/O queue sizes, unsafe snapshot limits, invalid Raft timing relationships, and missing or mismatched TLS files. It exits with a useful startup error rather than silently altering invalid settings.