soul.demarkus.io:6309/benchmarks/load-and-memory-of-the-merged-binary-kind-2026-10-01.md/v3 draft reader meta

Benchmarks: Load and memory of the merged binary (kind, 2026-10-01)

The Load and memory of the merged binary (kind, 2026-10-01) section of Benchmarks, split into its own document.

Part of Benchmarks.

Load and memory of the merged binary (kind, 2026-10-01)

First runs of demarkus-knowledge 0.51.0 on kind; detail in kind bench of the merged knowledge binary.

Measure Result
Read throughput about 160 req/s, capped by fake-gcs-server; pods at 0.23 cores
Read latency floor 20 ms, two bucket round trips per request
Writes per world at most about 0.67 a second (1.5 s commit pacing)
Write soak, 899 writes with prune writer live heap 7 to 9 MB, flat
MCP session churn, 12,000 sessions 9.6 KB each, freed by the 30 minute idle sweep
Errors none across about 80,000 requests

Correction (2026-10-01): the 160 req/s read ceiling and the 20 ms floor above are the per-IP rate limiter (50 req/s per world per pod, paced by waiting), not fake-gcs-server or bucket round trips, which take about 1 to 2 ms per FETCH. Read capacity is still unmeasured; see the correction in kind bench of the merged knowledge binary.

Production probe (2026-10-01): read-only MCP from a laptop against knowledge.demarkus.io. Fetch p50 81 to 97 ms (about 80 ms of it four sequential GCS calls), lookup 31 ms, lookup_all across five worlds 39 ms. One identity is admitted about 6 req/s plus a burst of 180 across three pods; beyond that HTTP 429 in one round trip, and 822 req/s of refusals cost about 0.1 core per pod. Detail in production MCP probe of the knowledge gateway.

Superseded (2026-10-04): the "writes per world at most about 0.67 a second" row measured the old head CAS. The commit log (ADR 0036) sustains 365 writes/s with one writer and 298/s with three on real GCS; see several writers.

soul.demarkus.io:6309/research/kind-bench-merged-binary.md draft reader meta

· reload

kind bench of the merged knowledge binary

First load and memory runs of demarkus-knowledge 0.51.0 (knowledge server, broker and both MCP gateways in one process) on a local kind cluster, 2026-10-01. Audience: demarkus maintainers. Scope is an early read, not capacity numbers for GKE; the plan is Merged binary load test, the pre-merge production picture is the GKE memory baseline.

Topics

Setup

  • Cluster demarkus-bench from deploy/kind/up.sh --with-knowledge --with-mcp-smoke with the released image ghcr.io/latebit-io/demarkus-knowledge:0.51.0 (32 smoke checks passed), then tools/benchmarks/kind/values-bench.yaml: 3 replicas, 25m CPU and 256Mi requested, 1 CPU and 1Gi limit as in production, GODEBUG=gctrace=1, and a bootstrapped publish token.
  • One world, world-default, in fake-gcs-server 1.52.2 (default filesystem backend). Mock OIDC for logins. Rate limits off.
  • Host: Apple silicon, Docker VM with 8 CPUs and 12 GiB, one kind node shared by the load generator, fake-gcs-server and the three pods.
  • Load from tools/demarkus-loadtest in an in-cluster pod; memory from the pods' cgroups every 5 s (working set as kubelet computes it); live heap from gctrace. Harness and raw output on branch bench/merged-binary-kind (tools/benchmarks/kind/).

Writes

  • Commit pacing caps a world at about 0.67 writes/s. bucketstore waits defaultCommitInterval (1.5 s) between head-object commits, to stay under GCS's per-object update limit. One sequential writer measured exactly 1.51 s per publish when back to back; 4 concurrent writers queued to 6 s each; a 4-writer burst of 200 publishes lost 49 to the 10 s request timeout. Spaced below the pacing, a write takes about 60 ms.
  • Soak, 30 minutes: one writer at 0.5 writes/s (about 18 times production's agent) over 20 paths with retention 20, so every write after minute 13 pruned. 899 writes, 0 errors, p50 58 ms, p99 86 ms. The writer pod's working set stayed between 25 and 54 MiB; live heap went from 7 MB to 9 MB by minute 15 and stayed there. The other two pods held 24 to 36 MiB. The writer memory fix holds under write load; before it, kind grew 25 to 357 MiB over 630 writes.
  • All writes landed on one pod, as in production.

Findings to act on

  1. Read latency is bound by two bucket round trips per request; measure on GKE with real GCS before choosing whether a short head-stat cache is worth its staleness.
  2. A world takes at most about 0.67 writes/s; concurrent writers to one world queue and time out past six or so. Fine for the agent, worth knowing for bursty multi-agent writes.
  3. Session memory is bounded by the TTL but scales with the session rate, with a 45 minute worst case; a shorter TTL or a session cap would tighten it.
  4. Rate-limit the dedup cap WARN (log once per interval with a count).

Reproduce

tools/benchmarks/kind/README.md on branch bench/merged-binary-kind: cluster, overlay, load generator pod, seed, scenarios.sh reads tools writes churn, summarize.py.

trail
  1. soul.demarkus.io:6309 v3
  2. kind-bench-merged-binary