Configuration and settings

sxs has two distinct configuration layers:

  • Global variables configure the process, database connections, buckets, AMQP, authentication and logging. They are read at boot and cannot vary by space.
  • Settings are runtime switches exposed through the settings service. They have an environment default and can usually be overridden per space in the tenant configuration.

A variable in .env is not automatically a setting. Most .env entries are global variables; only the entries listed in the settings table below are handled by the settings service.

LayerExampleCan vary by space?Change requires restart?
Global variableMONGODB_URLNoYes
Setting — env levelWORKER_OBS_COUNT_LIMITYes, unless a truthy env value is setYes
Setting — space levelworkerObsCountLimitYesNo; tenant config refreshes
Setting — annotationDISALLOW_AVAILABILITY_REQUESTSYes, per datasetNo
Benchmark variableBENCH_BULK_OBSNoYes

Global variables

Global variables are read by src/server/init/config.js, src/server/debug.js and the resource initialization modules. Changing them requires a process restart.

VariableDefaultDescription
SERVER_HOST0.0.0.0HTTP listen address
SERVER_PORT80HTTP listen port
SERVICE_NAMEsxsApplication name used in logs
NODE_ENVunsetproduction enables production mode; test silences logs
OPS_ENVunsetDeployment environment label
GIT_HASHunsetGit revision reported by health endpoints
DEFAULT_MEMBERunsetDefault member/tenant
CONFIG_URLunsetConfig service base URL serving /configs/tenants.json
MODESunsetComma-separated capacities: sdmx, rpc, loader, workers, exports
AUTH_SERVICE_NAMEauthAuthentication RPC service name
ALLOW_E2E_TESTSfalseEnables E2E-only test routes

See sxs, lxs and wxs for how MODES selects the work a process is allowed to perform. A process without exports in MODES is export producer-only; the export consumer runs where exports is enabled. Likewise, a process without workers uses the remote wxs worker queue.

MODES selects capacities, not request classification or execution modes. A process without workers still serves normal and bulk-resource requests; it dispatches eligible worker execution to wxs. See Execution modes and resource profiles.

MongoDB

VariableDefaultDescription
MONGODB_URLmongodb://localhost:27017MongoDB connection URL
MONGODB_DATABASEsxsBase MongoDB database name

ClickHouse

VariableDefaultDescription
CLICKHOUSE_URLhttp://localhost:8123ClickHouse HTTP endpoint; comma-separated for multiple nodes
CLICKHOUSE_CLUSTERunsetClickHouse cluster name
KEEPERS_URLunsetClickHouse Keeper endpoint(s) for cluster checks

AMQP

VariableDefaultDescription
AMQP_URLunsetRabbitMQ/AMQP URL; AMQP is disabled when unset
AMQP_DBMX_EXCHANGEunsetExchange used for RPCs and events
AMQP_RECONNECTunsetJSON reconnect policy, e.g. {"initialDelayMs":500,"maxDelayMs":30000,"maxAttempts":10}

Buckets

VariableDefaultDescription
BUCKET_PROVIDERunsetminio, gke or azure
DATA_BUCKETunsetDefault data bucket
MEMBER_DATA_BUCKETSunsetMember bucket pattern; * is replaced by member id

MinIO

VariableDefaultDescription
MINIO_ENDPOINTunsetMinIO host
MINIO_PORTunsetMinIO port
MINIO_ACCESS_KEYunsetMinIO access key
MINIO_SECRET_KEYunsetMinIO secret key
BUCKET_HMAC_KEYMINIO_ACCESS_KEYOptional bucket signing key
BUCKET_HMAC_SECRETMINIO_SECRET_KEYOptional bucket signing secret

Google Cloud Storage

VariableDefaultDescription
GKE_KEY_FILEunsetOptional service-account key file
GOOGLE_CLOUD_PROJECTunsetGCS project
BUCKET_HMAC_KEYGCP_BUCKET_HMAC_KEYOptional signing key
BUCKET_HMAC_SECRETGCP_BUCKET_HMAC_SECRETOptional signing secret
GCP_BUCKET_HMAC_KEYunsetGCS-specific signing key fallback
GCP_BUCKET_HMAC_SECRETunsetGCS-specific signing secret fallback

Azure Blob Storage

VariableDefaultDescription
ACCOUNT_NAMEunsetAzure storage account name
ACCOUNT_KEYunsetAzure storage account key
SASunsetAzure SAS token
CONTAINER_NAMEunsetAzure container name
STORAGE_ACCOUNT_URLunsetAzure storage account URL

Authentication and integrations

VariableDefaultDescription
OIDC_URIunsetOIDC authority URL
GOOGLE_APP_CLIENT_IDunsetGoogle OAuth client ID
GOOGLE_APP_SECRET_IDunsetGoogle OAuth client secret

Logging

VariableDefaultDescription
DBGunsettrue/1 enables debug logs
LOGGING_LEVELinfoPino log level
LOGGING_DRIVERunsetSet gke for Google Cloud logging
LOGGING_PROJECT_IDunsetGCP project for logging
LOGGING_LOGNAMEunsetGCP log name
LOGGING_PRETTYunsettrue/1 forces pretty logs in production
APP_NAMEdbmx:sxsLogger name prefix

