Complete Sockudo runtime environment variable reference.
Sockudo loads configuration from files first, then applies supported environment variable
overrides. Environment variables are explicit mappings, not a generic alternative syntax for every
nested TOML or JSON field. Use them for deployment-specific values and secret injection; keep
complex app policy, retention, queue reliability, and feature structure in a static file or
persistent manager. See Static configuration for the full
precedence and equivalent file examples.
Values are parsed as strings unless the target option is numeric or boolean. Boolean values follow
the server parser and accept common true/false forms.
This page lists every runtime environment variable referenced by the server, core configuration loader, push subsystem, app managers, adapters, queues, and provider workers.
Sockudo supports ${VAR} environment variable interpolation in TOML and JSON
configuration files. Variables are resolved from the process environment at
startup, before the config file is parsed.
Missing variables: If a ${VAR} reference has no default and the
variable is unset or empty, sockudo prints an error listing all
unresolved variables and exits. This is fail-fast by design — you see
every missing variable at once, not one at a time.
Empty values: An environment variable set to an empty string (VAR="")
is treated as unset. The :-default fallback will activate.
Single pass: Interpolation runs once on the raw file text. If a
resolved value itself contains ${…}, it is not re-expanded. This
prevents accidental recursion and injection.
No bare $VAR: Only the braced ${VAR} syntax is recognized. A bare
$ character (e.g., in regex patterns or currency symbols) is never
matched.
Comments: Interpolation operates on raw text before TOML/JSON parsing.
A ${VAR} reference inside a TOML comment (# secret = "${MISSING}")
will still be resolved — and will cause a startup error if the variable
is missing. Remove or replace ${…} patterns in comments if they
reference variables that are not set.
Typed fields: Interpolation produces string replacements. For string
config values (secrets, URLs, connection strings), this works naturally.
For numeric or boolean fields, prefer the existing environment variable
overrides instead.
Defaults cannot contain }: The default value in ${VAR:-default}
ends at the first } character. This is sufficient for most values
(strings, URLs, ports) but not for JSON fragments.
Seconds to keep the listener open after SIGTERM/SIGINT. Existing WebSockets close promptly with 4200; during this window /up, /ready, and /accept-traffic return 503 DRAINING and new upgrades are rejected with 503. HTTP API requests are still served. A second signal ends the window early. The webhook drain follows this window.
USER_AUTHENTICATION_TIMEOUT
Timeout used by user authentication flows.
SOCKUDO_MAX_CONNECTIONS
Per-node WebSocket connection limit. 0 disables.
WEBSOCKET_MAX_PAYLOAD_KB
Legacy maximum WebSocket payload size in KiB.
SOCKUDO_SERVER_ROLE
Deployment topology role. "default" or "api". Overrides server_role in the config file.
INSTANCE_PROCESS_ID
Stable node/process identity used by clustering and Iggy consumers.
HOSTNAME
Fallback node identity for Iggy when INSTANCE_PROCESS_ID is not set.
HEALTH_CHECK_TIMEOUT_MS
Per-dependency timeout for /up health checks in milliseconds. Defaults to 2000.
HTTP_API_USAGE_ENABLED
Enables /usage and /stats operational endpoints.
HTTP_API_READINESS_HIGH_WATERMARK
Fraction of SOCKUDO_MAX_CONNECTIONS that makes /ready return 503 CAPACITY. Defaults to 0.95.
HTTP_API_READINESS_LOW_WATERMARK
Fraction at or below which /ready recovers after capacity shedding. Defaults to 0.85; must be nonnegative and less than the high watermark.
HTTP_API_ACCEPT_TRAFFIC_ENABLED
Enables memory-pressure admission control for new WebSocket connections. Defaults to false.
HTTP_API_ACCEPT_TRAFFIC_MEMORY_THRESHOLD
Fraction of the effective memory limit that closes new-connection admission. Defaults to 0.9; valid range is greater than 0 through 1.
HTTP_API_ACCEPT_TRAFFIC_MEMORY_LIMIT_BYTES
Optional explicit memory limit in bytes. When unset, Linux cgroup v2/v1 limits are discovered.
HTTP_API_ACCEPT_TRAFFIC_SAMPLE_INTERVAL_MS
Independent memory-pressure sampling interval in milliseconds. Defaults to 500.
OpenTelemetry is disabled unless [opentelemetry].enabled or SOCKUDO_OTEL_ENABLED is true.
When enabled, Sockudo can export the stable OpenTelemetry traces, metrics, and logs signals over
OTLP. Export is additive to local logs and the Prometheus /metrics endpoint. OpenTelemetry
profiles are not supported.
Sockudo also honors the standard OTEL_* SDK and exporter variables implemented by the bundled
Rust SDK. Use these for protocol, sampling, per-signal endpoints, compression, and authenticated
collector headers. A
signal-specific exporter value is more specific than its common OTLP equivalent.
Variable or family
Purpose
OTEL_SDK_DISABLED
Hard-disables the OpenTelemetry SDK when true.
OTEL_SERVICE_NAME
Standard service.name resource setting.
OTEL_RESOURCE_ATTRIBUTES
Standard comma-separated resource attributes.
OTEL_PROPAGATORS
Comma-separated tracecontext and baggage propagators. Other propagator names are ignored.
The standard signal-specific endpoint is used exactly as supplied. With HTTP, include its final
signal path when setting a signal-specific endpoint. Keep OTEL_EXPORTER_OTLP_HEADERS and private
API tokens in a secret store rather than a configuration file or command line. HTTPS exporters use
the bundled platform/web PKI roots. Custom CA bundles, client certificates, and mTLS exporter
configuration are not supported by the current Rust SDK integration.
Exporter connection failures, timeouts, and bounded-queue drops do not fail requests and do not
change /live or /up. Invalid Sockudo configuration still fails validation at startup. See
Logging for log correlation and data-safety details.
Enables the optional additional-key registry. The primary App.key/App.secret remains available independently.
SOCKUDO_ABLY_COMPAT_REALTIME_ADMISSION
Ably WebSocket admission mode: accept (default) or placement_constraint, which returns DISCONNECTED error 50320 so clients try configured WebSocket fallback hosts. No fallback realtime transport is enabled.
SOCKUDO_ABLY_COMPAT_ATTACH_TIMEOUT_MS
Maximum native ATTACH processing time before Sockudo removes the partial subscription and returns DETACHED/50003. Defaults to 10000.
SOCKUDO_ABLY_COMPAT_KEYS_JSON
JSON array of additional keys with app_id, key_name, secret, optional capability, revocable_tokens, enabled, and rotation metadata. Treat this value as a secret.
SOCKUDO_ABLY_COMPAT_MAX_TOKEN_TTL_MS
Maximum accepted TokenRequest TTL in milliseconds. Defaults to 24 hours.
Comma-separated CORS methods. Defaults include GET, POST, PUT, PATCH, DELETE, and OPTIONS so browser clients can use every supported REST mutation route.
Client's one-based position from the right of X-Forwarded-For for API rate limits. 0 ignores both forwarding headers; 1 suits one NGINX appending proxy. See client IP extraction.
RATE_LIMITER_WS_MAX_REQUESTS
WebSocket upgrade attempts allowed per window.
RATE_LIMITER_WS_WINDOW_SECONDS
WebSocket rate limit window length.
RATE_LIMITER_WS_TRUST_HOPS
Client's one-based position from the right of X-Forwarded-For for WebSocket rate limits. 0 ignores both forwarding headers; 1 suits one NGINX appending proxy. See client IP extraction.
Redis queue command response timeout in milliseconds. Defaults to 5000 so Sentinel failover invalidates stale primary connections promptly; set to 0 to disable the client-side deadline.
QUEUE_MAX_ATTEMPTS
Maximum Queue v2 deliveries before dead-lettering. Defaults to 5.
QUEUE_RETRY_BASE_DELAY_MS
Initial retry delay. Defaults to 1000.
QUEUE_RETRY_MAX_DELAY_MS
Maximum exponential retry delay. Defaults to 60000.
QUEUE_RETRY_JITTER
Symmetric retry jitter fraction from 0.0 to 1.0. Defaults to 0.2.
QUEUE_LEASE_DURATION_MS
Redis Queue v2 in-flight lease duration. Defaults to 30000.
QUEUE_LEASE_RENEW_INTERVAL_MS
Redis Queue v2 lease renewal interval; must be below the lease duration. Defaults to 10000.
QUEUE_STALLED_BATCH_SIZE
Maximum expired/due jobs recovered by one Redis atomic claim. Defaults to 100.
QUEUE_WORKER_POLL_INTERVAL_MS
Worker recovery poll and delayed-delivery promotion bound. Defaults to 500.
QUEUE_WORKER_PREFETCH
Maximum jobs processed concurrently or prefetched per worker for bounded broker I/O. SQS FIFO stays serial. Defaults to 16.
QUEUE_SHUTDOWN_TIMEOUT_MS
Budget for draining connection cleanup, presence leases, and webhooks after listener grace; also the separate queue worker shutdown timeout. Defaults to 30000 per phase. See shutdown delivery.
QUEUE_COMPLETED_RETENTION
Completed Redis job metadata retained per queue. 0 removes immediately. Defaults to 1000.
QUEUE_FAILED_RETENTION
Dead-letter jobs retained per queue. Defaults to 10000.
QUEUE_EVENT_RETENTION
Approximate Redis lifecycle event-stream retention. Defaults to 10000.
QUEUE_DEDUPLICATION_TTL_MS
Application deduplication-key lifetime. Defaults to 300000.
QUEUE_MEMORY_CAPACITY
Maximum outstanding jobs per in-memory logical queue. Capacity errors fail closed. Defaults to 100000.
QUEUE_MAX_BATCH_SIZE
Maximum jobs encoded into one atomic/backend-native enqueue batch. Defaults to 1000.
REDIS_CLUSTER_QUEUE_REQUEST_TIMEOUT_MS
Redis Cluster queue command request timeout in milliseconds. Set to 0 to disable the cluster client deadline.
Expected Sockudo node count for horizontal request aggregation when cluster-health discovery is not used.
NATS_SUBSCRIPTION_CAPACITY
NATS subscription channel capacity.
NATS_CLIENT_CAPACITY
NATS client channel capacity.
NATS_MAX_RECONNECTS
NATS reconnect limit.
NATS_PRESENCE_SYNC_CHUNK_SIZE
Presence sync chunk size for NATS.
NATS_NO_ECHO
Suppress delivery of a NATS connection's own horizontal messages.
PULSAR_URL
Pulsar service URL.
PULSAR_PREFIX
Pulsar topic prefix.
PULSAR_TOKEN
Pulsar auth token.
PULSAR_REQUEST_TIMEOUT_MS
Pulsar request timeout.
PULSAR_NODES_NUMBER
Expected Pulsar node count.
RABBITMQ_URL
RabbitMQ connection URL.
RABBITMQ_PREFIX
RabbitMQ exchange or routing prefix.
RABBITMQ_CONNECTION_TIMEOUT_MS
RabbitMQ connection timeout.
RABBITMQ_REQUEST_TIMEOUT_MS
RabbitMQ request timeout.
RABBITMQ_NODES_NUMBER
Expected RabbitMQ node count.
GOOGLE_PUBSUB_PROJECT_ID
Google Pub/Sub project ID.
GOOGLE_PUBSUB_PREFIX
Google Pub/Sub topic prefix.
PUBSUB_EMULATOR_HOST
Pub/Sub emulator host.
GOOGLE_PUBSUB_REQUEST_TIMEOUT_MS
Google Pub/Sub request timeout.
GOOGLE_PUBSUB_NODES_NUMBER
Expected Pub/Sub node count.
KAFKA_BROKERS
Comma-separated Kafka brokers.
KAFKA_PREFIX
Kafka topic prefix.
KAFKA_SECURITY_PROTOCOL
Kafka security protocol.
KAFKA_SASL_MECHANISM
Kafka SASL mechanism.
KAFKA_SASL_USERNAME
Kafka SASL username.
KAFKA_SASL_PASSWORD
Kafka SASL password.
KAFKA_REQUEST_TIMEOUT_MS
Kafka request timeout.
KAFKA_NODES_NUMBER
Expected Kafka node count.
IGGY_CONNECTION_STRING
Apache Iggy connection string; the first node dialed. Its credentials and query options apply to every cluster seed.
IGGY_CLUSTER_SEEDS
Comma-separated extra Apache Iggy replicas (host:port) tried in order when an earlier node is unreachable. Bootstrap only; the SDK then fails over using the cluster roster.
IGGY_CONNECT_TIMEOUT_MS
Bound on the TCP dial to each node while cluster seeds are set (default: 2000).
IGGY_FAILOVER_TIMEOUT_MS
How long broadcast and queue publishes, and sign-in to a reachable seed, wait for an Apache Iggy leader election or failover (default: 15000).
IGGY_DURABILITY
Message durability for topics Sockudo creates: replicated (default) or persisted.
ADAPTER_IGGY_DURABILITY
Adapter-specific message durability.
QUEUE_IGGY_DURABILITY
Queue-specific message durability.
IGGY_CONSUMER_OFFSET_DURABILITY
Consumer-offset durability for topics Sockudo creates: replicated (default) or persisted.
ADAPTER_IGGY_CONSUMER_OFFSET_DURABILITY
Adapter-specific consumer-offset durability.
QUEUE_IGGY_CONSUMER_OFFSET_DURABILITY
Queue-specific consumer-offset durability.
IGGY_USERNAME
Apache Iggy username.
IGGY_PASSWORD
Apache Iggy password.
IGGY_CONSUMER_NAME
Apache Iggy consumer name.
IGGY_STREAM
Apache Iggy stream name.
IGGY_TOPIC_PREFIX
Apache Iggy adapter topic prefix.
IGGY_QUEUE_TOPIC_PREFIX
Apache Iggy queue topic prefix.
IGGY_CONSUMER_GROUP_PREFIX
Apache Iggy consumer group prefix.
IGGY_REQUEST_TIMEOUT_MS
Apache Iggy request timeout.
IGGY_POLL_INTERVAL_MS
Apache Iggy poll interval in milliseconds (default: 5).
IGGY_POLL_BATCH_SIZE
Apache Iggy poll batch size.
IGGY_PARTITIONS_COUNT
Shared Apache Iggy partition count.
ADAPTER_IGGY_PARTITIONS_COUNT
Adapter-specific Apache Iggy partition count.
QUEUE_IGGY_PARTITIONS_COUNT
Queue-specific Apache Iggy partition count.
IGGY_PARTITION_ID
Shared Apache Iggy partition ID.
ADAPTER_IGGY_PARTITION_ID
Adapter-specific Apache Iggy partition ID.
QUEUE_IGGY_PARTITION_ID
Queue-specific Apache Iggy partition ID.
IGGY_AUTO_CREATE
Auto-create Apache Iggy streams and topics.
IGGY_START_FROM_LATEST
Start adapter consumption from latest messages.
IGGY_NODES_NUMBER
Expected Sockudo node count for horizontal request aggregation (not the Iggy replica count).
OMQ_BIND_ENDPOINT
OMQ subscriber bind endpoint for this node.
OMQ_CONNECT_ENDPOINTS
Comma-separated OMQ peer subscriber endpoints.
OMQ_PREFIX
OMQ transport topic prefix.
OMQ_REQUEST_TIMEOUT_MS
OMQ request timeout.
OMQ_NODES_NUMBER
Expected OMQ node count. Defaults to peer endpoint count plus this node.
Falls back to synchronous cleanup when async cleanup fails.
CLEANUP_QUEUE_BUFFER_SIZE
Cleanup queue buffer size.
CLEANUP_BATCH_SIZE
Cleanup batch size.
CLEANUP_BATCH_TIMEOUT_MS
Cleanup batch timeout.
CLEANUP_WORKER_THREADS
Cleanup worker count or auto.
CLEANUP_MAX_RETRY_ATTEMPTS
Cleanup retry limit.
CLUSTER_HEALTH_ENABLED
Enables cluster health tracking.
CLUSTER_HEALTH_HEARTBEAT_INTERVAL
Cluster heartbeat interval.
CLUSTER_HEALTH_NODE_TIMEOUT
Node timeout before a peer is considered stale. A newly started node also keeps publishing cross-node for this long before it treats an empty peer list as a single-node deployment.
Maximum buffered outbound WebSocket messages, or none/0 for unlimited.
WEBSOCKET_MAX_BYTES
Maximum buffered outbound WebSocket bytes, or none/0 for unlimited.
WEBSOCKET_DISCONNECT_ON_BUFFER_FULL
Disconnects slow clients instead of dropping messages when buffers fill.
WEBSOCKET_MAX_MESSAGE_SIZE
WebSocket message size limit.
WEBSOCKET_MAX_FRAME_SIZE
WebSocket frame size limit.
WEBSOCKET_WRITE_BUFFER_SIZE
WebSocket write buffer size.
WEBSOCKET_MAX_BACKPRESSURE
WebSocket backpressure limit.
WEBSOCKET_AUTO_PING
Enables native WebSocket Ping/Pong keepalive for Protocol V2. Protocol V1 retains its Pusher-compatible application heartbeat.
WEBSOCKET_PING_INTERVAL
Inbound inactivity in seconds before a Protocol V2 native Ping. 0 disables proactive native Ping frames; nonzero values are bounded to at least half of ACTIVITY_TIMEOUT (and at least 5 seconds).
WEBSOCKET_IDLE_TIMEOUT
Hard inbound-idle timeout in seconds for Protocol V2 native connections. 0 disables the hard idle deadline.
WEBSOCKET_COMPRESSION
WebSocket compression mode.
CONNECTION_RECOVERY_ENABLED
Enables Protocol V2 connection recovery.
CONNECTION_RECOVERY_BUFFER_TTL
Recovery buffer TTL.
CONNECTION_RECOVERY_MAX_BUFFER_SIZE
Recovery buffer maximum size.
EPHEMERAL_ENABLED
Enables ephemeral event handling.
ECHO_CONTROL_ENABLED
Enables per-connection echo control.
ECHO_CONTROL_DEFAULT_ECHO_MESSAGES
Default echo behavior when echo control is enabled.