Configuration
Environment variables to tune FyroDB for your workload.
Environment Variables
All configuration is via environment variables. Every setting has a production-ready default.
| Variable | Default | Description |
|---|---|---|
FYRODB_PORT | 8000 | TCP listening port |
FYRODB_BIND | 0.0.0.0 | Bind address |
FYRODB_WORKERS | 0 (auto) | Worker threads (0 = number of CPU cores) |
FYRODB_SHARDS | 0 (auto) | Hash map shards (0 = workers × 4, power of 2) |
FYRODB_MAX_KEYS | 1000 | Maximum live keys (admission limit) |
FYRODB_MAX_CLIENTS | 10000 | Max concurrent connections |
FYRODB_AUTH | (none) | Password for AUTH command (empty = no auth) |
FYRODB_RDB_PATH | fyrodb.rdb | Snapshot file path |
FYRODB_RDB_INTERVAL | 300 | Auto-save interval in seconds |
Examples
# Default (1K-key limit, auto workers)
docker run -p 8000:8000 rana718/fyrodb:latest
# High-capacity (10M keys, custom port)
docker run -p 6379:6379 \
-e FYRODB_PORT=6379 \
-e FYRODB_MAX_KEYS=10000000 \
rana718/fyrodb:latest
# With password authentication
docker run -p 8000:8000 \
-e FYRODB_AUTH=mysecretpassword \
rana718/fyrodb:latest
# Bind to specific interface
docker run -p 8000:8000 \
-e FYRODB_BIND=127.0.0.1 \
rana718/fyrodb:latest
# Minimal memory (100k keys)
docker run -p 8000:8000 \
-e FYRODB_MAX_KEYS=100000 \
rana718/fyrodb:latest
# Persistent data with fast snapshots (every 60s)
docker run -p 8000:8000 \
-e FYRODB_RDB_INTERVAL=60 \
-e FYRODB_RDB_PATH=/data/fyrodb.rdb \
-v fyrodb-data:/data \
rana718/fyrodb:latest
# Production setup
docker run -d \
--name fyrodb \
--restart unless-stopped \
-p 8000:8000 \
-e FYRODB_MAX_KEYS=5000000 \
-e FYRODB_MAX_CLIENTS=50000 \
-e FYRODB_AUTH=strongpassword \
-e FYRODB_RDB_PATH=/data/fyrodb.rdb \
-e FYRODB_RDB_INTERVAL=120 \
-v fyrodb-data:/data \
rana718/fyrodb:latestSizing Guide
FYRODB_MAX_KEYS— admission limit for live keys. Shards start with eight slots and grow lazily, so a high limit no longer reserves the full table at startup.FYRODB_SHARDS— more shards = less contention between threads. Default (workers × 4) is optimal for most workloads.FYRODB_WORKERS— defaults to CPU core count. Reduce if you want to leave cores for other processes.FYRODB_AUTH— set to requireAUTH passwordfrom clients before any commands are accepted.FYRODB_BIND— use127.0.0.1to restrict access to localhost only.
Memory Estimate
RSS ≈ 4MB idle base + live keys/collection capacity + payload data
Actual usage depends on key length and data type. Keys up to 15 bytes and values up to 23 bytes are inline; small collections also use compact encodings. Measure production workloads with INFO (used_memory, used_memory_rss, and mem_fragmentation_ratio).