Skip to main content

Configuration

SereneDB is configured via command-line options or a configuration file. All options can be passed as --section.option value on the command line or set in a JSON configuration file.

Using a configuration file

serened --configuration /etc/serenedb/serened.conf

The configuration file uses JSON format:

{
"database": {
"directory": "/var/lib/serenedb"
},
"server": {
"endpoint": ["pgsql+tcp://0.0.0.0:7890"]
}
}

Common options

The most frequently used options for getting started:

OptionDefaultDescription
--database.directory/var/lib/serenedbPath to the database directory
--server.endpointpgsql+tcp://127.0.0.1:7890Server endpoint (e.g., pgsql+tcp://0.0.0.0:7890)
--log.levelinfoLog level: fatal, error, warning, info, debug, trace
--log.outputLog destination (e.g., file:///var/log/serenedb/serened.log)
--temp.pathPath for temporary files

Example: start with custom port and data directory

serened --database.directory /data/serenedb --server.endpoint pgsql+tcp://0.0.0.0:7890

Database

OptionTypeDefaultDescription
--database.directorystring/var/lib/serenedbPath to the database directory
--database.auto-upgradebooleanfalsePerform a database upgrade if necessary
--database.required-directory-statestringanyRequired state of the database directory at startup (non-existing, existing, empty, populated, any)

Server

OptionTypeDefaultDescription
--server.endpointstringpgsql+tcp://127.0.0.1:7890Endpoint for client requests
--server.io-threadsuint648Number of threads for I/O
--server.maximal-threadsuint640Maximum request handling threads (0 = auto, default 64)
--server.maximal-queue-sizeuint644096Request queue size
--server.authenticationbooleantrueEnable authentication for client requests
--server.jwt-secret-keyfilestringFile containing the JWT secret for authentication
--server.hardenbooleanfalseLock down APIs that reveal version/internals for non-admin users
--server.statisticsbooleanfalseEnable statistics gathering and APIs
OptionTypeDefaultDescription
--search.commit-threadsuint320Upper limit for commit threads (0 = auto)
--search.consolidation-threadsuint320Upper limit for consolidation threads (0 = auto)
--search.default-parallelismuint321Default parallelism for search queries
--search.execution-threads-limituint320Maximum threads for processing search indexes during queries

Logging

OptionTypeDefaultDescription
--log.levelstringinfoLog level per topic. Use --log.level topic=level for specific topics
--log.outputstringLog destination (e.g., file:///var/log/serenedb/serened.log)
--log.use-json-formatbooleanfalseUse JSON format for log output
--log.colorbooleantrueUse colors for TTY logging
--log.time-formatstringutc-datestring-microsTime format in logs

Available log levels: fatal, error, warning, info, debug, trace

RocksDB (storage engine)

Options for tuning the underlying RocksDB storage engine. Most defaults are suitable for general use.

Memory

OptionTypeDefaultDescription
--rocksdb.block-cache-sizeuint64autoSize of block cache in bytes
--rocksdb.write-buffer-sizeuint6467108864 (64 MB)Data to build up in memory before flushing to disk
--rocksdb.max-write-buffer-numberuint644Maximum write buffers in memory
--rocksdb.total-write-buffer-sizeuint64autoMaximum total size of write buffers

Compaction

OptionTypeDefaultDescription
--rocksdb.compaction-stylestringlevelCompaction style (level, others are experimental)
--rocksdb.compression-typestringlz4Compression algorithm
--rocksdb.max-parallel-compactionsuint642Maximum parallel compaction jobs
--rocksdb.max-subcompactionsuint324Maximum concurrent sub-jobs per compaction
--rocksdb.level0-compaction-triggerint642Number of level-0 files that triggers compaction
--rocksdb.target-file-size-baseuint6467108864 (64 MB)Target file size for compaction

WAL

OptionTypeDefaultDescription
--rocksdb.wal-directorystringAbsolute path for WAL files (default: journals/ inside database directory)
--rocksdb.max-total-wal-sizeuint64268435456 (256 MB)Maximum total WAL size before forcing a flush
--rocksdb.sync-intervaluint64100Interval for automatic disk syncs in milliseconds (0 = off)

Disk

OptionTypeDefaultDescription
--rocksdb.minimum-disk-free-bytesuint6416777216 (16 MB)Minimum free disk bytes for healthy status (0 = disable)
--rocksdb.minimum-disk-free-percentdouble0.01Minimum free disk percentage for healthy status (0 = disable)

SSL/TLS

OptionTypeDefaultDescription
--ssl.keyfilestringKeyfile for secure connections
--ssl.cafilestringCA file for secure connections
--ssl.protocoluint649SSL protocol (5 = TLSv1.2, 6 = TLSv1.3, 9 = generic TLS negotiated)
--ssl.cipher-liststringHIGH:!EXPORT:!aNULL@STRENGTHSSL ciphers to use

All options

To see all available options including hidden and advanced ones:

serened --help
serened --dump-options