Operate · 02

Size it for your machine.

The settings that control how much work each node accepts, and how long each call may run.

All settings are environment variables, read once at startup. Set them the same on every node, then restart to apply. The full settings reference lists every option and its validation rules.

Workers and queues

Match these to your CPUs and memory. Bigger queues hold more waiting work; they don't add CPU. When a queue is full, requests get a 503.

Worker and queue settings
SettingDefaultWhat it does
FLOWER_QUERY_WORKERSCPU countSlots for cache lookups and authorization callbacks.
FLOWER_PREPARATION_WORKERSFLOWER_QUERY_WORKERSShared slots per node for queries, writes, authorization and watch updates.
FLOWER_WRITER_PREPARATION_WORKERSFLOWER_PREPARATION_WORKERSHow many writes can be prepared in parallel before being committed in order. Set 1 for workloads where most writes conflict.
FLOWER_PREPARATION_MEMORY_BYTESworkers × (guest + Rust memory)Total memory reserved for running evaluations.
FLOWER_QUEUED_INPUT_BYTES64 MiBMemory for waiting requests, cached responses in flight and connected watches' current values. Slow clients hold on to this memory.
FLOWER_READ_QUEUE_CAPACITY64 × CPUsFresh reads waiting for a quorum check.
FLOWER_READ_TIMEOUT_MS10,000 msDeadline for a fresh read, including queueing.
FLOWER_WRITER_QUEUE_CAPACITY128 × CPUs; 2 × batch size if set; 128 in fixed modeMutations waiting to be written.
FLOWER_WRITER_BATCH_MODEadaptiveAdaptive sizes write batches from measured cost. Set fixed for count-based batches.
FLOWER_WRITER_BATCH_SIZEunset (64 in fixed mode)Optional cap on mutations per batch.
FLOWER_HTTP2_MAX_STREAMSunset (no limit)Concurrent HTTP/2 streams per connection.

Watches have no fixed count limit. Connections, memory and CPU set the real limit, so measure with your own queries and update rate.

Per-request limits

These cap each evaluation and request. Raising one costs memory or waiting time; it never weakens isolation, quorum or durability.

Evaluation and size limits
SettingDefaultWhat it does
FLOWER_EVALUATION_TIMEOUT_MS10,000 msDeadline for one evaluation, including nested callbacks.
FLOWER_BUNDLE_MAX_BYTES2 MiBSize of deployed application code.
FLOWER_RESULT_MAX_BYTES16 MiBSize of a value returned by an evaluation.
FLOWER_GUEST_MEMORY_BYTES128 MiBJavaScript memory for one evaluation.
FLOWER_RUST_MEMORY_BYTES128 MiBHost memory for one evaluation's pending changes.
FLOWER_INDEX_MEMORY_BYTES16 MiBCache for lookups on undeclared indexes. Declared indexes are stored and don't use it.
FLOWER_WASM_POOL_SLOTS256Sandbox instances per process. Nested callbacks each need one.
FLOWER_WASM_RECYCLE_BYTES96 MiBMemory kept for reusing idle sandboxes. 0 keeps none.
FLOWER_HTTP_MAX_BODY_BYTES8 MiBIncoming HTTP request body.
FLOWER_TRANSACTION_MAX_BYTES32 MiBOne replicated command.
FLOWER_RPC_MAX_BYTES64 MiBOne node-to-node message.

To accept bigger payloads, raise the HTTP body, result, transaction, RPC and client limits together. HTTP headers have their own limits: FLOWER_HTTP1_MAX_HEADERS (100), FLOWER_HTTP1_MAX_BUFFER_BYTES (408 KiB) and FLOWER_HTTP2_MAX_HEADER_LIST_BYTES (16 KiB).

Timing and watch settings
SettingDefaultWhat it does
FLOWER_WRITER_BATCH_MS50 msLongest time spent filling a write batch. Adaptive mode often uses less.
FLOWER_WRITER_WINDOW_MS250 msHow often writes pause so deployments and maintenance can run.
FLOWER_DEPLOYMENT_PAGE_MS200 msTarget time per page of a staged rebuild. Lower means shorter write stalls; higher means faster rebuilds.
FLOWER_MAINTENANCE_INTERVAL_MS250 msHow often timers and other maintenance are checked.
FLOWER_MAINTENANCE_BURST_MS50 msTime allowed per maintenance catch-up round.
FLOWER_WATCH_REFRESH_MS250 msHow often idle watches are re-evaluated and fresh watches rechecked.
FLOWER_WATCH_KEEPALIVE_MS15,000 msInterval between watch-stream keepalives.
FLOWER_WATCH_SEND_TIMEOUT_MS5,000 msHow long a slow watch client can fall behind before it is disconnected.
Memory use and sandbox reuse

These limits are not a cap on process memory. Stored data, compiled code, caches and thread stacks cost extra. On 64-bit hosts each sandbox reserves 4 GiB of virtual address space; that isn't physical RAM.

Sandboxes are reset and reused between calls to save setup time. Every call still starts from clean state. FLOWER_WASM_RECYCLE=0 turns reuse off; FLOWER_WASM_DIRTY_PAGES=0 copies all memory on reset instead of only changed pages. See the limits reference for platform details.