Skip to main content

Server Configuration

Kahuna server options are passed as command-line flags to Kahuna.Server. The table below documents the options currently exposed by KahunaCommandLineOptions.

Network and TLS

Command Line Option(s)DescriptionDefault Value
-h, --hostHost option accepted by the CLI. The current Kestrel setup listens on all interfaces for configured HTTP/HTTPS ports.*
-p, --http-portsOne or more HTTP ports for external REST/gRPC traffic. If omitted, Kahuna listens on HTTP port 2070.2070
--https-portsOne or more HTTPS ports for external REST/gRPC traffic. If omitted, Kahuna listens on HTTPS port 2071.2071
--https-certificatePath to the HTTPS certificate used by Kestrel and trusted for internal HTTPS communication.empty
--https-certificate-passwordPassword for the HTTPS certificate.empty

Storage and WAL

Command Line OptionDescriptionDefault Value
--storageMaterialized Kahuna state backend for persistent locks, key/value entries, revisions, and sequences. Supported values are rocksdb, sqlite, and memory.rocksdb
--storage-pathFile system path for materialized state storage. Use a durable local disk for rocksdb or sqlite.empty
--storage-revisionRevision name used to select a materialized state database or file set under --storage-path.empty
--wal-storageRaft WAL backend used by Kommander. Supported values are rocksdb, sqlite, and memory.rocksdb
--wal-pathFile system path for Raft WAL storage. Use a durable local disk.empty
--wal-revisionRevision name used to select the WAL database or file set under --wal-path.v1
--wal-sync-writesKeep synchronous durable WAL writes enabled. This is the default behavior.enabled
--disable-wal-sync-writesDisable synchronous durable WAL writes for faster non-critical local or test runs.disabled
--rocksdb-shared-memoryShare one RocksDB block cache and write-buffer manager between the materialized state backend and Raft WAL. Applies only when both --storage and --wal-storage are rocksdb.disabled
--rocksdb-shared-memory-budget-mbTotal shared RocksDB block-cache budget in MiB. The memtable sub-budget is charged inside this total.320
--rocksdb-shared-memtable-budget-mbShared RocksDB memtable sub-budget in MiB. Must be less than or equal to --rocksdb-shared-memory-budget-mb.128

Cluster Identity and Discovery

Command Line OptionDescriptionDefault Value
--initial-clusterStatic discovery list for the initial Raft cluster. Pass one or more node addresses.none
--join-existingJoin a running cluster as a new learner using --initial-cluster as the seed list.disabled
--graceful-leave-on-shutdownCommit removal of this member during planned shutdown instead of waiting for SWIM eviction. Do not enable for rolling restarts because the node is removed from membership.disabled
--initial-cluster-partitionsNumber of Raft partitions created for the initial cluster.128
--raft-nodenameHuman-readable node name used by Raft. If omitted, the server uses the machine name.machine name
--raft-nodeidNumeric node identifier used by Raft.0
--raft-hostHost advertised for Raft consensus and replication traffic.localhost
--raft-portPort advertised for Raft consensus and replication traffic.2070

Workers and Runtime

Command Line OptionDescriptionDefault Value
--locks-workersNumber of lock actors/workers. Values less than or equal to 0 are normalized to at least 256 or Environment.ProcessorCount * 4, whichever is larger.128
--keyvalue-workersNumber of key/value actors/workers. Values less than or equal to 0 are normalized to at least 256 or Environment.ProcessorCount * 4, whichever is larger.128
--background-writer-workersNumber of background persistence writer workers. Values less than or equal to 0 are normalized to 1.1
--default-transaction-timeoutDefault transaction timeout in milliseconds.5000
--script-cache-expirationScript parser cache expiration in seconds.600
--revisions-to-cacheNumber of key revisions intended to stay cached in memory. This flag is defined by the server CLI, but the current server startup path does not pass it into KahunaConfiguration.4
--cache-entry-ttlAge threshold used by lock cleanup and legacy cleanup paths, in seconds. Key/value LRU eviction is budget-based.1800
--cache-entries-to-removeMaximum entries removed by cleanup paths that use this cap. Values less than or equal to 0 are normalized from the key/value collection batch size.100
--dirty-objects-writer-delayDelay between dirty object writer flush passes, in milliseconds.200

Backups and Point-in-Time Recovery

Command Line OptionDescriptionDefault Value
--pitr-windowRecoverable WAL history in seconds. Values are normalized to a range greater than 0 and no more than 21600 seconds (6 hours). Increasing this value increases retained WAL storage.3600
--base-snapshot-intervalIntended interval between base checkpoints per partition, in seconds. It must be positive and no greater than --pitr-window. This setting contributes to the protected WAL floor but does not schedule backups automatically.1800
--pitr-backup-dirRoot directory for backup catalog manifests and artifacts. Backup REST/gRPC, client, and CLI operations are disabled when this is empty. It is required by --pitr-bootstrap-from.empty
--pitr-bootstrap-fromLeaf backup ID restored into local persistence and WAL before the node joins an existing cluster. Requires --join-existing, --initial-cluster, and --pitr-backup-dir.none
--pitr-target-time-msPITR target using the physical HLC component in Unix epoch milliseconds. 0 restores through the selected chain's natural end.0

