# rstmdb Production Configuration
#
# Optimized for production workloads.
# Adjust based on your hardware and requirements.

network:
  bind_addr: "0.0.0.0:7401"
  idle_timeout_secs: 600
  max_connections: 10000

auth:
  required: true
  # Load token hashes from external secrets file
  secrets_file: "/etc/rstmdb/tokens.secret"

storage:
  data_dir: "/var/lib/rstmdb"
  wal_segment_size_mb: 128
  # Balanced durability - fsync every 100ms
  fsync_policy:
    every_ms: 100

  # Maximum number of versions per state machine (0 = unlimited)
  # When limit is reached, new versions will be rejected
  max_machine_versions: 0
  allow_instance_recreate: true

  # FLUSH_ALL is disabled in production for safety
  allow_flush_all: false

compaction:
  enabled: true
  events_threshold: 50000
  size_threshold_mb: 500
  min_interval_secs: 300

tls:
  enabled: true
  cert_path: "/etc/rstmdb/certs/server.crt"
  key_path: "/etc/rstmdb/certs/server.key"
  require_client_cert: false
  # client_ca_path: "/etc/rstmdb/certs/ca.crt"

metrics:
  enabled: true
  bind_addr: "0.0.0.0:9090"