Settings

Settings are registered in src/server/init/settings.js. Each setting has:

  • an environment variable (envId);
  • a camelCase property used in the tenant's space configuration;
  • an optional default;
  • an optional dataset-annotation override.

The space property is the lower-cased env name camelized. For example:

WORKER_OBS_COUNT_LIMIT -> workerObsCountLimit
BULK_OBS_COUNT_LIMIT -> bulkObsCountLimit
SYNC_MAX_OBSERVATIONS -> syncMaxObservations
ALLOW_NATIVE_CSV -> allowNativeCsv
WORKER_POOL_QUEUE_SIZE -> workerPoolQueueSize

A space override is written in the space object of the tenant configuration:

{
  "spaces": {
    "collect": {
      "workerObsCountLimit": 10000,
      "bulkObsCountLimit": 50000,
      "syncMaxObservations": 5000000,
      "allowNativeCsv": true,
      "allowToDeleteActiveDatasets": true
    }
  }
}

Scope and precedence

ScopeMeaning
Global + spaceEnvironment value is the process default; a space property can override it when no truthy environment value is active
Global onlyRead once at pool/boot initialization; space overrides are not used
Global + space + annotationEnvironment, space property, or dataset annotation can enable it

Precedence when reading a setting:

  1. environment value (a numeric zero is a valid threshold value);
  2. space property (a numeric zero is a valid threshold value);
  3. dataset annotation, when supported;
  4. default value.

Environment settings are read at boot. Space settings are read from the current tenant configuration, which is refreshed periodically. Worker settings are global-only because the worker pool is created once per process.

Settings reference

