Skip to main content

Runtime Limits

These settings bound database, messaging, and evaluator resource use. They can be supplied as CLI flags or environment variables. Vigilo parses subsystem settings only for commands that consume that subsystem; unrelated configuration cannot block a database-only command.

Command Scope

DATABASE_URL, database-pool settings, VIGILO_CONTROL_DATABASE_ALIAS, and output settings are root options because every current command uses the control database. MESSAGING_URL is accepted only by coordinator and worker. Wasm limits are accepted only by worker, setup, evaluator publish, and evaluator test. Command-scoped CLI flags follow their owning command, while the existing environment-variable names remain compatible.

vigilo coordinator --messaging-url amqp://broker start
vigilo worker --messaging-url amqp://broker --wasm-timeout-ms 5000 start
vigilo run create --shard-assignment-policy spread-active \
--profile-file profile.yaml --dataset-file dataset.yaml

DATABASE_MAX_CONNECTIONS is a limit for each lazily initialized database pool, not an aggregate process limit. A process that contacts several database aliases can own one pool per alias; size the setting against the database connection budget and number of processes.

Database Failure Isolation

Coordinators and workers use one process-local circuit breaker per database alias. Repeated connection-level failures open only that alias's circuit. Durable coordinator work remains pending, and worker messages for that alias are delayed, while healthy aliases continue in the same process. After the cooldown, one half-open probe tests recovery. Explicit database and shard administration bypasses the breaker.

Runtime pools also apply bounded PostgreSQL statement_timeout and lock_timeout settings. Coordinator placement operations have an outer wall-clock deadline, so a connected target that stops making progress cannot hold the placement sweep indefinitely. Worker claim, load, heartbeat, persistence, and settlement operations use the same deadline; agent calls, Wasm execution, and broker operations do not. The statement timeout is 80% of the configured operation timeout; lock timeout is one quarter of the statement timeout, capped at 5 seconds. A single setting keeps these limits ordered.

FlagEnvironmentScopeDefaultPurpose
--database-acquire-timeout-secondsVIGILO_DATABASE_ACQUIRE_TIMEOUT_SECONDSAll commands10Maximum wait to acquire a PostgreSQL connection.
--database-operation-timeout-secondsVIGILO_DATABASE_OPERATION_TIMEOUT_SECONDScoordinator, worker, run create30Maximum wall-clock time for one retryable runtime database operation; derives the server statement and lock limits.
--database-circuit-breaker-enabledVIGILO_DATABASE_CIRCUIT_BREAKER_ENABLEDcoordinator, worker, run createtrueEnables process-local execution-database circuit breakers.
--database-circuit-failure-thresholdVIGILO_DATABASE_CIRCUIT_FAILURE_THRESHOLDcoordinator, worker, run create3Consecutive availability failures required to open an alias's circuit.
--database-circuit-initial-open-secondsVIGILO_DATABASE_CIRCUIT_INITIAL_OPEN_SECONDScoordinator, worker, run create10Initial open interval before one recovery probe is admitted.
--database-circuit-max-open-secondsVIGILO_DATABASE_CIRCUIT_MAX_OPEN_SECONDScoordinator, worker, run create120Maximum open interval after repeated failed probes.

I/O, TLS, protocol, connection-class, shutdown, target resource, pool acquisition timeout, statement timeout, and outer operation timeout failures affect the breaker. Route state, constraints, serialization failures, deadlocks, lock contention, and missing secrets do not. Cooldowns use process-local jitter, so processes do not all probe at the same instant.

Outbox claim and settlement SQL uses the server limits. The outer database deadline deliberately excludes broker publication, so slow RabbitMQ delivery does not open a database circuit. Cancellation drops owned transactions; uncommitted dispatch cursors and creation work remain durable for retry.

A worker checks the alias circuit before claiming a message. Availability timeouts and PostgreSQL contention delay only that message; they do not consume the bounded worker-failure retry budget or terminate the process. If the chunk was already claimed, redelivery is delayed past the processing lease so another worker cannot race the still-live claim. The lease token and attempt guards make replay idempotent. Failure to publish the delayed copy remains process-visible because acknowledging the original without a durable retry would lose work.

Messaging Failure Isolation

Each coordinator or worker process owns one circuit for its configured message broker. Publish, one-shot receive, and consumer-creation attempts acquire admission before contacting RabbitMQ. Consecutive connection, channel, I/O, or heartbeat failures open the circuit. Calls then fail locally until one half-open probe is admitted after the bounded, jittered cooldown.

Outbox events remain durable while the coordinator cannot publish them, and unacked worker deliveries remain available for redelivery. Long-running workers also retain their bounded 250 ms to 30 second consumer reconnect backoff; it paces the service loop while the circuit controls process-wide broker admission. Per-message retry queues and retry budgets remain independent because they govern processing outcomes, not broker availability.

