Skip to content

Configuration

Every option is available as a flag and an environment variable; flags take precedence when both are set.

FlagEnvDefaultDescription
--addrTSD_ADDR127.0.0.1:9988Binary-protocol listen address
--enable-respTSD_ENABLE_RESPfalseEnable the Redis-compatible RESP listener
--resp-addrTSD_RESP_ADDR127.0.0.1:6379RESP listen address
--max-msg-sizeTSD_MAX_MSG_SIZE16MiBPer-message size limit
--max-mem-bytesTSD_MAX_MEM_BYTES0 (unlimited)Total engine memory ceiling
--evict-intervalTSD_EVICT_INTERVAL1sChronometer tick interval (0 disables active eviction)
--evict-slotsTSD_EVICT_SLOTS256Timing-wheel slot count
--enable-encryptionTSD_ENABLE_ENCRYPTIONfalseEnable ChaCha20-Poly1305 at-rest encryption
--encryption-keyTSD_ENCRYPTION_KEY(none)32-byte key (required when encryption is on)
--tls-certTELLSTONE_TLS_CERT(none)Path to TLS certificate (enables TLS when set)
--tls-keyTELLSTONE_TLS_KEY(none)Path to TLS private key
--tls-caTELLSTONE_TLS_CA(none)Path to CA certificate (enables mTLS when set)
--enable-metricsTSD_ENABLE_METRICSfalseEnable the Prometheus exporter
--metrics-addrTSD_METRICS_ADDR:9100Prometheus exporter address (/metrics)
--trace-ratioTSD_TRACE_RATIO0.0OpenTelemetry sample ratio (0 disables)
--enable-persistenceTSD_ENABLE_PERSISTENCEfalseEnable per-shard WAL for crash recovery
--persistence-dirTSD_PERSISTENCE_DIR(platform-specific)Directory for WAL data files (~/.local/share/tellstone/data on Linux)
--num-shardsTSD_NUM_SHARDSGOMAXPROCSNumber of shared-nothing shards (one goroutine + one lock-free map per shard)
--shutdown-timeoutTSD_SHUTDOWN_TIMEOUT10sMax time to wait for graceful shutdown on SIGINT/SIGTERM

Example:

Terminal window
./bin/tellstone \
--addr 127.0.0.1:9988 \
--enable-resp \
--resp-addr 127.0.0.1:6379 \
--enable-metrics \
--num-shards 8 \
--shutdown-timeout 30s

These aren’t exposed as flags:

EnvDescription
TSD_GC_PERCENTDefault -1 — disables the Go GC for a zero-GC hot path.
TSD_MEM_LIMIT_BYTESSoft heap ceiling for the Go runtime.
TSD_ENABLE_PROFILINGServes pprof on 127.0.0.1:6060 when set.
  • Metrics: with --enable-metrics, Prometheus text is exposed at http://<metrics-addr>/metrics (default :9100).
  • Profiling: set TSD_ENABLE_PROFILING=1 to serve pprof on 127.0.0.1:6060, e.g. go tool pprof http://127.0.0.1:6060/debug/pprof/profile.
  • Tracing: set TSD_TRACE_RATIO to enable OpenTelemetry tracing for performance analysis.

For production deployments, consider these settings:

  • Set TSD_GC_PERCENT=-1 to minimize GC pauses for maximum performance
  • Set TSD_MEM_LIMIT_BYTES to approximately 85-90% of your container memory limit to prevent OOM kills
  • Enable metrics with --enable-metrics for monitoring
  • Use --num-shards to match your CPU core count for optimal performance
  • Set appropriate --shutdown-timeout to allow for graceful shutdown in containerized environments