Environment Variables
Here we provide a complete list of environment variables that can be used to configure the daemon. These variables allow you to customize various aspects of the daemon's behavior, including database connections, storage options and more.
A variable set to an empty value (e.g. MOSAICOD_STORE_BUCKET=) is treated as unset: it does not override the config file value, and falls through to it or to the default instead.
General
-
MOSAICOD_GRPC_MAX_DECODE_MESSAGE_SIZE: The maximum allowed size, in bytes, of an incoming gRPC message (the server's decode limit). If a message exceeds this size, a protocol error will be returned. Default is50 MiB. Must be between4 MiBand512 MiB. If you need to update this value be aware that it is tipically smaller thanMOSAICOD_PARQUET_IN_MEMORY_ENCODING_BUFFER_SIZE. The server's outgoing message size is fixed independently of this value, so lowering it later never affects the retrievability of previously-accepted data. -
MOSAICOD_GRPC_TARGET_ENCODE_MESSAGE_SIZE: Target message size in bytes used during data streaming. The daemon will try to aggregate a number ofRecordBatchesto create a sufficiently large message. If the resulting batch size exceeds the limit, it will be capped byMOSAICOD_MAX_BATCH_SIZE. Defaults to25 MiB. -
MOSAICOD_MAX_CONCURRENT_WRITES: The maximum number of concurrent encoding and serialization operations. This setting controls how many data batches can be processed and sent to the object store simultaneously. It is important to note that this does not limit the number of topics the server can handle; rather, it constrains the parallel execution of the encoding/serialization pipeline. Each operation runs in a dedicated thread to handle CPU-bound compression and I/O-bound storage tasks. This value should be tuned based on available RAM and CPU. Excessive parallelism may lead to scheduler thrashing or memory exhaustion. Must be greater than0. Defaults toMOSAICOD_DEFAULT_PARALLELISM. -
MOSAICOD_MAX_CONCURRENT_CHUNK_QUERIES: Maximum number of concurrent queries that can be executed against data chunks. Must be greater than0. Default is4. -
MOSAICOD_MAX_BATCH_SIZE: Maximum batch size (number of elements inside an ArrowRecordBatch) used during data streaming. Must be greater than0. Defaults to DataFusion default batch size8192. -
MOSAICOD_DEFAULT_PARALLELISM: Sets the default degree of parallelism. While this is typically detected automatically based on available hardware, this field allows for a manual override in environments where automatic detection might fail or be inaccurate. Must be greater than0. Defaults to the number of CPUs available to the process; if it is not set and detection fails,mosaicodfails to start. Currently it only affectsMOSAICOD_MAX_CONCURRENT_WRITESdefault fallback. -
MOSAICOD_QUERY_ENGINE_MEMORY_POOL_SIZE: Defines the amount of memory (in bytes) used by the query engine. Set this value to a number greater than 0 to enforce a hard limit on the memory allocated by the query engine. Use this setting if mosaicod encounters OOM (Out Of Memory) errors or you plan to usemosaicodin a memory constrained environment. Defaults to0(no limit). -
MOSAICOD_PARQUET_IN_MEMORY_ENCODING_BUFFER_SIZE: Size (in bytes) of the in-memory buffer used for encoding parquet data. Defaults to70 MiB. -
MOSAICOD_MAX_SIZE_PLAIN_LIST_EQ: Maximum number of elements unrolled when decomposing a listeq/neqfilter into per-element scalar comparisons. Queries with a filter whose value array exceeds this limit are rejected with a bad request error, to avoid generating pathologically large query expressions. Must be greater than0. Defaults to1024.
Logging
-
MOSAICOD_LOG_LEVEL: Log verbosity level. One ofwarning,info,debug. Defaults towarning. Overridden by the--log-levelCLI argument if set, and ignored ifRUST_LOGis set. -
MOSAICOD_LOG_FORMAT: Log output format. One ofjson,pretty,plain. Defaults topretty. Overridden by the--log-formatCLI argument if set.
Server
-
MOSAICOD_HOST: Host address the server listens on. Defaults to the loopback address127.0.0.1. Overridden by the--hostCLI argument of theservercommand if set. -
MOSAICOD_PORT: Port the server listens on. Must be greater than0. Defaults to6726. Overridden by the--portCLI argument of theservercommand if set. -
MOSAICOD_GZIP_ENABLED: Whether gzip compression is enabled for gRPC requests and responses. Default isfalse. -
MOSAICOD_API_KEY_ENABLED: Whether API key enforcement is enabled. See themosaicod api-keycommand. Default isfalse.
TLS
-
MOSAICOD_TLS_ENABLED: Whether TLS is enabled for the server. RequiresMOSAICOD_TLS_CERT_FILEandMOSAICOD_TLS_PRIVATE_KEY_FILEto be set. Default isfalse. -
MOSAICOD_TLS_CERT_FILE: Path to the TLS certificate file used for secure communication. Default is an empty string. -
MOSAICOD_TLS_PRIVATE_KEY_FILE: Path to the TLS private key file used for secure communication. Default is an empty string.
DBMS
-
MOSAICOD_DB_URL: Database connection URL, without credentials (e.g.postgresql://host:port/dbname). UseMOSAICOD_DB_USERandMOSAICOD_DB_PASSWORDto provide credentials. TLS is configured through the standard PostgreSQL URL parameterssslmode,sslrootcert,sslcertandsslkey. Required. -
MOSAICOD_DB_USER: Database user used to establish the connection. Default is an empty string, as some databases do not require a user to be specified. -
MOSAICOD_DB_PASSWORD: Database password used to establish the connection. Default is an empty string, as some databases do not require a password to be specified. May also be provided viaMOSAICOD_DB_PASSWORD_FILE, set to the path of a file containing the password, instead of setting it directly; setting bothMOSAICOD_DB_PASSWORDandMOSAICOD_DB_PASSWORD_FILEis an error. Trailing newlines in the file are ignored; any other whitespace is kept and considered part of the password. -
MOSAICOD_MAX_DB_CONNECTIONS: Maximum number of database connections that can be established. Must be greater than0. Default is10.
Store
-
MOSAICOD_STORE_ENDPOINT: Endpoint URL for the object storage service (e.g., S3). Usefile:///some/absolute/pathto set up a local storage directory. Required. -
MOSAICOD_STORE_BUCKET: Name of the bucket in the object storage service where data will be stored. When using the local filesystem endpoint, the system creates a new directory named after the bucket within the endpoint path. May only contain ASCII letters, digits,.and-, and cannot be.or... Required. -
MOSAICOD_STORE_REGION: Region where the bucket is located (e.g.eu-south-1). Region is a general concept shared by many cloud storage services. For example, an S3 store uses it to sign requests, so on AWS it must match the region of the bucket. It is ignored when using the local filesystem endpoint. When empty, the object store client default (us-east-1) is used. Must not contain whitespace, control characters or/. Default is an empty string. -
MOSAICOD_STORE_ACCESS_KEY: Access key for the object storage service. Optional with S3-compatible endpoints: when omitted (along with the secret key), the daemon uses the credentials of the EC2 instance role. If static keys are used, bothMOSAICOD_STORE_ACCESS_KEYandMOSAICOD_STORE_SECRET_KEYmust be set. Must not contain whitespace, control characters or,. Default is an empty string. -
MOSAICOD_STORE_SECRET_KEY: Secret key for the object storage service. Optional with S3-compatible endpoints: when omitted (along with the access key), the daemon uses the credentials of the EC2 instance role. Must not start or end with whitespace. Default is an empty string. May also be provided viaMOSAICOD_STORE_SECRET_KEY_FILE, set to the path of a file containing the secret key, instead of setting it directly; setting bothMOSAICOD_STORE_SECRET_KEYandMOSAICOD_STORE_SECRET_KEY_FILEis an error. Trailing newlines in the file are ignored. -
MOSAICOD_STORE_CONNECTION_TIMEOUT: Timeout, in seconds, for the startup store connectivity check. At startup, the daemon validates store connectivity and credentials; if the check does not complete within this period, startup aborts. Must be greater than0. Defaults to5.
Cleanup
-
MOSAICOD_CLEANUP_TIME_INTERVAL: Minimum interval, in seconds, that must pass between a cleanup run and the next one. When set to0a single cleanup is performed and then the process terminates; any value greater than0runs the cleanup routine in a loop. Defaults to0. Overridden by the--time-intervalCLI argument of thecleanupcommand if set. -
MOSAICOD_CLEANUP_RETENTION_DURATION: Maximum period, in seconds, an obsolete file is kept in the store before being permanently deleted. Defaults to86400. Overridden by the--retention-durationCLI argument of thecleanupcommand if set.
Store Optimizer
-
MOSAICOD_STORE_OPTIMIZER_MEMORY_POOL_SIZE: Defines the amount of memory (in bytes) used by the store optimizer routine. Set this value to a number greater than 0 to enforce a hard limit on the memory it allocates. Use this setting ifmosaicod store-optimizerencounters OOM (Out Of Memory) errors or you plan to run it in a memory constrained environment. Defaults to0(no limit). -
MOSAICOD_STORE_OPTIMIZER_TIME_INTERVAL: Minimum interval, in seconds, that must pass between a store optimization run and the next one. When set to0a single run is performed and then the process terminates; any value greater than0runs the routine in a loop. Defaults to0. Overridden by the--time-intervalCLI argument of thestore-optimizercommand if set. -
MOSAICOD_STORE_OPTIMIZER_MAX_CHUNK_SIZE: Maximum size (in bytes) for an output chunk after optimization. This is a soft limit, actual files on store may exceed this value slightly. Must be greater than0. Defaults to256 MiB. Overridden by the--max-chunk-sizeCLI argument of thestore-optimizercommand if set.