Skip to content

Runtime, build and scheduling configuration

Runtime, build and scheduling configuration

Section titled “Runtime, build and scheduling configuration”

Read overview for S/F/D/W and restart semantics. All variables here are optional except stated conditional compilation requirements. Units differ: pool deadlines generally use milliseconds; execution/lane deadlines generally use seconds.

VariableType; binary defaultRange, scope and override
VIAT_DEFAULT_TIMEOUT_SECSu64; 30 sD. Positive; 0/invalid → default. Fallback after target declaration and project default, then clamped to ceiling.
VIAT_MAX_TIMEOUT_SECSu64; 300 sD. Positive sync ceiling; 0/invalid → default. Target/project can lower, not raise. Also influences stale idempotency/upload sweep horizons.
VIAT_MAX_ASYNC_TIMEOUT_SECSu64; 1800 sD. Positive async ceiling; 0/invalid → default. Queue-trigger validation parses positive i64 and compares to ack deadline.
VIAT_ASYNC_MAX_INFLIGHTusize; 128 runsF. Positive, per-process inflight semaphore. Separate from queued depth and long-run/stream permits.
VIAT_SHARED_MAX_TIMEOUT_SECSu64; 60 sD. Positive; resolved timeouts at or above this threshold enter long-run lane where applicable. Not an execution ceiling.
VIAT_LONGRUN_MAX_CONCURRENTusize; 8 runsF. Positive; per-process long-running one-shot permits. Does not bound every in-process database/SQL operation.
VIAT_LONGRUN_QUEUE_WAIT_SECSu64; 5 sD. Positive; synchronous callers wait this long for a long-run permit before 503. Durable queued work can wait until cancellation instead.
VIAT_STREAM_MAX_CONCURRENTusize; 8 streamsF. Positive; per-process streaming worker permits, distinct from shared pool.
VIAT_STREAM_QUEUE_WAIT_SECSu64; 30 sD. Positive; wait for streaming lane admission, not stream execution lifetime.
VIAT_QUEUE_MAX_DEPTHi64; 1000 runsD. Positive; waiting runs per concurrency key; full queue refuses new submissions.
VIAT_DELAY_MAX_DEPTHi64; 100000 runsD. Positive; delay-only backlog cap using synthetic _delay key. Not execution concurrency.
VIAT_QUEUE_POLL_MSu64; 1000 msD (dispatcher initialization). Positive; periodic claim scan in addition to local wakeups. Lowering increases database work.
VIAT_TASK_MAX_DEPTHu16; 100 hopsD. Positive; recursive task.call/task.delay hop ceiling, not number of sibling tasks.
VIAT_QUEUE_ACK_DEADLINE_SECSi64; 1500 sD. Positive RabbitMQ acknowledgment budget. Default async ceiling 1800 exceeds it: configure a coherent ceiling/deadline, or explicitly accept trigger ack_deadline_override risk.
VIAT_SHUTDOWN_GRACE_SECSu64; 10 sD (shutdown). 0 is accepted; grace drain budget, not durable checkpointing of running scripts. Container stop deadline must be longer.
VariableType; binary defaultRange, scope and override
VIAT_POOL_SHARED_MAXusize; 16 workersS. Shared warm-slot capacity. Parser accepts 0; use at least 1 operationally. Dedicated/one-shot lanes add capacity outside this value.
VIAT_POOL_QUEUE_DEPTHusize; 32 requestsS. Shared-pool waiting queue; 0 accepted. Distinct from durable async queue.
VIAT_POOL_QUEUE_WAIT_MSu64; 5000 msS. Pool wait deadline; 0 accepted, effectively no grace.
VIAT_POOL_READY_TIMEOUT_MSu64; 10000 msS. Request-path worker READY timeout, not script execution budget; 0 accepted but unusable for normal cold starts.
VIAT_POOL_BUILD_TIMEOUT_MSu64; 300000 msS. Publish/environment build default. Script build-timeout declaration can override within build_timeout_max; 0 accepted by parser.
VIAT_POOL_BUILD_TIMEOUT_MAX_MSu64; 3600000 msS. Deployment ceiling for script build-timeout declarations. 0 accepted by parser; keep coherent with default.
VIAT_POOL_AUTO_PROMOTE_QPSf64; 10.0 requests/sS. Auto promotion threshold; 0.0 disables auto switching. No robust finite/nonnegative validation; use finite nonnegative values.
VIAT_POOL_AUTO_DEMOTE_QPSf64; 2.0 requests/sS. If promote >0 and demote >= promote, effective demote becomes promote/2. Use finite nonnegative value.
VIAT_POOL_AUTO_WINDOW_SECSusize; 60 sS. Rolling QPS window, clamped to at least 1.
VIAT_POOL_AUTO_DEDICATED_COUNTusize; 2 workersS. Slots on auto promotion, clamped to at least 1. Adds processes; not a CPU reservation.
VIAT_POOL_AUTO_MIN_DWELL_SECSu64; 60 sS. Minimum promoted dwell before demotion; 0 accepted.
VIAT_POOL_AUTO_TICK_SECSu64; 5 sS. Reconciliation tick, clamped to at least 1.
VIAT_BOOT_WARMboolean; on / 开启S. Literal 0/false disables background boot environment warming. Does not block HTTP startup; warming can still be incomplete when readyz is green.
VIAT_ENV_GATEboolean; off / 关闭D. Exactly 1/true enables refusing runs whose environment is known failed. Default off; does not itself install dependencies.
VIAT_ENV_RETRY_BACKOFF_SECSi64; 300 sD. Failed environment retry backoff, clamped to >=0. Zero permits immediate retry.
VIAT_PYTHON_PRELOADstring; psycopg2-binaryW. Space/comma-separated package specs; explicit empty value disables preloads. This changes environment/dependency needs, not just logging.
VIAT_SHELL_BINpath; /bin/bashW. Shell executable must exist and be worker-executable. Docker explicitly supplies /bin/bash.
VariableType; binary defaultRange, scope and override
VIAT_PUBLISH_BUILD_BLOCKboolean; off / 关闭D. Exactly 1/true blocks publish with 409 on build failure. Default records diagnostics but does not block; not a substitute for regression gate.
VIAT_PUBLISH_BUILD_ASYNCboolean; off / 关闭D. Exactly 1/true starts builds in background while routes go live; do not expect synchronous build blocking to protect those routes.
VIAT_PUBLISH_REGRESSION_TIMEOUT_SECSu64; 120 sD. Whole publish regression-suite budget; parsed value clamped 1..3600.
SCHEDULER_ENABLEDboolean; trueS. Literal false/0 disables scheduler only. Image sets true. Queue, alerts, chat, watchers and retention are separate loops.
VIAT_DEFAULT_SCHEDULE_TZIANA zone; UTCD (schedule writes). Trimmed; blank → UTC; unknown zone rejects write. Stored per schedule; changing deployment default does not retime existing schedules.
VIAT_SCHEDULE_MISFIRE_GRACE_SECSi64; 60 sD. Positive; maximum lateness for a due cron fire before recording/skipping a misfire. Not replay of every missed occurrence.
VIAT_RUST_AUTHORINGboolean; on / 开启D. Trim/case-fold 0/false/off/no/disabled rejects Rust create/update (400 bad_request). Existing published binaries can still run.
VIAT_BUILD_ENABLEDboolean; on / 开启D. Same falsy set as Rust authoring disables compilation here. SDK/toolchain still needed when on. Run-only node needs compatible prebuilt artifacts.
VIAT_RUST_ARTIFACT_UPLOADboolean; off / 关闭D. Explicit artifact-upload opt-in; see exact accepted spelling below. Allows authorized upload, not unauthenticated executable deployment.
VIAT_RUST_SDK_PATHpath; unset / 未设置D. Required to compile, not to fetch/run compatible artifacts. -build image: /opt/viat/rust-sdk; SDK digest must match server.
VIAT_RUST_ARTIFACT_DIRpath; <tmp>/viat-rust-artifactsD. Local binaries/cache. -build image: /var/lib/viat/rust-artifacts. Persist or supply shared store; local-only cache is not fleet distribution.
VIAT_RUST_TARGET_DIRpath; <tmp>/viat-rust-buildD. Cargo target directory. -build image: /var/lib/viat/rust-target. Separate disk budget from artifact LRU. Also client-side compile override.
VIAT_RUST_BUILD_TIMEOUT_SECSu64; 300 sD. One cargo build deadline; 0 accepted. Separate from Python READY/build budgets and CLI wait timeout.
VIAT_RUST_CACHE_MAX_BYTESu64; 5368709120 bytesD. Local artifact cache cap (5 GiB), LRU eviction; 0 disables cap. Does not cap Cargo target directory or shared bucket.
VIAT_RUST_S3_BUCKETstring; unset / 未设置D. Nonblank enables shared artifact bucket with local cache in front. Not a project S3 resource.
VIAT_RUST_S3_REGIONstring; us-east-1D. Empty/blank → default. Used for signing and endpoint derivation.
VIAT_RUST_S3_ENDPOINTURL; derived / 自动推导D. Override for compatible object stores; absent derives regional AWS S3 endpoint.
VIAT_RUST_S3_ACCESS_KEYstring; empty / 空D. Explicit platform artifact credential; practically required with bucket for authenticated stores. No AWS SDK identity-chain fallback in this configuration.
VIAT_RUST_S3_SECRET_KEYstring; empty / 空D. Pair with access key; not forwarded to guest workers by default.
VIAT_RUST_S3_SESSION_TOKENstring; unset / 未设置D. Optional temporary-credential session token; maintain its validity with deployment credentials.
VIAT_RUST_S3_PATH_STYLEboolean; off / 关闭D. Exactly 1/true uses path-style URLs, useful for compatible stores.
VIAT_RUST_S3_GCboolean; off / 关闭D. Exactly 1/true enables shared artifact garbage collection after publish. Unsafe across mixed architectures/toolchains or rolling upgrades; keep off unless live-set is demonstrably complete.
  1. Inspect the endpoint’s effective budget: source, clamp and predicted lane. # timeout: or workflow timeout wins over project default; deployment default is only the fallback. Sync and async ceilings are independent. Raising VIAT_MAX_TIMEOUT_SECS does not raise an always-async endpoint’s ceiling.
  2. Separate durable-queue wait, lane-permit wait, shared-pool wait and worker READY. Changing execution timeout does not repair a dependency installation that exceeds READY; check package source, dependency, cache and environment build status.
  3. Measure representative scripts in an isolated project: cold/warm startup, tail latency, RSS, PIDs/threads, connections and disk growth. Change one parameter group at a time. No cross-hardware throughput benchmark is promised here.
  4. Shared short runs, dedicated slots, long runs, streams and in-process resource calls are not one global concurrency count. Raising one limit can just move the bottleneck to PostgreSQL or memory. See capacity.

