Skip to Content
ConfigurationsAdvanced Configuration

Advanced Configuration

This page is the canonical public reference for every supported server.toml key and every documented KALAMDB_* runtime override.

Use it when you need exact key names, actual defaults, or a clear answer to whether a setting is configured through TOML, an environment variable, or both.

Before You Start

Focused guides:

Loading Order

  1. Load server.toml.
  2. Apply config-loader environment overrides from KALAMDB_* variables.
  3. Apply runtime-only environment behavior that lives outside the config crate.
  4. Normalize paths and validate the final configuration.

Runtime-only env vars are currently:

  • KALAMDB_ROOT_PASSWORD for root bootstrap password selection during startup.
  • KALAMDB_TOKIO_WORKER_THREADS for overriding Tokio runtime worker threads.

Environment Override Reference

Only the variables below are supported today. If a setting is not listed here, configure it in server.toml.

Boolean parsing notes:

  • Most positive boolean env vars treat true, 1, and yes as enabled.
  • KALAMDB_COOKIE_SECURE is inverted for convenience: false, 0, and no disable it; any other non-empty value enables it.

List parsing notes:

  • KALAMDB_SECURITY_CORS_ALLOWED_ORIGINS and KALAMDB_SECURITY_TRUSTED_PROXY_RANGES accept comma-separated values.
  • KALAMDB_CLUSTER_PEERS accepts node_id@rpc_addr@api_addr[@rpc_server_name] entries separated by semicolons.

Server, Logging, and Storage

Environment variableMaps toNotes
KALAMDB_SERVER_HOSTserver.hostBind host/interface.
KALAMDB_SERVER_PORTserver.portHTTP listen port.
KALAMDB_SERVER_PUBLIC_ORIGINserver.public_originEmpty string preserves browser-origin fallback behavior.
KALAMDB_SERVER_WORKERSserver.workersActix worker threads.
KALAMDB_LOG_LEVELlogging.levelerror, warn, info, debug, trace.
KALAMDB_LOG_FORMATlogging.formatcompact, pretty, or json.
KALAMDB_LOGS_DIRlogging.logs_pathDirectory for server.log, server.jsonl, and slow.log.
KALAMDB_LOG_TO_CONSOLElogging.log_to_consoleAlso emit logs to stdout/stderr.
KALAMDB_SLOW_QUERY_THRESHOLD_MSlogging.slow_query_threshold_msSlow query threshold in milliseconds.
KALAMDB_OTLP_ENABLEDlogging.otlp.enabledEnable OTLP trace export.
KALAMDB_OTLP_ENDPOINTlogging.otlp.endpointCollector endpoint.
KALAMDB_OTLP_PROTOCOLlogging.otlp.protocolgrpc or http.
KALAMDB_OTLP_SERVICE_NAMElogging.otlp.service_nameService name shown by the collector/backend.
KALAMDB_OTLP_TIMEOUT_MSlogging.otlp.timeout_msOTLP export timeout.
KALAMDB_DATA_DIRstorage.data_pathBase data directory.

Topics, Auth, Security, and WebSockets

Environment variableMaps toNotes
KALAMDB_TOPIC_VISIBILITY_TIMEOUT_SECStopics.visibility_timeout_secsCanonical topic visibility timeout override.
KALAMDB_VISIBILITY_TIMEOUT_SECStopics.visibility_timeout_secsLegacy compatibility alias.
KALAMDB_TOPIC_DEFAULT_RETENTION_SECONDStopics.default_retention_secondsDefault topic time retention.
KALAMDB_TOPIC_DEFAULT_RETENTION_MAX_BYTEStopics.default_retention_max_bytesDefault topic byte retention.
KALAMDB_TOPIC_RETENTION_CHECK_INTERVAL_SECONDStopics.retention_check_interval_secondsScheduler interval.
KALAMDB_TOPIC_RETENTION_BATCH_SIZEtopics.retention_batch_sizeDelete batch size.
KALAMDB_JWT_SECRETauth.jwt_secretInternal JWT signing/verification secret.
KALAMDB_JWT_TRUSTED_ISSUERSauth.jwt_trusted_issuersComma-separated issuer list.
KALAMDB_JWT_EXPIRY_HOURSauth.jwt_expiry_hoursInternal token TTL.
KALAMDB_COOKIE_SECUREauth.cookie_secureHTTPS-only auth cookies.
KALAMDB_ALLOW_REMOTE_SETUPauth.allow_remote_setupEnables first-time setup from non-localhost clients.
KALAMDB_PG_AUTH_TOKENauth.pg_auth_tokenPre-shared token for pg_kalam gRPC auth.
KALAMDB_AUTH_OIDC_AUTO_PROVISIONauth.oidc.auto_provisionOIDC auto-provisioning override.
KALAMDB_SECURITY_CORS_ALLOWED_ORIGINSsecurity.cors.allowed_originsComma-separated list or *.
KALAMDB_SECURITY_TRUSTED_PROXY_RANGESsecurity.trusted_proxy_rangesCanonical proxy trust override.
KALAMDB_TRUSTED_PROXY_RANGESsecurity.trusted_proxy_rangesLegacy env alias kept for compatibility.
KALAMDB_RATE_LIMIT_AUTH_REQUESTS_PER_IP_PER_SECrate_limit.max_auth_requests_per_ip_per_secBrute-force protection rate limit.
KALAMDB_WEBSOCKET_CLIENT_TIMEOUT_SECSwebsocket.client_timeout_secsClient heartbeat timeout.
KALAMDB_WEBSOCKET_AUTH_TIMEOUT_SECSwebsocket.auth_timeout_secsTime allowed before auth message arrives.
KALAMDB_WEBSOCKET_HEARTBEAT_INTERVAL_SECSwebsocket.heartbeat_interval_secsHeartbeat scan interval.

Cluster and RPC TLS

Environment variableMaps toNotes
KALAMDB_CLUSTER_IDcluster.cluster_idCreates the cluster section if needed.
KALAMDB_NODE_IDcluster.node_idCanonical node ID override.
KALAMDB_CLUSTER_NODE_IDcluster.node_idLegacy alias for KALAMDB_NODE_ID.
KALAMDB_CLUSTER_RPC_ADDRcluster.rpc_addrAdvertised Raft RPC address.
KALAMDB_CLUSTER_API_ADDRcluster.api_addrAdvertised API address.
KALAMDB_CLUSTER_PEERScluster.peersnode_id@rpc_addr@api_addr[@rpc_server_name];...
KALAMDB_RPC_TLS_ENABLEDrpc_tls.enabledEnable TLS/mTLS on the gRPC listener.
KALAMDB_RPC_TLS_CA_CERTrpc_tls.ca_certFile path or inline PEM.
KALAMDB_RPC_TLS_SERVER_CERTrpc_tls.server_certFile path or inline PEM.
KALAMDB_RPC_TLS_SERVER_KEYrpc_tls.server_keyFile path or inline PEM.
KALAMDB_RPC_TLS_REQUIRE_CLIENT_CERTrpc_tls.require_client_certRequire client certs signed by ca_cert.

Runtime-Only Environment Variables

Environment variableEffectNotes
KALAMDB_ROOT_PASSWORDSets the initial root password during startup bootstrap.This does not come from apply_env_overrides; it is read in server lifecycle startup. It takes precedence over auth.root_password.
KALAMDB_TOKIO_WORKER_THREADSOverrides Tokio runtime worker thread count.This is read in the server binary and takes precedence over performance.tokio_worker_threads.

Full server.toml Reference

Top-Level Keys

KeyDefaultDescription
transaction_timeout_secs300Maximum lifetime of an open transaction before the server aborts it.
max_transaction_buffer_bytes104857600 (100 MB)Maximum in-memory transaction overlay size before new writes are rejected.

[server]

KeyDefaultDescription
host"127.0.0.1"Network interface to bind. Use 0.0.0.0 only with explicit CORS/origin policy.
port2900HTTP port for REST, SQL, auth, and WebSocket entrypoints.
public_originunsetPublic browser-facing origin used by the Admin UI for /v1/api and /v1/ws.
workers0Actix worker threads. 0 means automatic sizing.
api_version"v1"Version prefix for API routes.
enable_http2trueEnables HTTP/1.1 + cleartext HTTP/2 negotiation.
ui_pathunsetPath to a built Admin UI bundle to serve from the server.

[storage]

KeyDefaultDescription
data_path"./data"Base path for RocksDB, Parquet storage, snapshots, streams, exports, and temp files.
shared_tables_template"{namespace}/{tableName}"Folder template for shared tables.
user_tables_template"{namespace}/{tableName}/{userId}"Folder template for user-scoped tables.

[storage.remote_timeouts]

KeyDefaultDescription
request_timeout_secs60Request timeout for remote storage backends.
connect_timeout_secs10Connection timeout for remote storage backends.

[storage.rocksdb]

KeyDefaultDescription
block_cache_size2097152 (2 MB)Shared RocksDB read block cache across all column families.
max_background_jobs4Background compaction and flush worker count.
max_open_files512Maximum open files kept by RocksDB. -1 means unlimited.
sync_writesfalseFsync WAL on each write for stronger durability and lower throughput.
disable_walfalseDisables WAL for speed at the cost of crash recovery guarantees.
compact_on_startupfalseCompact column families during startup to reduce SST spread. Disabled by default to keep startup fast.

[storage.rocksdb.cf_profiles.system_meta]

KeyDefaultDescription
write_buffer_size32768Write buffer size for system metadata CFs.
max_write_buffers2Max RocksDB memtables for system metadata CFs.

[storage.rocksdb.cf_profiles.system_index]

KeyDefaultDescription
write_buffer_size32768Write buffer size for system index CFs.
max_write_buffers2Max RocksDB memtables for system index CFs.

[storage.rocksdb.cf_profiles.hot_data]

KeyDefaultDescription
write_buffer_size131072Write buffer size for hot data CFs.
max_write_buffers2Max RocksDB memtables for hot data CFs.

[storage.rocksdb.cf_profiles.hot_index]

KeyDefaultDescription
write_buffer_size65536Write buffer size for hot index CFs.
max_write_buffers2Max RocksDB memtables for hot index CFs.

[storage.rocksdb.cf_profiles.raft]

KeyDefaultDescription
write_buffer_size262144Write buffer size for the Raft CF.
max_write_buffers2Max RocksDB memtables for the Raft CF.

[datafusion]

KeyDefaultDescription
memory_limit33554432 (32 MB)Query execution memory budget.
query_parallelism2Query execution worker concurrency.
max_partitions4Maximum partitions used in planning and scans.
batch_size1024Record batch size for execution operators.

[flush]

KeyDefaultDescription
default_row_limit10000Row threshold that triggers flush when no per-table override exists.
default_time_interval300Time threshold in seconds for automatic flush.
flush_batch_size10000Rows loaded into memory per flush batch.
check_interval_seconds60Scheduler scan interval for pending writes. 0 disables the scheduler.

[flush.compaction]

Optional post-flush Parquet compaction for trailing small segments. This is configured in server.toml; there are no dedicated KALAMDB_* overrides for these keys today.

For the architecture behind these settings, see /docs/server/architecture/storage-tiers and /docs/server/architecture/manifests.

KeyDefaultDescription
enabledfalseEnable leader-only post-flush compaction for eligible USER and SHARED table scopes.
min_eligible_segments5Minimum number of newest trailing small segments required before a compaction job is considered.
max_segments_per_run8Maximum number of newest trailing segments rewritten by one compaction job.
user_max_segment_rows10000User-table segments below this row count are considered small.
shared_max_segment_rows25000Shared-table segments below this row count are considered small.