See Backups and Point-in-Time Recovery for setup, client and CLI usage, the backup-chain model, and recovery constraints.

Persistent Revision Retention

Command Line OptionDescriptionDefault Value
--persistent-revision-retention-countMaximum persisted key/value revisions to keep per key. 0 keeps revisions forever.0
--persistent-revision-retention-ageMaximum age of persisted key/value revisions in seconds. 0 disables age-based retention.0
--persistent-revision-cleanup-intervalMinimum interval between full persistent revision cleanup sweeps, in seconds.300
--persistent-revision-cleanup-batch-sizeMaximum revision records deleted per cleanup pass.1000
--persistent-revision-cleanup-on-writeKeep targeted persistent revision cleanup after writes enabled. This is the default behavior.enabled
--disable-persistent-revision-cleanup-on-writeDisable targeted persistent revision cleanup after writes.disabled

Persistent revision cleanup is clamped by live snapshot holds. A held snapshot timestamp keeps the boundary revision needed by that timestamp, and every newer revision, even if the count or age retention settings would otherwise prune them.

Raft Communication

Command Line OptionDescriptionDefault Value
--read-io-threadsNumber of Raft read I/O threads.8
--write-io-threadsNumber of Raft write I/O threads.16
--raft-enable-shared-executor-poolShare a bounded worker pool across Raft partitions instead of using one OS thread per partition. Useful for very high partition counts.enabled
--raft-executor-pool-sizeNumber of shared Raft executor workers. 0 auto-sizes to the processor count.0
--raft-http-schemeHTTP scheme used by Raft REST communication.https://
--raft-http-auth-bearer-tokenBearer token sent with Raft REST communication.empty
--raft-http-timeoutRaft REST request timeout in seconds.5
--raft-http-versionHTTP protocol version used by Raft REST communication.2.0
--raft-grpc-schemeURL scheme prepended to peer endpoints when opening Raft gRPC channels.https://
--raft-grpc-channels-per-nodePooled gRPC channels opened per peer. Values are clamped between 1 and 64; each channel holds a connection and handler for the process lifetime.4
--raft-grpc-enable-multiple-http2-connectionsAllow each pooled gRPC channel to open multiple HTTP/2 connections for additional concurrent streams.disabled
--raft-grpc-enable-snapshot-compressionCompress Raft snapshot transfers sent over gRPC.disabled
--raft-grpc-enable-append-logs-coalescingCoalesce multiple AppendLogs calls into one gRPC frame per write cycle for write-heavy multi-partition workloads.disabled
--raft-grpc-append-logs-max-coalesce-batchMaximum AppendLogs items drained into one coalesced gRPC frame when coalescing is enabled.256
--raft-transport-securityStructured transport security JSON accepted by the CLI. The current server startup path does not parse or apply this field yet.empty
--raft-allow-insecure-certificate-validationSkip TLS certificate validation for inter-node Raft gRPC traffic. Use only in development or test environments.disabled

Raft Timing

Command Line OptionDescriptionDefault Value
--raft-heartbeat-intervalLeader heartbeat interval in milliseconds.500
--raft-recent-heartbeatRecent-heartbeat window in milliseconds.100
--raft-voting-timeoutVote wait timeout in milliseconds.1500
--raft-check-leader-intervalLeader check interval in milliseconds.250
--raft-timer-initial-delayInitial delay before Raft timers start, in milliseconds.2500
--raft-update-nodes-intervalNode registry update interval in milliseconds.5000
--raft-start-election-timeoutMinimum election timeout in milliseconds.2000
--raft-end-election-timeoutMaximum election timeout in milliseconds.4000
--raft-start-election-timeout-incrementMinimum election timeout increment in milliseconds.100
--raft-end-election-timeout-incrementMaximum election timeout increment in milliseconds.200
--raft-election-timeout-seedSeed for deterministic election timeouts. 0 means random timing. Intended for testing and reproducibility.0

Raft Queueing and Batching

