Bench Datastore
Datastore benchmarking harness for swamp. Two workflow-based test scenarios that exercise any swamp datastore backend under sustained load without lock contention.
Scenario A: Throughput (breadth)
Each worker owns isolated models. Cycles through write → read → query operations measuring per-step latency. Tests: sync push/pull speed, chunked storage, GSI queries, workflow overhead.
Scenario B: Write Stress (depth)
Each worker owns one model, writes continuously with varying payload sizes. Tests: sustained single-writer throughput, version accumulation, chunked vs inline performance, hot-partition behavior.
Usage
swamp extension pull @webframp/bench-datastore
# Create harness instance for worker 1 (throughput scenario)
swamp model create @webframp/bench-datastore/harness bench-harness-w001 \
--global scenario=throughput --global worker_id=1 --global models_per_worker=50
# Setup (creates worker-owned models)
swamp model method run bench-harness-w001 setup
# Run throughput cycle once
swamp workflow run @webframp/bench-throughput-cycle \
--input harness_model=bench-harness-w001 \
--input probe_model=bench-probe-w001 \
--input iteration=1
# Run write-stress once
swamp workflow run @webframp/bench-write-stress \
--input harness_model=bench-harness-w001 \
--input probe_model=bench-probe-w001 \
--input iteration=1Both workflows are designed to be called in a tight loop by an ECS Fargate worker or local script. Duration is controlled by the caller.
2026.07.24.1
Added: Initial release of the datastore benchmarking harness.
- Two workflow-based scenarios: throughput (breadth) and write-stress (depth)
- Zero lock contention by construction — each worker owns isolated models
- Backend-agnostic measurement of datastore I/O independent of swamp core locking
- Configurable at runtime via workflow inputs (scenario, worker count, duration controlled by caller)
- Deployable on ECS Fargate or runnable locally
- Payload delivery uses stdin streaming via temp files to avoid Linux MAX_ARG_STRLEN (131072 bytes) limit on large (500KB) write-stress payloads
- Probe measurements in workflows are scoped to the worker's harness model via
--modelfilter to prevent cross-worker data inflation under concurrent load payload_sizeaccepted as an optional workflow input on bench-write-stress for controlled single-size runs
Resources
Single iteration of the throughput benchmark. Executes one model method (rotated by iteration), then reads back the data and checks datastore health. Designed to be called in a tight loop by an ECS worker. Measures: write latency, read latency, datastore health, and workflow orchestration overhead.
Single iteration of the write-stress benchmark. Writes a payload of configured size to the worker's model, then reads it back to verify. Designed to be called in a tight loop with no sleep between iterations. Payload sizes rotate: small (100B), medium (10KB), large (500KB+). Large payloads exercise the chunked storage path. Measures: write throughput, chunk handling, version accumulation, read-after-write latency, sustained single-writer performance.
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned