On this page
Configuration file
By default, Redistill loads redistill.toml from the current working directory.
You can override this with the REDISTILL_CONFIG environment variable:
REDISTILL_CONFIG=/etc/redistill.toml ./redistill
Default configuration (simplified):
[server]
bind = "127.0.0.1"
port = 6379
num_shards = 256
batch_size = 16
buffer_size = 16384
buffer_pool_size = 1024
max_connections = 10000
connection_timeout = 300
connection_rate_limit = 0
health_check_port = 0
[security]
password = ""
tls_enabled = false
tls_cert_path = ""
tls_key_path = ""
[memory]
max_memory = 0
eviction_policy = "allkeys-lru"
eviction_sample_size = 5
[logging]
level = "info"
format = "text"
[performance]
tcp_nodelay = true
tcp_keepalive = 60
[persistence]
enabled = false
snapshot_path = "redistill.rdb"
snapshot_interval = 300
save_on_shutdown = true
Configuration sections
[server]
- bind – interface to bind (e.g.
"127.0.0.1","0.0.0.0"). - port – Redis TCP port (default: 6379).
- num_shards – number of internal shards for the in-memory store; powers of two recommended.
- batch_size – commands batched before flushing to the network.
- buffer_size – per-connection buffer size in bytes.
- buffer_pool_size – number of pre-allocated buffers.
- max_connections – maximum concurrent connections (0 = unlimited).
- connection_timeout – idle connection timeout in seconds (0 = no timeout).
- connection_rate_limit – maximum new connections per second (0 = unlimited).
- health_check_port – HTTP health endpoint port (0 = disabled).
[security]
- password – password required for
AUTH(empty = no authentication). - tls_enabled – enable TLS/SSL using Rustls.
- tls_cert_path, tls_key_path – certificate and key files in PEM format.
[memory]
- max_memory – maximum memory usage in bytes (0 = unlimited).
- eviction_policy –
allkeys-lru,allkeys-random,allkeys-s3fifo, ornoeviction. - eviction_sample_size – number of keys sampled when choosing eviction candidates.
[logging]
- level –
error,warn,info,debug,trace. - format –
textorjson.
[performance]
- tcp_nodelay – disable Nagle's algorithm for lower latency.
- tcp_keepalive – TCP keepalive interval in seconds (0 = disabled).
[persistence]
- enabled – enable snapshot-based persistence (default:
false). - snapshot_path – path to snapshot file (e.g.
"redistill.rdb"). - snapshot_interval – auto-save interval in seconds (0 = disabled).
- save_on_shutdown – save snapshot on graceful shutdown.
Environment variables
Environment variables override redistill.toml settings. Common ones include:
| Variable | Overrides | Example |
|---|---|---|
REDISTILL_CONFIG |
Config file path | REDISTILL_CONFIG=/etc/redistill.toml |
REDIS_PASSWORD |
security.password |
REDIS_PASSWORD=secret |
REDIS_PORT |
server.port |
REDIS_PORT=6380 |
REDIS_BIND |
server.bind |
REDIS_BIND=0.0.0.0 |
REDIS_MAX_MEMORY |
memory.max_memory |
REDIS_MAX_MEMORY=2147483648 |
REDIS_EVICTION_POLICY |
memory.eviction_policy |
REDIS_EVICTION_POLICY=allkeys-lru |
REDIS_PERSISTENCE_ENABLED |
persistence.enabled |
REDIS_PERSISTENCE_ENABLED=true |
Example configurations
Production high-performance
[server]
bind = "0.0.0.0"
port = 6379
num_shards = 512
batch_size = 32
max_connections = 50000
connection_rate_limit = 5000
health_check_port = 8080
[security]
password = "your_secure_password"
tls_enabled = true
tls_cert_path = "/etc/letsencrypt/live/domain.com/fullchain.pem"
tls_key_path = "/etc/letsencrypt/live/domain.com/privkey.pem"
[memory]
max_memory = 8589934592 # 8GB
eviction_policy = "allkeys-lru"
[performance]
tcp_nodelay = true
tcp_keepalive = 120
[persistence]
enabled = true
snapshot_path = "/data/redistill.rdb"
snapshot_interval = 300
save_on_shutdown = true
Development
[server]
bind = "127.0.0.1"
port = 6379
num_shards = 64
[security]
password = "" # no auth for local dev
[memory]
max_memory = 1073741824 # 1GB
[logging]
level = "debug"
Tuning highlights
- num_shards – increase for high concurrency (2048+), decrease to save memory.
- batch_size – smaller for low-latency interactive workloads, larger (matching pipeline depth) for throughput.
- max_memory – set to ~75–80% of host RAM after accounting for OS and other processes.
- eviction_policy –
allkeys-lrufor general caches,noevictionwhen you prefer errors over eviction.
Troubleshooting
- Port in use – adjust
server.portor free the existing port. - Invalid bind address – confirm you are using a valid IP/hostname.
- TLS failures – check
tls_cert_pathandtls_key_pathand verify they are readable. - High memory usage – ensure
max_memoryand an eviction policy are set; monitor viaINFO.