Default publication attempts dependency builds, but a failed build need not prevent routes becoming active. For blocking, use synchronous builds with VIAT_PUBLISH_BUILD_BLOCK=1 and verify failure responses in an isolated project. VIAT_PUBLISH_BUILD_ASYNC=1 starts background builds while routes go live; do not rely on synchronous blocking in that mode. Regression-test gates and build gates are separate.

Persist /home/viat/.cache/uv, configure trusted Python/npm mirrors, and explicitly empty VIAT_PYTHON_PRELOAD if appropriate. The image warms CPython 3.12 and the default psycopg2 cache; this does not make all user dependencies offline-ready. Revalidate builds after replacing containers, clearing caches or changing dependency versions. Proxy/CA forwarding is covered in integrations.

The slim image has no Rust toolchain. Nodes that compile need the matching -build artifact and SDK validation. Run-only nodes use VIAT_BUILD_ENABLED=0 and shared artifacts or an authorized compatible upload workflow. VIAT_RUST_ARTIFACT_UPLOAD enables on trimmed, case-folded 1, true, yes, on, enabled; other values disable it. Do not give untrusted authors build capability: Cargo build scripts execute with the builder’s privileges.

SCHEDULER_ENABLED=false stops cron only, not the durable queue, chat, queue triggers, watches, alerts or retention. The default timezone is written into new cron rows; edit existing schedules explicitly to change their timezone. Misfire grace is not replay of every occurrence missed during downtime.

RabbitMQ’s default 1500-second acknowledgment deadline is below the 1800-second async ceiling, so trigger creation/update can be refused. First reconcile broker consumer timeout, deployment execution ceiling and acknowledgment budget; ack_deadline_override accepts the risk of redelivery while the previous run still executes, not an extension of the broker’s limit. Consumption is at-least-once; handlers should be idempotent.

Shutdown stops queue claims and tries to drain background work. Not-yet-started durable queued rows survive replacement. Running scripts are not resumable processes: after a crash they may be marked interrupted/failed while external side effects have already occurred. Before replay, use run operations.