Skip to main content

Configuration

ONQL is configured via environment variables. All settings have sensible defaults — you only need to set the ones you care about.

Environment variables

VariableDefaultPurpose
ONQL_PORT5656TCP port the server listens on
DB_PATH./storeWhere data files are written
FLUSH_INTERVAL500msHow often the in-memory buffer is flushed to disk
LOG_LEVELINFODEBUG, INFO, WARN, or ERROR
MAX_CONNECTIONS1000Max simultaneous TCP clients
BUFFER_SIZE_MB64RAM buffer per database

Example

ONQL_PORT=9000 \
DB_PATH=/var/lib/onql \
LOG_LEVEL=DEBUG \
./onql

Inside Docker

docker run -p 9000:9000 \
-e ONQL_PORT=9000 \
-e LOG_LEVEL=DEBUG \
-v $(pwd)/data:/data \
onql/onql:latest

Configuration file (optional)

If you prefer, drop a config.toml next to the binary:

[server]
port = 5656
max_connections = 1000

[storage]
path = "./store"
flush_interval = "500ms"
buffer_size_mb = 64

[log]
level = "INFO"

Environment variables always override the file.