Skip to main content

Configuration

Restate has a wide range of configuration options to tune it according to your needs.

Configuration file

Restate accepts a TOML configuration file that can be specified either providing the command-line option --config-file=<PATH> or setting the environment variable RESTATE_CONFIG=<PATH>. If not set, the default configuration will be applied.

Overrides

Restate server accepts a sub-set of the configuration through command-line arguments, you can see all available options by adding --help to restate-server.

The order of applying configuration layers follows the following order:

  1. Built-in defaults
  2. Configuration file (--config-file or via RESTATE_CONFIG)
  3. Environment variables
  4. Command line arguments (--cluster-name=<VALUE>)
Note

Every layer overrides the previous. For instance, command-line arguments will override a configuration key supplied through environment variable (if set).

Environment variables

You can override any configuration entry with an environment variable, this overrides values loaded from the configuration file. To do that, the following rule applies:

  • Prefix the configuration entry key with RESTATE_
  • Separate every nested struct with __ (double underscore) and all hyphens - with a _ (single underscore).

For example, to override the admin.bind-address, the corresponding environment variable is RESTATE_ADMIN__BIND_ADDRESS.

Configuration introspection

If you want to generate a configuration file that includes values loaded from your environment variables or overrides applied to restate-server command-line, you can add --dump-config to dump the default TOML config with overrides applied:


restate-binary --cluster-name=mycluster --dump-config

Example output:


roles = [
"worker",
"admin",
"metadata-store",
]
cluster-name = "mycluster"
...

At any time, you ask restate daemon to print the loaded configuration to the log by sending a SIGUSR1 to the server process. This prints a dump of the live configuration to INFO level.

For instance on Mac/Linux, you can find the PID of restate-server by running:


pgrep restate-server
994921

Then send the signal to the process ID returned from pgrep's output:


kill -USR1 994921

Observe the log output of the server for a dump of the configuration file contents.

Default configuration

💡Tip

Note that configuration defaults might change across server releases, if you want to make sure you use stable values, use an explicit configuration file an pass the path via --config-path=<PATH> as described above.

roles = [
"worker",
"admin",
"metadata-store",
]
cluster-name = "localcluster"
allow-bootstrap = true
metadata-store-address = "http://127.0.0.1:5123/"
bind-address = "0.0.0.0:5122"
advertised-address = "http://127.0.0.1:5122/"
shutdown-timeout = "1m"
tracing-filter = "info"
log-filter = "warn,restate=info"
log-format = "pretty"
log-disable-ansi-codes = false
disable-prometheus = false
rocksdb-total-memory-size = "4.0 GB"
rocksdb-total-memtables-size = "0 B"
rocksdb-high-priority-bg-threads = 2

[http-keep-alive-options]
interval = "40s"
timeout = "20s"

[worker]
internal-queue-length = 64
bootstrap-num-partitions = 64

[worker.storage]
rocksdb-disable-wal = true
sync-wal-on-flush = false

[worker.invoker]
inactivity-timeout = "1m"
abort-timeout = "1m"
message-size-warning = "10.0 MB"

[worker.invoker.retry-policy]
type = "exponential"
initial-interval = "50ms"
factor = 2.0
max-interval = "10s"

[admin]
bind-address = "0.0.0.0:9070"

[admin.query-engine]
pgsql-bind-address = "0.0.0.0:9071"

[ingress]
bind-address = "0.0.0.0:8080"
kafka-clusters = []

[bifrost]
default-provider = "local"

[bifrost.local]
rocksdb-disable-wal = false
writer-batch-commit-count = 500
writer-batch-commit-duration = "5ns"
sync-wal-before-ack = true
batch-wal-flushes = true

[metadata-store]
bind-address = "0.0.0.0:5123"
request-queue-length = 32

[metadata-store.rocksdb]
rocksdb-disable-wal = false

Configuration reference

Loading ....