Configuration

Configure Flo via flo.toml and CLI flags.

Flo is configured via a flo.toml file and CLI flags. CLI flags take the highest precedence: CLI flags > flo.toml > built-in defaults.

Config File

By default, Flo looks for flo.toml in the current directory. Override with --config:

flo server start --config /etc/flo/flo.toml

Generate a default config file with all options:

flo config init

The server refuses to start on a config it can't honour, and names the line to fix:

  • a section or key it doesn't read, including one listed under Removed settings;
  • a value of the wrong type (port = "9000") or out of range (port = 70000);
  • a durability, log level or log format it doesn't know;
  • a file named with --config that doesn't exist. Without --config, a missing flo.toml means built-in defaults.

Full Reference

[server]

[server]
port = 9000               # Client API port (binary protocol)
bind = "0.0.0.0"          # Bind address
data_dir = "~/.flo/data"  # Data directory for UAL segments and storage files
shards = 0                # Number of shards, at most 256 (0 = CPU count, less one on 4 or more cores; a cluster member runs 1)

shards defines the on-disk data layout: a data directory starts only with the shard count it was written with. Keys route over a fixed 4096 slots, the same on every node and cluster, so there is no partition count to set.

[server] bind is the interface this node serves on — for clients and, in a cluster, for peers. 0.0.0.0 (the default) listens everywhere and lets peers reach the node at whatever address they see it from; a specific address is also what the node advertises to its peers. --bind overrides it on the command line.

:::note The client port authenticates no one yet: anything that can reach it can read and write every namespace. Namespaces separate names, not access. Bind it to a private interface, or firewall it. :::

[storage]

[storage]
durability = "async_flush"       # sync | async_flush
hot_buffer_capacity = 67108864   # Per-shard ring buffer size in bytes (64 MiB, the default; at least 2 MiB)
# hot_flush_seconds = 0          # Max seconds before hot → warm flush (default 0 = disabled; 300 suits production)
# max_hot_entries = 0            # Max entries in hot tier before eviction (0 = capacity only)

Durability modes:

ModeBehaviourAt risk on abrupt termination
syncSegment written and fsynced before the write is acknowledgedNothing
async_flushSegments written and fsynced by a background task, at most once per second — the defaultUp to ~1 second of acknowledged writes

What async_flush risks, concretely. An acknowledged write lives only in memory until the next segment flush, which runs at most once per second. If the process is killed (SIGKILL, OOM kill, power loss, host failure) you can lose up to roughly the last second of acknowledged writes. Everything older is on disk, fsynced and published by atomic rename, so the store is never left torn or half-written — the loss is a clean tail truncation, not corruption.

A graceful shutdown (SIGTERM, docker stop, flo server stop) flushes before exiting, so a normal restart loses nothing. The one-second window only applies when the process dies without running its shutdown path.

:::note This window is not governed by hot_flush_seconds. That setting controls hot → warm tier migration, which is a storage-layout concern and does not affect what survives a crash. :::

[logging]

[logging]
level = "info"             # debug | info | warn | error
# format = "text"          # text | json

[metrics]

[metrics]
enabled = true
# port = 0                # 0 = auto (listen_port + 1), so 9001 by default
# bind = "127.0.0.1"      # Localhost only by default

Binds only when enabled = true. For a Prometheus server scraping from outside the container, set bind = "0.0.0.0" — the default is loopback-only.

[dashboard]

[dashboard]
enabled = true
# port = 0                # 0 = auto (listen_port + 2), so 9002 by default
# bind = "127.0.0.1"      # Localhost only by default
# cors_origins = ""        # Exact origins allowed cross-origin, comma-separated; none by default
# hosts = ""               # Extra Host names served, beyond localhost/127.0.0.1/[::1]