FlagEnvironmentScopeDefaultPurpose
--messaging-circuit-breaker-enabledVIGILO_MESSAGING_CIRCUIT_BREAKER_ENABLEDcoordinator, workertrueEnables the process-local message-broker circuit breaker.
--messaging-circuit-failure-thresholdVIGILO_MESSAGING_CIRCUIT_FAILURE_THRESHOLDcoordinator, worker3Consecutive broker availability failures required to open the circuit.
--messaging-circuit-initial-open-secondsVIGILO_MESSAGING_CIRCUIT_INITIAL_OPEN_SECONDScoordinator, worker10Initial open interval before one recovery probe is admitted.
--messaging-circuit-max-open-secondsVIGILO_MESSAGING_CIRCUIT_MAX_OPEN_SECONDScoordinator, worker120Maximum open interval after repeated failed probes.

Returned or negatively acknowledged publishes, malformed messages, and other application-level failures do not mark RabbitMQ unavailable. Circuit state is process-local and resets on restart; durable PostgreSQL state and RabbitMQ delivery state remain authoritative.

Worker Chunk Concurrency

vigilo worker start processes chunk-ready broker messages with bounded per-process concurrency. The default keeps one per worker process, which matches the safest local development posture and scales horizontally by running more workers. RabbitMQ matches that limit so a worker does not reserve messages it cannot process. Larger deployments can raise the limit when chunks are uneven, agent calls are I/O-bound, or retry waits create tail latency.

FlagEnvironmentDefaultPurpose
--max-inflight-chunksVIGILO_WORKER_MAX_INFLIGHT_CHUNKS1Maximum unacked chunk messages processed concurrently by one worker process. RabbitMQ stream prefetch is set to the same value so a worker does not reserve more chunk messages than it can actively process.

Run Creation Paging

Immediate creation and coordinator recovery use the same explicitly validated paging policy.

FlagEnvironmentScopeDefaultPurpose
--run-creation-case-batch-sizeVIGILO_RUN_CREATION_CASE_BATCH_SIZErun create, coordinator1000Maximum cases written in one creation page.
--run-creation-case-page-budgetVIGILO_RUN_CREATION_CASE_PAGE_BUDGETrun create, coordinator64Maximum pages written for one placement attempt.
--default-shard-database-aliasVIGILO_DEFAULT_SHARD_DATABASE_ALIASsetup, run createprimaryDefault target for single-default assignment.
--shard-assignment-policyVIGILO_SHARD_ASSIGNMENT_POLICYsetup, run createsingle-defaultPlacement policy used for newly created runs.

When increasing this value, size the database pool, agent endpoint capacity, , and Wasm evaluator concurrency together. A practical upper-bound check is:

max_inflight_chunks * case_parallelism_per_chunk <= agent/db concurrency budget
wasm_max_concurrent_evaluations <= CPU and memory budget

Wasm Evaluator Isolation

Each evaluator invocation runs in a fresh with CPU, memory, table, instance, timeout, and logging limits. bounds deterministic instruction use. Workers also use a process-wide so valid evaluators cannot exhaust host resources. These flags are scoped to worker, setup, evaluator publish, and evaluator test.

FlagEnvironmentDefaultPurpose
--wasm-max-memory-bytesVIGILO_WASM_MAX_MEMORY_BYTES67108864Maximum linear memory bytes per evaluator invocation.
--wasm-max-table-elementsVIGILO_WASM_MAX_TABLE_ELEMENTS10000Maximum table elements per evaluator invocation.
--wasm-max-instancesVIGILO_WASM_MAX_INSTANCES3Maximum component instances per evaluator invocation.
--wasm-max-memoriesVIGILO_WASM_MAX_MEMORIES1Maximum linear memories per evaluator invocation.
--wasm-max-tablesVIGILO_WASM_MAX_TABLES2Maximum tables per evaluator invocation.
--wasm-fuel-per-evaluationVIGILO_WASM_FUEL_PER_EVALUATION50000000Wasmtime fuel budget for deterministic CPU interruption.
--wasm-timeout-msVIGILO_WASM_TIMEOUT_MS5000Wall-clock timeout enforced by epoch interruption.
--wasm-epoch-tick-interval-msVIGILO_WASM_EPOCH_TICK_INTERVAL_MS10Epoch ticker granularity used for timeout checks.
--wasm-max-concurrent-evaluationsVIGILO_WASM_MAX_CONCURRENT_EVALUATIONS8Hard process-local cap on active Wasm evaluator invocations.
--wasm-max-log-message-bytesVIGILO_WASM_MAX_LOG_MESSAGE_BYTES4096Maximum bytes retained from each evaluator host log message.
--wasm-max-log-messagesVIGILO_WASM_MAX_LOG_MESSAGES128Maximum evaluator host log messages per invocation.

Sizing

Set VIGILO_WASM_MAX_CONCURRENT_EVALUATIONS from available CPU and memory, not from queue depth. A worker's evaluator memory exposure is approximately:

wasm_max_concurrent_evaluations * wasm_max_memory_bytes

plus Wasmtime/runtime overhead and non-evaluator worker memory.

For example, the defaults allow up to 8 active evaluator invocations at 64 MiB each, or about 512 MiB of evaluator linear memory exposure per worker process.

Failure Behavior

If an evaluator exceeds its sandbox budget, the invocation is recorded as an evaluator runtime error. The worker continues processing the rest of the batch and persists the error result through the normal evaluator-result path.

Outbound evaluator HTTP remains denied unless a future policy explicitly enables it.