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

A reproducible benchmark beside other PDSes: the reference, vlpds and zds

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/monolith:bench

A benchmark of the server beside other PDS implementations on one machine, reproducible from the repository: the reference @atproto/pds, spec-pds, vlpds and zds.

harness/bench.mjs:

  • Workload: perf.mjs's, plus applyWrites and listRecords. Each part reports throughput, p50 and p99; each server reports its start time and memory (idle and peak RSS).
  • Runs: one server at a time, each round a fresh server on fresh data with its own in-memory PLC directory, warmed the same way; three rounds, best and median reported.
  • Adapters: each implementation is a small adapter in bench.mjs. A part a server can't serve is reported with the reason.
  • Order: in every table the reference comes first, as the baseline. node bench.mjs --report renders the tables again from a saved run.

It is a tool, not a gate: no check of spec/ depends on it, and the gates don't run it.

Reproducible:

  • Pins: bench/impls.json pins every implementation:
    • spec-pds: this repository;
    • the reference: @atproto/pds 0.5.55, through harness/package-lock.json;
    • vlpds: release v1.3.0's image, by digest, with RustFS as its S3 store, by digest; RustFS passes vlpds's vlpds-bucket-probe;
    • zds: v0.7.8 at commit cef2c63, built natively from its own Dockerfile into a gitignored bench/vendor/.
  • Commands: node bench.mjs --setup pulls and builds them, idempotently, with a clear error for a missing prerequisite. node bench.mjs --rounds 3 runs everything.
  • bench/README.md: prerequisites, the commands, what each part measures, how to add an implementation, and the fairness rules.
  • Checked: the results were produced from a clean state, exactly as the README says.

bench/RESULTS.md: the first results, on an M1 Pro, best of three rounds:

Referencespec-pdsvlpdszds
createAccount/s7055487
createRecord/s309378718539
applyWrites/s159294409390
getRecord/s1,08516,4654,9913,149
listRecords/s7207,7154,1752,115
getRepo/s5124,2761,926815
uploadBlob/s395419167356
firehose, commits/s4,3243,5702,4481,087
start2.4 s37 ms1.2 s228 ms
idle RSS399 MiB14 MiB165 MiB17 MiB
peak RSS608 MiB74 MiB385 MiB49 MiB

vlpds's RustFS is counted apart: 175 MiB idle.

The caveats, all in the results file:

  • Durability differs.
    • spec-pds flushes through the drive's cache (F_FULLFSYNC).
    • The reference does a plain fsync on macOS and never syncs blobs.
    • vlpds answers once its log segment is in the bucket.
    • zds uses SQLite WAL with synchronous=FULL; its blobs are never synced.
  • Docker: vlpds and zds run in Docker's Linux VM, the other two natively.
  • Load: the machine was loaded.
  • One client: a single Node client drove all four.
  • zds's createAccount runs one at a time, behind its store lock as far as the timings show.

The README says how to run it.

🤖 Generated with Claude Code

Approved

This adds harness/bench.mjs, bench/RESULTS.md with bench/results.json, and a README paragraph. It is a standalone tool: it changes no server behaviour, no spec/ file, no crates/ code and no harness/conformance.yaml entry. The README paragraph says what exists and how to run it, with no history. The caveats in the results (fsync differences, a loaded machine, a single client) are stated plainly and the inferences are marked as inferences.

I could not run it, so the numbers are unchecked. The code reads correctly. Each round gets a fresh PLC directory, data directory and server. The warm-up and the measured run use separate accounts. Failed responses stop the run instead of being counted.

One thing to fix later, not a blocker. The "unsupported part is skipped and reported" path breaks parts that depend on others. If an adapter marks createRecord unsupported, st.records stays empty and getRecord fails on an undefined record. An adapter's unsupported map would need to skip the dependent parts as well, or the reason would need to say so.

harness/bench.mjsline 302Outdated
const warm = { tag: 'warm', accounts: [], records: [] }
const st = { tag: 'bench', accounts: [], records: [] }
for (const [part, [n, at, fn]] of Object.entries(PARTS)) {
if (adapter.unsupported[part]) continue
review.knotless.dev

Skipping an unsupported part leaves later parts that read its state (getRecord needs createRecord's records, everything needs createAccount's accounts) with nothing to read. Skip those too, or report them as depending on the unsupported part.

Approved

Carried forward: the change this pull makes at ada83895dd5fbdd4e27d81eab82e014ee5fd7bc2 is the one reviewed at 32319e0944ed4043fd76373488b57424798da201, so that review stands. What is new comes from its base.

Updated to d14e151: main merged in (the TCP_NODELAY fix, whose absence ejected the last run), and vlpds added: its release image and RustFS pinned by digest in bench/impls.json, node bench.mjs --setup, bench/README.md, and three-way results from a clean state. The body describes all of it.

Approved

This round adds vlpds, run as its release image with a RustFS S3 store, both pinned by digest in bench/impls.json. It also adds a --setup command, a --report command, bench/README.md, a just bench recipe and the new @aws-sdk/client-s3 dependency. It changes no server behaviour, nothing in spec/ or crates/, and no conformance.yaml entry. The root README paragraph says what exists and how to run it, with no history. I read every changed file except bench/results.json, which is raw output. I could not run anything, so the numbers are unverified.

What I read looks correct:

  • Each round gets its own PLC directory, data directory, port, and vlpds network, volume and containers. Failures stop the run, and a failed round keeps its log.
  • Memory sampling is clearly separated, so RustFS's memory is not counted as vlpds's.
  • The caveats are plain and the inferences are marked as inferences. The main ones are durability that differs per server, vlpds running in a VM, a loaded machine and a single client.

Two small things, neither blocking:

  • Unsupported parts: my earlier note still applies, since every adapter has unsupported: {}. An adapter that skips createRecord would also break getRecord, which reads st.records. The "Adding an implementation" section could say so, or the runner could skip dependent parts.
  • bench/RESULTS.md wording: the "Not run" section says other implementations "were dropped by the user's change of scope", which is history rather than a statement of what was measured. The pin line "branch bench-vlpds" has the same problem. Stating just what was run would read better.
Approved

This round adds zds as a fourth implementation. It is pinned in bench/impls.json at v0.7.8, commit cef2c63, and built natively by --setup from its own Dockerfile into the gitignored bench/vendor/. It also adds a zds adapter in harness/bench.mjs. I read the impls.json pin and the zds adapter. I did not read the rest of the round's diff line by line. That covers the rest of bench.mjs, bench/README.md and bench/results.json. I could not run anything, so the numbers are unverified.

The change touches no spec/, crates/ or conformance.yaml, and adds no crates. The harness change adds a benchmark; it does not loosen any check. The adapter is sound as far as I read it:

  • Setup: each round gets a fresh JWT secret, admin token and rotation key.
  • Container lifecycle: the container is created before the start clock and removed in teardown.
  • Stopping: the adapter kills the container because zds has no SIGTERM handler.
  • Config: the one non-default setting (ZDS_MAX_CONCURRENT_REPO_EXPORTS=8) is documented, with its reason.
  • Durability: the SQLite WAL and synchronous=FULL claim is marked as inferred, and the blobs-never-synced caveat is stated.

Two small items from earlier rounds remain; neither blocks:

  • History in bench/RESULTS.md: lines 236–237 still say other implementations "were dropped by the user's change of scope". That is history, not a statement of what was measured. The bench-vlpds branch pin I flagged last round no longer appears in the repository.
  • Unsupported parts: every adapter, zds included, has unsupported: {}, so the dependent-parts note from my first review is still open. An adapter that skipped createRecord would also break getRecord.
Merged as 7dfdbe7