Limits, Configuration, and CLI Reference

Updated:
Author: Erkin Khidirov

This reference details all hard protocol limits in Slyber DB, engine and server settings in db.Config, daemon CLI flags and environment variables, and network client options in db.ClientConfig.

1. System Constants and Hard Limits

ConstantValueDescription
NumVirtualPartitions4096Total number of virtual partitions (0..4095)
MaxKeyBytes8192 (8 KiB)Maximum byte size of a user Key or Scan/Watch prefix
MaxPartKeyBytes512 (512 B)Maximum byte size of a partition colocation key (PartKey)
MaxStreamKeyBytes512 (512 B)Maximum byte size of a StreamKey
MaxConsumerGroupBytes256 (256 B)Maximum length of a consumerGroup name in CommitCursor / GetCursor
MaxStreamHeaderBytes65536 (64 KiB)Maximum byte size of a stream message Header
InlineValueThreshold4096 (4 KiB)KV separation threshold: values > 4 KiB are written to ValueLog / .slog
MaxValueSizeLimit15 MiBUpper ceiling for configurable MaxValueSize (4 KiB .. 15 MiB)
MaxBatchOps10,000Maximum operations per Batch or Update transaction
MaxBatchBytes16 MiBMaximum total byte size of a single Batch, transaction, or WAL frame
MaxFramePayloadBytes20 MiBHard wire-protocol frame ceiling for SLDB (OOM protection)
Max2PCPartitions32Maximum distinct virtual partitions touched by one distributed Update transaction
DefaultStreamLimit / Max100 / 10,000Default and maximum page size for ReadStream
MinStrongSecretBytes32 bytesMinimum secret length when RequireStrongSecrets: true (≥ 8 unique bytes)
EncryptionKeyBytes32 bytesAES-256-GCM key size (32 raw bytes or 64 hex characters)

2. db.Config Struct Fields (Engine & Server)

Below are all db.Config fields with defaults from DefaultConfig(dataDir) and Validate() rules (applicable to both embedded and standalone modes):

