Skip to main content

Configuration

Orisun reads environment variables with the ORISUN_ prefix.

Configuration is shared across release binaries, Docker images, and embedded deployments that call config.InitializeConfig(). If you run the binary directly, set these variables in your shell, process supervisor, service manager, or platform secret store. The compiled defaults come from config/config.yaml.

Minimum Required Settings

VariableDescription
ORISUN_BACKENDpostgres, sqlite, or foundationdb; defaults to postgres.
ORISUN_ADMIN_BOUNDARYBoundary used for admin state.
ORISUN_ADMIN_PASSWORDBootstrap admin password. The default is for local development only.

For PostgreSQL-compatible backends, also set:

VariableDefaultDescription
ORISUN_PG_HOSTlocalhostPostgreSQL host.
ORISUN_PG_PORT5434PostgreSQL port.
ORISUN_PG_USERpostgresPostgreSQL user.
ORISUN_PG_PASSWORDpostgresPostgreSQL password.
ORISUN_PG_NAMEorisunPostgreSQL database.
ORISUN_PG_ADMIN_SCHEMAadminPostgreSQL schema containing the admin boundary. Application-boundary placements come from the catalog.
ORISUN_PG_SSLMODEdisablePostgreSQL SSL mode passed to the driver.
ORISUN_PG_DIALECTpostgresSQL dialect for the PostgreSQL-compatible backend. Use yugabyte for YugabyteDB; this selects committed-watermark visibility. YugabyteDB deployments must run v2025.2.3+ with LISTEN/NOTIFY enabled.

For YugabyteDB, use the PostgreSQL-compatible backend and set:

ORISUN_BACKEND=postgres
ORISUN_PG_DIALECT=yugabyte
ORISUN_PG_PORT=5433
ORISUN_PG_LISTEN_ENABLED=true

YugabyteDB must be v2025.2.3 or later and must enable LISTEN/NOTIFY on both Masters and TServers:

--master_flags=ysql_yb_enable_listen_notify=true
--tserver_flags=ysql_yb_enable_listen_notify=true

Orisun uses pg_notify for publisher wake-ups in YugabyteDB mode. Polling still protects delivery correctness, but writes require pg_notify to be available.

For SQLite, set:

VariableDefaultDescription
ORISUN_SQLITE_DIR./data/orisun/sqliteDirectory for per-boundary SQLite database files.
ORISUN_SQLITE_SYNCHRONOUSFULLRecommended SQLite durability mode. Use NORMAL only when you explicitly accept the power-loss durability tradeoff.
ORISUN_NATS_CLUSTER_ENABLEDfalseMust stay false for SQLite.

For FoundationDB beta deployments, set:

VariableDescription
ORISUN_FDB_CLUSTER_FILEFoundationDB cluster file path. Empty uses the client default.
ORISUN_FDB_API_VERSIONFoundationDB API version. Defaults to 730.
ORISUN_FDB_ROOTRoot tuple prefix for Orisun data. Defaults to orisun.
ORISUN_FDB_TRANSACTION_TIMEOUT_MSPer-transaction timeout including internal retries. Defaults to 10000; negative disables.
ORISUN_FDB_TRANSACTION_RETRY_LIMITMax internal retries per transaction. Defaults to 0 (unlimited; the timeout is the bound).

FoundationDB support is beta. It is compiled with -tags foundationdb and requires native FoundationDB client libraries on the host, unless you use the published orisun:fdb Docker image. Review the FDB-specific release notes before upgrading, because storage layout and operational defaults may still change while the backend hardens.

Boundary management

Boundaries are defined through the Admin CreateBoundary RPC and stored as lifecycle events in the admin boundary. They do not require a startup boundary list.

For PostgreSQL-compatible backends, ORISUN_PG_ADMIN_SCHEMA identifies the schema that contains the admin boundary:

ORISUN_PG_ADMIN_SCHEMA=admin

Application-boundary names and placements are replayed from the admin catalog. Create them with CreateBoundary; there is no startup application-boundary list. SQLite bootstraps only the admin boundary on a fresh installation. FoundationDB is beta; define its boundaries through CreateBoundary, using the configured ORISUN_FDB_ROOT as the namespace.

Boundary names must be valid PostgreSQL identifiers even when using SQLite: 1-63 characters, starting with a letter or underscore, then letters, digits, or underscores. This keeps boundary names portable across backends.

Upgrading existing boundaries into the catalog

Existing installations older than 0.8.0 must first complete the dedicated 0.7.0 to 0.8.0 upgrade. Do not skip 0.8.0: it is the bridge release that imports ORISUN_PG_SCHEMAS and other legacy boundary discovery sources into the durable catalog. Current PostgreSQL releases reject a pre-existing admin event store when that catalog marker is missing.

