~ knotless Search/
↑↓ move↵ open⇧↵ all results

johnandersen777.bsky.social/atlibs

0
0
main
85 lines · 3.9 KB Raw History

Limits

What a module can use, the same in every host.

A run's budget

keydefaultwhat
inFlight6calls in flight at once; more wait their turn
subscriptions4subscriptions open at once
calls100calls in the whole run
callsPerMinuteunlimitedcalls per minute (a fixed window from the run's start); past it a call fails with Module exceeded N calls per minute and the run goes on, as past calls
events1000events the module handles
wallMs60000wall time of the run, in ms
queue256events waiting for the module; past it, subscription messages are dropped (dropped on the next message) or the subscription closes (close_on_overflow)
log1000call records kept in the result (the last ones)
ioBytes1048576 (1 MiB)the wasm's input and output per event, JSON bytes; never past 16 MiB
heldBytes16777216 (16 MiB)the run's held values together, JSON bytes

A host may change them: ATLIBS_BUDGET for the CLIs, budget for runModule. A host may also set calls, callsPerMinute, events and wallMs unlimited: Infinity in runModule's budget, the string "unlimited" in JSON (ATLIBS_BUDGET='{"calls":"unlimited","wallMs":"unlimited"}'). Unlimited wallMs sets no deadline: the run ends when the module is done, nothing is pending, or the host aborts it. Any other value that is not a positive number leaves the default.

ioBytes is the one to raise for big values: an event's input holds the module's state and the event (a call's output, binary bodies as $bytes), its output the calls it makes. 16 MiB is the ceiling whatever a host sets: the input sits in the module's 64 MiB memory beside its parsed copy, what it decodes and its output, and past that most modules would run out of memory anyway. A manifest's budget only lowers it, like the rest.

ATLIBS_BUDGET='{"events":1}' atlibs run examples/rust/compose/composition.json ui caller '{"nsid":"com.example.compose.lookup","input":{"n":2}}' \
  --handler confirm=wasm:examples/rust/compose#lookup 2>/dev/null | jq -r .error
Module exceeded 1 events

A module that serves

The defaults fit a one-shot action. A module that answers requests until the tab closes (an ingress answering HTTP through a relay) needs calls, events and wallMs unlimited; give it a callsPerMinute when it holds a session. What still bounds it: inFlight, subscriptions, queue, the time per event, and its calls list and session scope.

The wasm

limitvalue
module size4 MiB (build release)
input and output per event1 MiB each; a host may raise it to 16 MiB (ioBytes above)
memory1024 pages (64 MiB)
time per event5 s
importsnone
entry names[A-Za-z_][A-Za-z0-9_]{0,63}

Calls

  • Only NSIDs in calls (when the module lists any).
  • params are strings ("limit": "10"); bodies are JSON.
  • Writes: only records this host created for the module, or any record in an anyRecords collection.
  • Signed in: only what the module's own session record's scope allows (Server sessions).
  • Plain HTTP (com.fedfork.exec.http.fetch): only origins in both the module's http and the host's allowlist; no redirects; the response body arrives whole (calls).

Compositions

limitdefault
depth8 routed calls deep
calls100 routed calls per run

A manifest's limits (and an instance's budget) may lower them, never raise them past a host's, and never say unlimited. A host may set calls unlimited (runCompose's limits).

Hosts

wasm runs at once per Node or Rust processATLIBS_WASM_CONCURRENCY (default: the core count)
WebRTCSTUN only, no TURN

Previous: Lexicons | Next: Environment