Compaction rewrites only the manifest tail: newest committed segments on the same schema version and below the configured row target. If a newer flush changes that tail while compaction is writing, the swap is skipped and the compacted output is discarded.

[retention]

KeyDefaultDescription
enable_dba_statstrueEnables background dba.stats collection.
dba_stats_retention_days7Number of days to retain dba.stats samples. 0 disables automatic cleanup.

[stream]

KeyDefaultDescription
default_ttl_seconds10Default lifetime of stream rows/events.
default_max_buffer10000Default in-memory stream buffer limit.
eviction_interval_seconds60Background eviction interval for expired stream data.

[manifest_cache]

Manifest cache behavior is explained in /docs/server/architecture/manifests.

KeyDefaultDescription
eviction_interval_seconds300Interval between manifest cache eviction passes.
max_entries500Maximum hot manifest entries kept in memory.
eviction_ttl_days7Age after which unused manifest entries are evicted.

[limits]

KeyDefaultDescription
max_message_size1048576 (1 MB)Maximum accepted request payload/message size.
max_query_limit1000Hard maximum LIMIT the server will accept.
default_query_limit50Implicit LIMIT when the query omits one.

[logging]

For end-to-end examples and deployment guidance, use /docs/server/configurations/logging.

KeyDefaultDescription
level"info"Global log verbosity.
logs_path"./logs"Directory for server log files.
log_to_consoletrueAlso emit logs to stdout/stderr.
format"compact"compact, pretty, or json.
slow_query_threshold_ms1200Slow query threshold in milliseconds.

[logging.targets] is an optional dynamic table of per-target log levels, for example:

TOML
[logging.targets]datafusion = "warn"arrow = "warn"parquet = "warn"

[logging.otlp]

KeyDefaultDescription
enabledfalseEnables OpenTelemetry trace export.
endpoint"http://127.0.0.1:4317"Collector endpoint.
protocol"grpc"OTLP transport: grpc or http.
service_name"kalamdb-server"Service name attached to exported spans.
timeout_ms3000OTLP export timeout in milliseconds.

[performance]

KeyDefaultDescription
request_timeout30Maximum full request execution time in seconds.
keepalive_timeout75Idle HTTP keep-alive timeout in seconds.
max_connections25000Maximum simultaneous client connections.
backlog4096Kernel listen backlog for pending TCP connections.
tokio_worker_threads0Tokio runtime worker threads. 0 means auto-size, capped in the binary.
worker_max_blocking_threads32Per-worker cap for blocking tasks such as RocksDB I/O.
client_request_timeout5Time allowed for a client to finish sending request headers.
client_disconnect_timeout2Graceful client disconnect timeout.
max_header_size16384 (16 KB)Maximum HTTP header size.

[rate_limit]

KeyDefaultDescription
max_queries_per_sec100Per-user SQL query rate limit.
max_messages_per_sec50Per-WebSocket incoming message rate limit.
max_subscriptions_per_user10Maximum live subscriptions per user.
max_auth_requests_per_ip_per_sec20Rate limit for auth/setup endpoints per IP.
max_connections_per_ip100Maximum concurrent connections per IP.
max_requests_per_ip_per_sec200Pre-auth request flood protection per IP.
request_body_limit_bytes10485760 (10 MB)Request body cap used by connection protection.
ban_duration_seconds300Temporary IP ban duration after repeated abuse.
enable_connection_protectiontrueMaster switch for connection abuse protection.
cache_max_entries1000Maximum cached rate-limit entries.
cache_ttl_seconds600Idle TTL for cached rate-limit entries.

[security]

