Skip to main content

Configuration

ScramDB is configured via environment variables or a configuration file.

Environment Variables

Memory

VariableDefaultDescription
SCRAMDB_MEMORY_LIMIT4GMaximum memory for buffer pool and execution
SCRAMDB_BUFFER_POOL_SIZEAutoBuffer pool size (defaults to 70% of memory limit)

Execution

VariableDefaultDescription
SCRAMDB_WORKERSAutoNumber of parallel worker threads (default: CPU cores)
SCRAMDB_MORSEL_SIZE4MBBase morsel size for parallel work units
SCRAMDB_JIT_ENABLEDtrueEnable JIT compilation
SCRAMDB_JIT_THRESHOLD1Executions before triggering JIT

Storage

VariableDefaultDescription
SCRAMDB_DATA_DIR/var/lib/scramdbData directory
SCRAMDB_WAL_DIR{data_dir}/walWAL directory
SCRAMDB_WAL_SYNCtrueFsync WAL writes
SCRAMDB_PAGE_SIZE16384Page size in bytes (16KB)

Network

VariableDefaultDescription
SCRAMDB_PORT5432PostgreSQL wire protocol listen port
SCRAMDB_HOST0.0.0.0Listen address
SCRAMDB_MAX_CONNECTIONS256Maximum concurrent connections

Logging

VariableDefaultDescription
SCRAMDB_LOG_LEVELinfoLog level: trace, debug, info, warn, error

Config File

ScramDB also reads from scramdb.toml in the data directory:

[memory]
limit = "8G"

[execution]
workers = 8
jit_enabled = true

[storage]
data_dir = "/var/lib/scramdb"
wal_sync = true

[network]
port = 5432
max_connections = 256

Environment variables take precedence over config file values.