Command Line OptionDescriptionDefault Value
--raft-max-queued-client-proposalsMaximum queued client proposals per partition before backpressure applies.2048
--raft-max-wal-queue-depth-per-partitionPer-partition WAL write queue depth limit.4096
--raft-max-global-wal-queue-depthGlobal WAL write queue depth limit across all partitions. 0 means unlimited.0
--raft-max-wal-batch-sizeMaximum WAL writes grouped into one storage flush.256
--raft-max-wal-group-batch-partitionsMaximum partitions coalesced into one cross-partition WAL group-commit batch.64
--raft-wal-group-commit-linger-msOptional group-commit linger window in milliseconds. 0 disables linger.0
--raft-wal-single-fsync-commitEnable the single-fsync fast path that acknowledges after propose-quorum durability and writes the commit marker lazily.enabled
--raft-sqlite-wal-shard-countSQLite WAL shard databases used to distribute partitions. 0 resolves to the processor count when storage is first initialized.0
--raft-max-drain-quantum-controlMaximum control-plane operations drained per executor wake cycle.8
--raft-max-drain-quantum-replicationMaximum replication operations drained per executor wake cycle.4
--raft-max-drain-quantum-clientMaximum client operations drained per executor wake cycle.2
--raft-max-drain-quantum-maintenanceMaximum maintenance operations drained per executor wake cycle.1

Raft Leader Balancing

Command Line OptionDescriptionDefault Value
--raft-enable-leader-balancerEnable advisory leader balancing. Configure it consistently on every cluster node.disabled
--raft-leader-balancer-report-intervalInterval between node load reports, in milliseconds.5000
--raft-leader-balancer-intervalInterval between planning passes on the partition 0 leader, in milliseconds.30000
--raft-leader-balancer-report-ttlMaximum accepted load-report age, in milliseconds. Must exceed the report interval.20000
--raft-count-deadbandAllowed leader-count deviation from the ideal before count balancing starts.1
--raft-load-imbalance-thresholdFractional load skew that triggers load-based swaps after counts are balanced.0.25
--raft-min-leader-stability-msMinimum leadership age before a partition is eligible to move, in milliseconds.5000
--raft-move-cooldownDelay before the same partition can move again, in milliseconds.60000
--raft-max-moves-per-passMaximum transfer suggestions created in one planning pass.4
--raft-max-concurrent-transfersMaximum transfer suggestions tracked concurrently.2
--raft-suggestion-timeoutTime allowed for a suggested transfer to be confirmed by load reports, in milliseconds.15000
--raft-leader-balancer-ops-weightOperations-per-second weight in the partition load score.1.0
--raft-leader-balancer-queue-weightQueue-depth weight in the partition load score.0.5

See Leader Balancing for rollout, tuning, metrics, and safety behavior.

Raft Membership and Catch-Up

Command Line OptionDescriptionDefault Value
--raft-backfill-thresholdCommitted-entry lag that triggers active follower backfill.10
--raft-max-backfill-entries-per-roundMaximum committed entries sent to one stale follower per heartbeat interval.128
--raft-learner-promotion-lagMaximum entries a learner may trail the leader while remaining eligible for voter promotion.10
--raft-learner-promotion-stable-windowTime a learner must remain within the promotion lag on all partitions, in milliseconds.3000

Raft Gossip, Failure Detection, and Quiescence

Command Line OptionDescriptionDefault Value
--raft-gossip-intervalInterval between membership anti-entropy gossip rounds, in milliseconds.5000
--raft-gossip-fanoutRandom peers contacted per gossip round. 0 disables gossip.2
--raft-ping-intervalInterval between SWIM node probes, in milliseconds. 0 disables failure detection, which is invalid while quiescence is enabled.1000
--raft-ping-timeoutDirect SWIM probe timeout, in milliseconds.500
--raft-indirect-ping-fanoutIntermediary nodes used for indirect probing after a direct ping timeout.2
--raft-suspicion-timeoutTime a node may remain Suspect before becoming Dead, in milliseconds.5000
--raft-dead-member-eviction-graceTime a dead node remains in the roster before partition 0 commits its removal, in milliseconds.30000
--raft-enable-quiescenceStop per-partition heartbeats after an idle period and rely on SWIM for node liveness. Requires 0 < --raft-ping-interval < --raft-start-election-timeout.enabled
--raft-quiesce-afterRequired partition idle time before heartbeat quiescence, in milliseconds.1500

Raft Logging and Compaction

Command Line OptionDescriptionDefault Value
--raft-slow-state-machine-logSlow state-machine operation log threshold in milliseconds.50
--raft-slow-wal-machine-logSlow WAL state-machine operation log threshold in milliseconds.25
--raft-compact-every-operationsNumber of committed operations between automatic Raft WAL compaction checks.10000
--raft-compact-number-entriesNumber of Raft WAL entries removed per compaction batch.100
--raft-max-entries-per-compactionMaximum Raft WAL entries processed per compaction run.5000

Configuration Notes

  • --wal-storage and --storage configure different layers. WAL storage persists Raft logs; materialized storage persists Kahuna object state after committed operations are applied.
  • Use stable --storage-revision and --wal-revision values for existing data directories. Changing revisions points the server at different local storage files.
  • The server CLI still does not expose every KahunaConfiguration field. In-memory collector knobs, script-cache entry limits, and count- or load-based key-range split/merge thresholds remain code-level or embedded-node configuration today.
  • The embedded node exposes the broader runtime surface, including collector and persistent-revision settings. See Embedded Kahuna Node for the full embedded configuration options.