KeyDefaultDescription
trusted_proxy_ranges[]Proxy IPs or CIDR ranges allowed to supply forwarded client IP headers.
max_ws_message_size1048576 (1 MB)Maximum accepted WebSocket message size.
strict_ws_origin_checkfalseReject WebSocket connections that lack a valid Origin header.
max_request_body_size10485760 (10 MB)Global HTTP request body cap.

[security.cors]

KeyDefaultDescription
allowed_origins[]Allowed browser origins. Empty behaves like wildcard at runtime, but non-localhost startup validation requires explicit origins.
allowed_methods["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"]Allowed CORS methods.
allowed_headers["Authorization", "Content-Type", "Accept", "Origin", "X-Requested-With"]Allowed browser request headers.
expose_headers[]Response headers exposed to browser JavaScript.
allow_credentialsfalseAllow cookies or authorization headers on CORS requests.
max_age3600Preflight cache duration in seconds.
allow_private_networkfalseEnables private network preflight support where browsers implement it.

[websocket]

KeyDefaultDescription
client_timeout_secs10Maximum time without client heartbeat activity before disconnect.
auth_timeout_secs3Time allowed after connect before auth must arrive.
heartbeat_interval_secs5Interval between heartbeat scans/pings.

[auth] or [authentication]

Both section names are accepted. The config crate stores them as auth internally.

KeyDefaultDescription
root_passwordunsetConfig-file root bootstrap password. Runtime env KALAMDB_ROOT_PASSWORD takes precedence.
jwt_secret"CHANGE_ME_IN_PRODUCTION"Secret for signing and validating internal HS256 tokens.
jwt_trusted_issuers""Comma-separated trusted external issuer list.
jwt_expiry_hours24Lifetime of internal JWTs in hours.
cookie_securetrueRestricts auth cookies to HTTPS.
allow_remote_setupfalseAllow first-time setup from non-localhost clients.
pg_auth_tokenunsetPre-shared token for pg_kalam gRPC authentication.

Compatibility note: older configs may still contain a pre-rename password-policy key; the current supported key is auth.local.enforce_password_complexity.

[auth.local]

KeyDefaultDescription
enabledtrueEnables local username/password login and password setup.
bcrypt_cost12Password hash work factor. Valid range is determined by bcrypt.
min_password_length8Minimum accepted password length.
max_password_length1024Maximum locally accepted password length.
enforce_password_complexityfalseRequire uppercase, lowercase, digit, and special characters in passwords.

[auth.oidc]

KalamDB supports one external OpenID Connect provider per server process.

KeyDefaultDescription
enabledfalseEnables the configured OIDC provider.
display_nameunsetHuman-facing provider label for UI and CLI login.
issuerunsetOIDC issuer URL. Must be included in auth.jwt_trusted_issuers.
client_idunsetClient ID used for browser/device flows and default audience validation.
client_secretunsetClient secret for confidential clients or brokered provider exchanges.
scopes["openid", "email", "profile"]OIDC scopes. Must include openid.
device_authorization_endpointunsetOptional device-flow endpoint override when discovery omits it.
broker_device_flow_enabledfalseEnables KalamDB-brokered OIDC device flow.
auto_provisionfalseAllows absent regular OIDC subjects when default role is user; creates rows for elevated default roles.
default_role"user"Role used for auto-provisioned OIDC users.
audienceunsetExplicit audience override; defaults to client_id.

[user_management]

KeyDefaultDescription
deletion_grace_period_days30Grace period before soft-deleted users are purged.
cleanup_job_schedule"0 2 * * *"Cron schedule for user cleanup.

[files]

KeyDefaultDescription
max_size_bytes26214400 (25 MB)Maximum size of a single uploaded file.
max_files_per_request20Maximum uploaded files accepted in one request.
max_files_per_folder5000Folder rotation threshold for durable file storage.
staging_path"./data/tmp"Temporary upload staging directory.
allowed_mime_types[]Allowed MIME types. Empty means allow all.

[shutdown.flush]

KeyDefaultDescription
timeout300Maximum wait time in seconds for flush jobs during graceful shutdown.

[jobs]

KeyDefaultDescription
max_concurrent10Maximum concurrently running background jobs.
max_retries3Retry attempts before a job is marked failed.
retry_backoff_ms100Initial retry backoff in milliseconds.
wal_cleanup_interval_seconds300Interval for memtable flushes that reclaim stale WAL files. 0 disables it.

[execution]

KeyDefaultDescription
handler_timeout_seconds30Maximum execution handler duration in seconds.
max_parameters50Maximum parameter count per statement.
max_parameter_size_bytes524288 (512 KB)Maximum size of a single parameter value.
sql_plan_cache_max_entries200Maximum cached SQL logical plans.
sql_plan_cache_ttl_seconds900Idle TTL for cached SQL logical plans.

[topics]

KeyDefaultDescription
visibility_timeout_secs60Hide unacknowledged consumer claims for this many seconds before redelivery.
default_retention_seconds604800 (7 days)Default topic time retention.
default_retention_max_bytes1073741824 (1 GiB)Default topic byte retention per partition.
retention_check_interval_seconds3600Topic retention scheduler interval in seconds. 0 disables scheduling.
retention_batch_size10000Maximum deletes per partition in a single retention pass.

[rpc_tls]

This secures the shared gRPC listener used by Raft replication, cluster RPC, and the PostgreSQL extension.

KeyDefaultDescription
enabledfalseEnable TLS or mTLS on the gRPC listener.
ca_certunsetCA certificate used to validate incoming client certificates. File path or inline PEM.
server_certunsetServer certificate. File path or inline PEM.
server_keyunsetPrivate key for server_cert. File path or inline PEM.
require_client_certtrueRequire clients to present a CA-signed certificate.

[cluster]

Omit this section entirely for standalone mode.

For the Multi-Raft model behind these options, see /docs/server/architecture/clustering.

KeyDefaultDescription
cluster_id"cluster"Logical cluster identifier shared by all nodes.
node_idrequiredUnique node ID for this server. Must be greater than 0.
rpc_addr"127.0.0.1:2910"Advertised Raft RPC address. Use a reachable address, not a wildcard, in real clusters.
api_addr"0.0.0.0:2900"Advertised API address for this node.
user_shards8Number of user-data shards.
shared_shards1Number of shared-data shards.
heartbeat_interval_ms250Raft leader heartbeat interval.
election_timeout_ms(500, 1000)Min/max election timeout range. Min must exceed heartbeat.
snapshot_policy"LogsSinceLast(1000)"Snapshot policy. Use LogsSinceLast(N) or Never.
max_snapshots_to_keep3Snapshot retention count. 0 keeps all snapshots.
replication_timeout_ms5000Timeout for learner catch-up and replication progress.
reconnect_interval_ms3000Delay between reconnect attempts to unreachable peers.
peer_wait_max_retriesunsetOptional cap on peer-startup readiness retries.
peer_wait_initial_delay_msunsetOptional initial delay between peer readiness checks.
peer_wait_max_delay_msunsetOptional backoff cap for peer readiness checks.

[[cluster.peers]]

KeyDefaultDescription
node_idrequiredPeer node ID.
rpc_addrrequiredPeer RPC address.
api_addrrequiredPeer API address.
rpc_server_nameunsetOptional TLS server-name override for SNI/hostname verification.

Total Raft groups = 3 fixed groups (system metadata, user metadata, jobs) + user_shards + shared_shards.

Validation highlights:

  • node_id must be greater than 0
  • election_timeout_ms.0 must be greater than heartbeat_interval_ms
  • election_timeout_ms.1 must be greater than election_timeout_ms.0
  • user_shards and shared_shards must be greater than 0
  • non-localhost multi-node clusters require rpc_tls.enabled = true
Last updated on