After the 0.8.0 catalog is verified, replace ORISUN_PG_SCHEMAS with ORISUN_PG_ADMIN_SCHEMA. ORISUN_BOUNDARIES remains removed.

For storage restored or attached after the upgrade, call CreateBoundary with existed_before_catalog: true.

Server settings

VariableDefaultDescription
ORISUN_GRPC_PORT5005gRPC API port.
ORISUN_GRPC_ENABLE_REFLECTIONtrueEnable gRPC reflection for tools such as grpcurl.
ORISUN_GRPC_CONNECTION_TIMEOUT60sServer connection timeout.
ORISUN_GRPC_KEEP_ALIVE_TIME30sServer keepalive ping interval.
ORISUN_GRPC_KEEP_ALIVE_TIMEOUT5sKeepalive ping timeout.
ORISUN_GRPC_MAX_CONCURRENT_STREAMS10000Maximum concurrent HTTP/2 streams per connection.
ORISUN_GRPC_MAX_RECEIVE_MESSAGE_SIZE67108864Maximum inbound gRPC message size, 64 MB by default.
ORISUN_GRPC_MAX_SEND_MESSAGE_SIZE67108864Maximum outbound gRPC message size, 64 MB by default.
ORISUN_GRPC_INITIAL_WINDOW_SIZE1048576HTTP/2 stream flow-control window, 1 MB by default.
ORISUN_GRPC_INITIAL_CONN_WINDOW_SIZE1048576HTTP/2 connection flow-control window, 1 MB by default.
ORISUN_GRPC_WRITE_BUFFER_SIZE65536gRPC write buffer size.
ORISUN_GRPC_READ_BUFFER_SIZE65536gRPC read buffer size.
ORISUN_GRPC_KEEPALIVE_MIN_TIME5sMinimum client keepalive interval accepted by the server.
ORISUN_GRPC_KEEPALIVE_PERMIT_WITHOUT_STREAMtrueAllow client keepalive pings without active streams.
ORISUN_ADMIN_PORT8991Admin HTTP port.
ORISUN_ADMIN_USERNAMEadminBootstrap admin username.
ORISUN_ADMIN_PASSWORDchangeitBootstrap admin password.
ORISUN_LOGGING_LEVELINFODEBUG, INFO, WARN, or ERROR.
ORISUN_POLLING_PUBLISHER_BATCH_SIZE1000Max events drained per publisher read batch.

SQLite settings

VariableDefaultDescription
ORISUN_SQLITE_DIR./data/orisun/sqliteDirectory containing one {boundary}.db event-log file and one {boundary}_metadata.db file per boundary. Metadata files hold publisher checkpoints, projector checkpoints, admin users, and count caches.
ORISUN_SQLITE_SYNCHRONOUSFULLRecommended SQLite synchronous mode. FULL makes acknowledged WAL commits durable across OS crashes and power loss. NORMAL can improve write throughput, but acknowledged commits may be lost until a checkpoint reaches durable storage; use it only as an explicit, measured opt-out.
ORISUN_SQLITE_BUSY_TIMEOUT_MS5000Busy timeout for contended SQLite operations.
ORISUN_SQLITE_READ_POOL_SIZE0Read pool size. 0 lets Orisun choose a CPU-based default.
ORISUN_SQLITE_CACHE_SIZE0SQLite cache size override.
ORISUN_SQLITE_MMAP_SIZE0SQLite mmap size override.
ORISUN_SQLITE_WAL_AUTO_CHECKPOINT0SQLite WAL auto-checkpoint override.
ORISUN_SQLITE_TEMP_STOREMEMORYSQLite temp-store mode.
ORISUN_SQLITE_PUBLISHER_WAKE_DELAY5msCoalesce publisher wake-ups after SQLite commits so write bursts can drain before publisher read/checkpoint work starts. Set 0s for immediate wake-ups; polling still protects delivery correctness.
ORISUN_SQLITE_GC_MAX_BATCH_REQUESTS128Maximum SaveEvents requests flushed by one SQLite group-commit batch.
ORISUN_SQLITE_GC_MAX_BATCH_EVENTS1024Maximum events flushed by one SQLite group-commit batch. A request that would exceed the cap is carried to the next flush.
ORISUN_SQLITE_GC_MAX_DELAY0sOptional wait to fill a SQLite group-commit batch. 0s keeps batching opportunistic.
ORISUN_SQLITE_GC_MAX_PENDING4096Per-boundary queued SaveEvents request capacity before callers block.
ORISUN_SQLITE_GC_FLUSH_TIMEOUT30sTimeout for one SQLite group-commit flush.

PostgreSQL-compatible pool settings

Orisun uses separate PostgreSQL-compatible pools for writes, reads, and admin work. Size their combined open connections below the database connection limit or the PgBouncer pool size.

VariableDefaultDescription
ORISUN_PG_LISTEN_ENABLEDtrueUse PostgreSQL LISTEN/NOTIFY wake-ups. Polling still protects correctness when notifications are delayed or missed.
ORISUN_PG_WRITE_MAX_OPEN_CONNS25Write pool open-connection cap.
ORISUN_PG_WRITE_MAX_IDLE_CONNS10Write pool idle-connection cap.
ORISUN_PG_WRITE_CONN_MAX_IDLE_TIME5mWrite pool idle lifetime.
ORISUN_PG_WRITE_CONN_MAX_LIFETIME30mWrite pool max connection lifetime.
ORISUN_PG_READ_MAX_OPEN_CONNS50Read pool open-connection cap.
ORISUN_PG_READ_MAX_IDLE_CONNS25Read pool idle-connection cap.
ORISUN_PG_READ_CONN_MAX_IDLE_TIME5mRead pool idle lifetime.
ORISUN_PG_READ_CONN_MAX_LIFETIME30mRead pool max connection lifetime.
ORISUN_PG_ADMIN_MAX_OPEN_CONNS5Admin pool open-connection cap.
ORISUN_PG_ADMIN_MAX_IDLE_CONNS2Admin pool idle-connection cap.
ORISUN_PG_ADMIN_CONN_MAX_IDLE_TIME5mAdmin pool idle lifetime.
ORISUN_PG_ADMIN_CONN_MAX_LIFETIME30mAdmin pool max connection lifetime.

NATS settings

VariableDefaultDescription
ORISUN_NATS_URLemptyExternal JetStream-enabled NATS URL. When set, Orisun connects to it instead of starting embedded NATS.
ORISUN_NATS_SERVER_NAMEorisun-nats-2Embedded NATS server name. Use a unique value per clustered node.
ORISUN_NATS_PORT4224Embedded NATS client port.
ORISUN_NATS_MAX_PAYLOAD1048576NATS max payload.
ORISUN_NATS_STORE_DIR./data/orisun/natsNATS data directory.
ORISUN_NATS_EVENT_STREAM_MAX_BYTES536870912Per-boundary event stream memory cap.
ORISUN_NATS_EVENT_STREAM_MAX_MSGS-1Per-boundary event stream message cap.
ORISUN_NATS_EVENT_STREAM_MAX_AGE5mRetention overlap for catch-up subscribers.
ORISUN_NATS_PUBLISH_ASYNC_MAX_PENDING8192In-flight async publish acknowledgements.

TLS settings

VariableDefault
ORISUN_GRPC_TLS_ENABLEDfalse
ORISUN_GRPC_TLS_CERT_FILE/etc/orisun/tls/server.crt
ORISUN_GRPC_TLS_KEY_FILE/etc/orisun/tls/server.key
ORISUN_GRPC_TLS_CA_FILE/etc/orisun/tls/ca.crt
ORISUN_GRPC_TLS_CLIENT_AUTH_REQUIREDfalse

Telemetry and profiling

VariableDefaultDescription
ORISUN_OTEL_ENABLEDtrueEnable OpenTelemetry tracing.
ORISUN_OTEL_ENDPOINTlocalhost:4317OTLP gRPC endpoint.
ORISUN_OTEL_SERVICE_NAMEorisunService name attached to exported traces.
ORISUN_PPROF_ENABLEDfalseEnable pprof.
ORISUN_PPROF_PORT6060pprof port.

Cluster settings

VariableDefault
ORISUN_NATS_CLUSTER_ENABLEDfalse
ORISUN_NATS_CLUSTER_NAMEorisun-nats-cluster
ORISUN_NATS_CLUSTER_HOST0.0.0.0
ORISUN_NATS_CLUSTER_PORT6222
ORISUN_NATS_CLUSTER_ROUTESnats://0.0.0.0:6223,nats://0.0.0.0:6224
ORISUN_NATS_CLUSTER_USERNAMEnats
ORISUN_NATS_CLUSTER_PASSWORDpassword@1
ORISUN_NATS_CLUSTER_TIMEOUT1800s

Clustered Orisun deployments require the PostgreSQL backend. SQLite startup fails when ORISUN_NATS_CLUSTER_ENABLED=true.