The dashboard serves only requests whose Host is localhost, 127.0.0.1, [::1], or listed in hosts — add the name or address you browse to when it is reached any other way (for example hosts = "flo.internal, 10.0.0.5"; names and addresses alone, no port; IPv6 in brackets). A dashboard reached by an unlisted name or address answers 421. /health answers any Host. cors_origins is for a page served from another origin that calls this API directly (for example https://ops.example.com); * is refused. See REST API → Requests that change something.

:::note bind defaults to 127.0.0.1. In an orchestrated deployment a readiness probe originating outside the container cannot reach a loopback listener, so the default presents as a service that never becomes ready. Set bind = "0.0.0.0" where the port is not publicly routable. See Docker → Health Check. :::

[cluster]

[cluster]
enabled = false              # true starts the first member of a cluster (same as --cluster)
# secret = "flo-secret-…"    # required whenever the peer port is bound; same value on every node
# secret_file = "/path"      # or the secret in a file only its owner can read (mode 600)
# node_id = 1
# raft_port = 0              # 0 = auto (listen_port + 500)
# seeds = ["192.168.1.10:9500"]  # peer ports of members to join (same as --join)
# failover_timeout_ms = 1500 # a leader unheard for this long is replaced; minimum 100

secret is what a node proves it holds before another node treats it as a peer: the Raft port moves terms, membership and log contents, so it is never open. Every node in a cluster carries the same value; a node with a different one is refused at the handshake and both sides log it. The secret itself never crosses the wire. Make one with flo server secret; a node accepts only a secret in the form it prints, so a value typed by hand is refused rather than trusted to be strong. It can also come from a file named by secret_file (readable by its owner alone), or from the FLO_CLUSTER_SECRET environment variable, for containers without a config file; set only one of the three. Starting the Raft listener without it, with a malformed one, or with more than one source is a startup error that says what to change.

node_id is read on first boot and stored in the data dir. On later boots a node_id that differs from the stored one refuses to start, naming both: remove it from the config to keep the data, or start the node from an empty data dir to give it a new id.

The peer port is bound only when this node can have peers: enabled = true starts the first member of a cluster, seeds joins members that exist, and the two are not combined. A plain single-node server does not listen on listen_port + 500, so there is no undeclared port to account for; a raft_port set without either role is refused at start. The startup banner reports which applies.

failover_timeout_ms is the one timing setting: a leader unheard for between half and all of it is replaced, heartbeats go out at a sixth of it. These are the only keys [cluster] reads. See Clustering.

[kv]

[kv]
# max_txn_ops = 64          # most ops one transaction may hold, 1 to 256
# max_txn_bytes = 262144    # most key and value bytes it may hold, up to 1048576 (1 MiB)

A value outside its range is refused at start. --max-txn-ops and --max-txn-bytes set them too, and beat the file. Past either limit, any op added to the transaction is refused with txn_too_large.

max_txn_bytes counts each key with its namespace prefix: in namespace tenant at a limit of 100, a 1-byte key takes a value of at most 92 bytes. The default holds the largest value a plain set takes, under the longest key.

A committed transaction is one log entry, and the shard does nothing else while it applies one, so raising these costs latency for every tenant on the shard, not correctness. Apply times, built ReleaseSafe as releases are, on a shared Apple-silicon Mac under load, range over five runs (your hardware will differ):

TransactionApply
64 small ops85-88 µs
256 small ops324-336 µs
64 ops, 256 KiB (full at both defaults)126-139 µs
64 ops, 1 MiB270-330 µs
256 ops, 1 MiB (both maximums)529-577 µs

Set the same values on every node. A mismatch is safe, since replicas apply whatever a leader committed, but the leader's values decide, so the same transaction can be accepted or refused depending on which node leads.

[workers]

[workers]
# heartbeat_timeout_ms = 90000   # silent this long, a worker is unhealthy and gets no work; minimum 1000
# remove_after_ms = 600000       # silent this long, a worker is removed; at least heartbeat_timeout_ms

The SDKs heartbeat every 30 seconds by default, so the default allows three missed beats. Keep heartbeat_timeout_ms above your workers' heartbeat interval: a worker with heartbeats turned off (for example the JavaScript SDK's heartbeatIntervalMs: 0) is refused work once the timeout passes. A heartbeat or a fresh registration makes an unhealthy worker active again. See Workers.

[workflows]

[workflows]
# missing_action_wait_ms = 600000   # how long a step waits for its action to be registered; 0 fails it at once

A step past this wait takes its target_not_found outcome. The node leading the action's shard applies the setting, so set the same value on every node. See Workflows.

[queues]

[queues]
max_messages = 100000        # Messages one queue may hold, ready, leased and dead (1 to 16777216)
max_bytes = 268435456        # Held bytes one queue may hold, likewise (64 KiB to 1 GiB)
shard_held_bytes = 1073741824 # Held bytes all of a shard's queues may hold (64 KiB to 64 GiB)

Every replica holds every queued message in memory, so these bound what a runaway producer can make a node hold. A message holds its payload, its error text and 512 bytes besides, so empty messages fill a queue too. Past a cap, an enqueue is refused overloaded, with a message naming the cap; nothing already held is dropped. Consume, or purge, to make room. Dead letters count until they're requeued or deleted, or the queue is purged.

:::note Set the same caps on every node. The leader's caps decide, for every replica, whatever a replica's own settings say. A node that applies an enqueue under caps other than its own counts it in flo_queue_cap_mismatch_total and logs a warning naming both. :::

Removed settings

These are refused at start, with the reason. Remove them from flo.toml.

SettingWhy
[auth]Client authentication isn't implemented yet.
[websocket]The WebSocket endpoint was removed.
[background_tasks]Namespace delete is refused, so there's no deletion task to tune.
[kv] expose_internal_keysNever read; internal keys stay hidden.
[storage] max_local_segments, enable_wal_truncationNot wired up: nothing reads them.
[server] partition_countEvery cluster has 4096 key slots; there is no count to set. --partitions is refused too.

CLI Overrides

Common options can be set directly on the command line. These override everything:

flo server start \
  --port 4444 \
  --data-dir ./my-data \
  --shards 4 \
  --log-level debug \
  --log-format json \
  --metrics-port 9101 \
  --dashboard-port 9102 \
  --no-metrics \
  --no-dashboard

Clustering flags — the first member, then one that joins it:

flo server start --cluster
flo server start --join 192.168.1.10:9500