Skip to main content

Configuration Defaults

When a process configuration doesn't specify a value, Runix applies defaults. These come from two sources:

  1. Built-in defaults — hardcoded in internal/config/defaults.go
  2. Config-level defaults — specified in the defaults: section of runix.yaml

Precedence​

Process-level config > Config-level defaults > Built-in defaults

Process-level fields always override config-level defaults, which always override built-in defaults.

Built-in Defaults​

FieldDefault Value
restart_policyon-failure
max_restarts5
backoff_base1s
backoff_max60s
stop_timeout5s
stop_signalSIGTERM
namespacedefault
instances1
priority0
health_check.interval10s
health_check.timeout5s
health_check.retries3
health_check.grace_period0s
watch.debounce100ms
logging.max_size10485760 (10MB)
logging.max_files5
logging.max_age168h (7 days)

Config-Level Defaults​

Override built-in defaults for all processes in a config file:

defaults:
restart_policy: always
max_restarts: 20
backoff_base: 2s
backoff_max: 120s
stop_timeout: 10s
stop_signal: SIGTERM

processes:
api:
entrypoint: ./cmd/api
# Inherits restart_policy: always, max_restarts: 20, etc.

worker:
entrypoint: worker.py
max_restarts: 3
# Overrides max_restarts to 3, inherits everything else

Environment Profiles​

Profiles let you override defaults for different environments:

defaults:
restart_policy: on-failure
max_restarts: 5

profiles:
production:
defaults:
restart_policy: always
max_restarts: 50
backoff_max: 300s
staging:
defaults:
restart_policy: on-failure
max_restarts: 10

development:
defaults:
restart_policy: never
max_restarts: 0

Select a profile with the --profile flag:

runix start --profile production

What's Next​