db.Config FieldDefaultValid Range / RulesPurpose
DataDir— (required)Non-empty stringRoot directory path for node storage
ModeModeEmbeddedembedded, standalone, clusterRuntime mode (StartServer promotes empty/embedded to standalone)
NodeID1≥ 1 in cluster modeUnique 64-bit node identifier in a cluster
SyncModeSyncFullSyncFull (0), SyncFastOS (1)SyncFull: physical disk flush (fdatasync on Linux, F_FULLFSYNC on macOS); SyncFastOS: testing/staging mode
NumLocalShards16Power of two in 1..64Number of physical local shards under data/shards/
NumReplicaGroups64Multiple of NumLocalShards, 1..4096Number of Multi-Raft replica groups
WALSegmentBytes64 MiB≥ 256 KiBTarget size of a single wal_XXXXXX.log segment
WALMaxBatchBytes4 MiB64 KiB .. WALSegmentBytesBuffer size of one Group Commit pipeline arena
MaxRetainedWALBytes512 MiB≥ WALSegmentBytesMax retained WAL bytes per shard for lagging replicas before triggering InstallSnapshot
MemTableSizeBytes32 MiB256 KiB .. 512 MiBFlat MemTable arena size per shard
BlockCacheBytes256 MiB≥ 1 MiBNode-wide 64-sharded .sst block cache size
SSTBlockBytes16 KiB4 KiB .. 256 KiBTarget uncompressed data block size inside .sst files
VLogSegmentBytes128 MiB≥ 256 KiBTarget size of a single vlog_XXXXXX.dat segment
StreamSegmentBytes64 MiB≥ 256 KiBTarget size of a stream data segment slog_*.dat before sealing
StreamDedupCapacity409616 .. 1,000,000Per-stream persistent IdempKey deduplication ring capacity
MaxValueSize4 MiB4 KiB .. 15 MiBMaximum single KV value or stream Payload size
WatchBufferSize25616 .. 1,000,000Per-subscription event channel buffer capacity for Watch
BallastSizeBytes64 MiB≥ 0Preallocated reserve.ballast file size
DiskFreeMinBytes512 MiBuint64Absolute free disk threshold for tripping ErrDiskFull
DiskFreeMinPercent5.00.0 .. 95.0Percentage free disk threshold for tripping ErrDiskFull
DiskCheckInterval2s> 0Background statfs polling interval for DiskGuard
MaxSnapshotLifetime5m> 0Maximum lifetime of an open View or Scan snapshot (returns ErrSnapshotExpired on expiry)
LockTTL10s> 0Lease duration for 2PC KindTxLockIntent locks before zombie cleanup
MaxClockDrift500ms> 0Maximum tolerated HLC physical clock lead (exceeding returns ErrClockSkew)
ListenAddr":9110"host:portClient SLDB binary wire protocol and /healthz listen address
ClusterAddr":9111"host:portInter-node Multi-Raft, 2PC, and migration listen address
AdminAddr":9095"host:portAdmin HTTPS API and Prometheus metrics listen address
DefaultLanes8≥ 1Recommended multiplexed connection lane count
MaxTLSHandshakes64≥ 1Concurrent TLS 1.3 handshake semaphore limit per node
IPAllowlistPrivate CIDRsNon-empty in network modesAllowed IPv4/IPv6 CIDR list (rejects unlisted IPs via immediate TCP RST before TLS)
RequireStrongSecretsfalse (SDK), true (CLI)boolEnforce ≥ 32-byte secret length and at least 8 distinct bytes
ClientSecret / Fallback...""Required in standalone/clusterPrimary and fallback client secrets (must differ from Admin/Cluster)
AdminSecret / Fallback...""Required in standalone/clusterPrimary and fallback Admin HTTPS API Bearer tokens
ClusterSecret / Fallback...""Required in clusterPrimary and fallback inter-node Multi-Raft secrets
EncryptionKey / ...Filenil / ""Mutually exclusive, 32B raw or 64 hexEnables AES-256-GCM encryption at rest

Default DefaultIPAllowlist() subnets: 127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10 (CGNAT / Tailscale / Mesh), 169.254.0.0/16, ::1/128, fc00::/7, and fe80::/10.

3. Daemon CLI Flags and Environment Variables

When both a CLI flag and an environment variable are set, the CLI flag takes precedence (used by both the systemd service and the Docker container):

CLI FlagEnvironment VariableDefaultDescription
--version—falsePrint build version and exit with code 0
--healthcheck—""Probe HTTP/HTTPS /healthz URL and exit 0 (OK) or 1 (error)
--healthcheck-timeout—3sTimeout for --healthcheck probe
--healthcheck-insecure—falseSkip TLS certificate verification for non-loopback --healthcheck targets
--modeSLYBER_DB_MODEstandaloneDaemon mode: standalone or cluster
--node-idSLYBER_DB_NODE_ID1Unique node identifier (uint64)
--data-dirSLYBER_DB_DATA_DIR./dataRoot data storage directory
--addrSLYBER_DB_ADDR:9110Client SLDB bind address
--cluster-addrSLYBER_DB_CLUSTER_ADDR:9111Inter-node Multi-Raft bind address
--admin-addrSLYBER_DB_ADMIN_ADDR:9095Admin HTTPS API bind address
--sync-modeSLYBER_DB_SYNC_MODEfullDisk durability mode: full or fast (fast-os)
--shardsSLYBER_DB_SHARDS16Physical shard count (1..64, power of two)
--groupsSLYBER_DB_GROUPS64Replica group count (multiple of --shards)
--wal-segment-mbSLYBER_DB_WAL_SEGMENT_MB64WAL segment size in MiB (auto-scales MaxRetainedWALBytes to ≥ 2 × WALSegmentBytes)
--memtable-mbSLYBER_DB_MEMTABLE_MB32Per-shard MemTable size in MiB
--block-cache-mbSLYBER_DB_BLOCK_CACHE_MB256Node-wide BlockCache size in MiB
--ballast-mbSLYBER_DB_BALLAST_MB64Size of reserve.ballast in MiB
--disk-free-min-mbSLYBER_DB_DISK_FREE_MIN_MB512Minimum free disk space in MiB
--disk-free-min-pctSLYBER_DB_DISK_FREE_MIN_PCT5.0Minimum free disk space percentage
--max-tls-handshakesSLYBER_DB_MAX_TLS_HANDSHAKES64Concurrent TLS handshake limit
--allowlistSLYBER_DB_ALLOWLIST"" (private CIDRs)Comma-separated allowed CIDR ranges
--require-strong-secretsSLYBER_DB_REQUIRE_STRONG_SECRETStrueEnforce secret entropy and minimum 32-byte length
--client-secretSLYBER_DB_CLIENT_SECRET""Primary client secret string
--client-secret-fileSLYBER_DB_CLIENT_SECRET_FILE""Path to file containing the client secret
--fallback-client-secretsSLYBER_DB_FALLBACK_CLIENT_SECRETS""Comma-separated fallback client secrets
--admin-secretSLYBER_DB_ADMIN_SECRET""Primary admin Bearer secret
--admin-secret-fileSLYBER_DB_ADMIN_SECRET_FILE""Path to file containing the admin secret
--fallback-admin-secretsSLYBER_DB_FALLBACK_ADMIN_SECRETS""Comma-separated fallback admin secrets
--cluster-secretSLYBER_DB_CLUSTER_SECRET""Primary inter-node cluster secret
--cluster-secret-fileSLYBER_DB_CLUSTER_SECRET_FILE""Path to file containing the cluster secret
--fallback-cluster-secretsSLYBER_DB_FALLBACK_CLUSTER_SECRETS""Comma-separated fallback cluster secrets
--encryption-key-fileSLYBER_DB_ENCRYPTION_KEY_FILE""Path to AES-256-GCM key file (32 raw bytes or 64 hex chars)
--shutdown-timeoutSLYBER_DB_SHUTDOWN_TIMEOUT15sGraceful shutdown timeout on SIGINT/SIGTERM

Daemon exit codes:

  • 0 — clean shutdown on signal, --version output, or passing --healthcheck.
  • 1 — failed --healthcheck probe or error during graceful shutdown.
  • 2 — configuration validation, secret validation, or CLI flag parsing error.

4. db.ClientConfig Struct Fields (Go Network Client)

db.ClientConfig FieldDefaultPurpose
Addrs— (required)Seed node addresses ([]string); in ModeCluster, a single live seed is enough for auto-discovery via OpClusterNodes
ClientSecret— (required)Client secret for mutual TLS 1.3 EKM HMAC-SHA256 authentication
AdminAddr""Admin HTTPS address (host:9095) — required only when calling cli.Backup(...) or cli.Stats()
AdminSecret""Admin Bearer token for cli.Backup(...) and cli.Stats()
Lanes8Number of persistent multiplexed TLS 1.3 lanes per node (≥ 1)
DialTimeout5sTimeout for establishing TCP + TLS 1.3 + OpAuth
RequestTimeout15sDefault per-request timeout when ctx has no deadline
MaxRetries3Network retry count for idempotent operations on connection drop
MaxValueSize4 MiBClient-side value limit (4 KiB .. 15 MiB; should match server Config.MaxValueSize)
WatchBuffer256Local client-side event channel buffer size for Watcher
LockTTL10sLockExpiresAt lease applied by the client coordinator during distributed 2PC transactions
TLSConfig / DialContextAuto TLS 1.3 / net.DialerCustom TLS or network dialer configuration (e.g., proxy or corporate mTLS)