VariableSpace propertyType / defaultScopeDescription
CH_CREATE_MULTIPLE_PROJECTIONSchCreateMultipleProjectionsbool / unsetGlobal + spaceCreate one ClickHouse projection per dimension
CH_NO_KEYchNoKeybool / trueGlobal + spaceDo not materialize __key__ in datasets
ALLOW_NATIVE_CSVallowNativeCsvbool / falseGlobal + spaceUse ClickHouse-native CSV for format=csv
JSON_DECIMAL_AS_STRINGjsonDecimalAsStringbool / falseGlobal + spaceEmit decimals as strings in JSON
ALLOW_DRAFT_DATASETSallowDraftDatasetsbool / unsetGlobal + spaceAllow access to unpublished datasets
DISALLOW_MSD_DSD_ATTR_VALIDATIONdisallowMsdDsdAttrValidationbool / unsetGlobal + spaceSkip MSD/DSD attribute validation
DISALLOW_MANY_DATA_REQUESTSdisallowManyDataRequestsbool / unsetGlobal + spaceReject multi-resource data requests
DISALLOW_MANY_STRUCTURE_REQUESTSdisallowManyStructureRequestsbool / unsetGlobal + spaceReject multi-resource structure requests
DISALLOW_DATA_SERIES_REQUESTSdisallowDataSeriesRequestsbool / unsetGlobal + spaceReject series data requests
ALLOW_TO_DELETE_STABLE_ARTEFACTSallowToDeleteStableArtefactsbool / unsetGlobal + spaceAllow deleting stable artefacts
ALLOW_TO_DELETE_ACTIVE_DATASETSallowToDeleteActiveDatasetsbool / unsetGlobal + spaceAllow deleting active datasets
NO_SCHEMA_VALIDATIONnoSchemaValidationbool / unsetGlobal + spaceSkip SDMX schema validation
WORKER_OBS_COUNT_LIMITworkerObsCountLimitint / unset (infinite)Global + spaceAbove this result size, use worker execution
BULK_OBS_COUNT_LIMITbulkObsCountLimitint / unset (infinite)Global + spaceAbove this result size, use the bulk resource profile
SYNC_MAX_OBSERVATIONSsyncMaxObservationsint / 5000000Global + spaceMaximum observations in a synchronous data response; above it, return 413
WORKERS_ENABLEDworkersEnabledbool / trueGlobal onlyEnable worker execution, local pool and remote wxs dispatch
WORKER_POOL_ENABLEDworkerPoolEnabledbool / trueGlobal onlyEnable the local worker pool when workers capacity is enabled
WORKER_POOL_COUNTworkerPoolCountint / computedGlobal onlyMaximum workers per process
WORKER_POOL_QUEUE_SIZEworkerPoolQueueSizeint / 20Global onlyMaximum queued worker jobs
WORKER_POOL_MAX_PER_SPACEworkerPoolMaxPerSpaceint / 1Global onlyConcurrent worker jobs per space
WORKER_POOL_MAX_JOBSworkerPoolMaxJobsint / 20Global onlyJobs per worker before recycling
WORKER_POOL_MEMORY_MBworkerPoolMemoryMbint / 512Global onlyWorker old-generation heap limit
EXPORT_WORKER_COUNTexportWorkerCountint / 2Global onlyMaximum concurrent exports per process
EXPORT_QUEUE_SIZEexportQueueSizeint / 100Global onlyMaximum pending and processing exports before 429
EXPORT_MAX_PER_SPACEexportMaxPerSpaceint / 1Global onlyConcurrent exports per space
EXPORT_MAX_PER_MEMBERexportMaxPerMemberint / 2Global onlyConcurrent exports per member
EXPORT_MAX_PER_USERexportMaxPerUserint / 1Global onlyConcurrent exports per requester
EXPORT_MAX_OBSERVATIONSexportMaxObservationsint / 500000000Global + spaceMaximum observations in one export
EXPORT_MAX_FILE_MBexportMaxFileMbint / 10240Global + spaceMaximum export file size
EXPORT_RETENTION_DAYSexportRetentionDaysint / 7Global onlyObject-file retention
EXPORT_HISTORY_DAYSexportHistoryDaysint / 365Global onlyExport record retention
EXPORT_LEASE_SECONDSexportLeaseSecondsint / 300Global onlyProcessing lease duration
EXPORT_QUEUE_POLL_MSexportQueuePollMsint / 1000Global onlyExport queue polling interval
EXPORT_WORKER_MAX_JOBSexportWorkerMaxJobsint / 20Global onlyExports per worker before recycling
EXPORT_WORKER_MEMORY_MBexportWorkerMemoryMbint / 512Global onlyExport worker old-generation heap limit
INGESTION_LEASE_SECONDS—int / 300Global onlyLease duration for a claimed ingestion
INGESTION_LEASE_SWEEP_MS—int / 15000Global onlyHow often expired ingestion leases are recovered
INGESTION_POLL_MS—int / 1000Global onlyIngestion queue polling interval
INGESTION_CANCEL_CHECK_MS—int / 5000Global onlyHow often a running ingestion checks for cancellation
INGESTION_MAX_ATTEMPTS—int / 3Global onlyAttempts before an ingestion is failed
INGESTION_PER_INSTANCE—int / 1Global onlyIngestions processed concurrently per process
TELEMETRY_ENABLED—bool / trueGlobal onlyEnable built-in telemetry and Confy trace collection
TELEMETRY_TRACES_ENABLED—bool / trueGlobal onlyStore traces in the per-space telemetry collections
TELEMETRY_TRACE_RETENTION_DAYS—int / 7Global onlyTrace retention in days
TELEMETRY_MAX_SPANS_PER_TRACE—int / 200Global onlyMaximum spans stored per trace
TELEMETRY_MAX_ATTRIBUTE_LENGTH—int / 1024Global onlyMaximum span attribute string length
TELEMETRY_CAPTURE_SQL—bool / falseGlobal onlyCapture SQL attributes in traces
OTEL_SDK_DISABLED—bool / falseGlobal onlyDisable all OpenTelemetry telemetry
OTEL_SERVICE_NAME—string / sxsGlobal onlyOpenTelemetry service name
OTEL_EXPORTER_OTLP_ENDPOINT—string / unsetGlobal onlyOptional OTLP collector endpoint
OTEL_EXPORTER_OTLP_PROTOCOL—string / http/protobufGlobal onlyOTLP transport protocol
OTEL_EXPORTER_OTLP_HEADERS—string / unsetGlobal onlyOTLP authentication headers
OTEL_TRACES_SAMPLER—string / parentbased_traceidratioGlobal onlyTrace sampler
OTEL_TRACES_SAMPLER_ARG—number / 0.1Global onlyTrace sampling ratio
MAX_ITEMLIST_LENGTHmaxItemlistLengthint / 10000Global + spaceItem-list length above which a dictionary is used
DISALLOW_AVAILABILITY_REQUESTSdisallowAvailabilityRequestsbool / unsetGlobal + space + annotationReject availability requests when the dataset carries the matching annotation

The bulk and export worker settings are listed in the settings table because they use the settings registry, but init/workers.js and init/exportWorkers.js read them globally at boot. Per-space values are not consulted for those variables. syncMaxObservations, exportMaxObservations and exportMaxFileMb are read through the normal space-aware settings accessor.

The INGESTION_* settings are also global-only: the loader capacity reads them from the process settings when it claims, renews or recovers ingestions (see Ingestion queue).

Legacy and non-sxs entries

Some local .env files contain entries that are not read by sxs:

  • MAX_CODELIST_LENGTH — not read; use MAX_ITEMLIST_LENGTH.
  • WEBFS_API_KEY — used by the separate WeBFs service, not by sxs.

Test and benchmark-only variables

These are not production configuration:

VariablePurpose
BENCH_BULKEnable the bulk benchmark
BENCH_BULK_OBSSynthetic observation count
BENCH_BULK_FORMATjson, csv or parquet
BENCH_BULK_BATCHInsert batch size
BENCH_BULK_FAST_INTERVALFast-query sampling interval
BENCH_WORKERSUse the worker pool in the benchmark
BENCH_BULK_CANCELRun the cancellation stress test