8000 perf: release performance gate for autoindex + search (budgets, ES floor, rc.99 regression harness) by xerj-org · Pull Request #2432 · xerj-org/xerj · GitHub
[go: up one dir, main page]

Skip to content

perf: release performance gate for autoindex + search (budgets, ES floor, rc.99 regression harness) - #2432

Merged
xerj-org merged 6 commits into
mainfrom
perf/release-gate
Oct 26, 2026
Merged

xerj-org merged 6 commits into
mainfrom
perf/release-gate

Conversation

@xerj-org
@xerj-org xerj-org commented Oct 26, 2026 •
Copy link
Copy Markdown
Owner

Refs #2433 (tracking issue: the workflow YAML and the release.yml change, for Ivan to add).

What

A release performance gate for xerj autoindex and search, so a build like rc.99 can't ship again (#2421 #2422 #2423 #2424 #2427 #2428).

  • scripts/perf/gen_corpus.py: a deterministic synthetic corpus (logs, jsonl, csv, json, code, markdown, docs), plus 20 queries per surface. It works standalone: python3 scripts/perf/gen_corpus.py --out DIR --size-mb 1024 --seed 2421. 1 GB takes about 23 s.
  • scripts/perf/autoindex_release_gate.sh → gate.py run|eval: starts a node with a fixed XERJ_MAX_PROCESS_MEMORY_MB cap and runs xerj autoindex exactly as a user would (XERJ_DISABLE_FEEDBACK=true). It samples node and client RSS, counts breaker trips, 429 retries and fatal log lines, and measures disk. It restarts the node, then runs 20 uncached queries each through the CLI (xerj search), raw _search, and MCP (xerj_search). It prints a markdown table plus results.json, writes to $GITHUB_STEP_SUMMARY, and exits 1 if any budget is missed (2 on an environment error).
  • --baseline <prev xerj binary>: runs the previous release on the same corpus and fails on a regression above 20%.
  • --engine-baseline es.json (scripts/perf/es_baseline.py): ES on the same corpus and runner. It bulk-loads with the default dynamic mapping, refreshes and flushes, force-merges to 1 segment, measures size, then runs the same queries. This enables the ratio budgets.
  • scripts/perf/budgets.toml: every budget with a justification, tiers smoke (200 MB) / 1gb / 5gb (release).
  • docs/perf-release-gate.md.

The 1gb tier runs in about 10–15 min on 4 cores when the build is healthy, since the timeout is 15 min.

Nothing under .github/ is changed. The workflow (perf-gate.yml) and the release.yml change are in the tracking issue, ready to paste.

Budgets

check smoke (200 MB) 1gb 5gb (release) why
autoindex completes (exit 0/3, node alive, no OOM/abort/EAGAIN, within timeout) 6 min 15 min 30 min #2423, #2427, #2428
throughput MB/s ≥ (absolute backstop) 1.5 3.0 3.0 about 0.5x the low end of ES on a 4-vCPU runner; rc.99 did 0.2–0.6
node peak RSS ≤ memory cap (MB) 2048 3072 3072 #2427: rc.99 hit 3.9 GB (autoindex) / 5.6 GB (_bulk) under a 3 GB cap
client peak RSS (MB) ≤ 768 1024 1536 #2424, #2428
state dir / source ≤ 1.2 1.2 1.2 #2421: 8.4 GB state for 5 GB
index + state on disk ≤ (MB) 250 1300 6400 about 1.2x source, stricter than ES force-merged (1.42x)
indices per prefix ≤ 40 40 40 #2422: 454; #2430 caps a run at 32
uncached search p95 / max (ms) 1000 / 2000 1000 / 2000 1000 / 2000 #2422: 13–23 s
search errors 0 0 0
queries with hits ≥ 90% 90% 90% catches "fast because it found nothing"
parent-breaker trips 0 0 0 #2427
bulk retries / 429s ≤ 20 20 50 #2427
node restart (s) ≤ 60 60 120
regression vs --baseline binary 20% 20% 20% throughput, p95, node/client RSS, state ratio, index bytes
index bytes vs ES (force-merged) ≤ 1.25x 1.0x 1.0x ES floor ([ratio.*])
ingest MB/s vs ES (default mapping) ≥ 0.3x 0.5x 0.5x ES floor; stretch goal 0.8x
search p95 vs ES ≤ — 1.5x 1.5x ES floor

The ratio floors come from the ES/Lucene measurement on the same 1 GB corpus (seed 2421), perf-floor results.md, 2026-10-25:

engine docs wall s MiB/s docs/s index bytes size ratio peak RSS MB
ES 9.5.5 default dyn. mapping (4g heap), refreshed, 28 segs 5,175,388 113.1 9.05 45,751 1,897,425,282 1.77 5,551
same, after force-merge to 1 seg (+48.7 s) 161.8 1,529,073,954 1.42
ES 9.5.5 text-only mapping 5,175,388 345.9* 2.96* 14,961* n/a n/a 4,909
Lucene 10.5.1 StandardAnalyzer, stored ON, 4 thr 5,175,388 40.4 25.4 128,199 833,041,346 0.78 3,036
Lucene 10.5.1 StandardAnalyzer, stored OFF, 4 thr 5,175,388 28.4 36.0 182,168 319,709,712 0.30 2,518
xerj rc.99 _bulk text-only (cap 3072 MB) 2,432,143 of 5.18M 836 (died) 0.37 2,909 n/a (368 MB at death) n/a 5,643

So rc.99 runs at about 0.04–0.07x ES throughput and misses the 0.5x floor by an order of magnitude. In bulk ingest the rc.99 node reached 5.6 GB RSS despite XERJ_MAX_PROCESS_MEMORY_MB=3072 (#2427). The gate's node-RSS check catches exactly that.

Local results

These ran on a shared, heavily loaded 8 vCPU / 16 GB box with about 0.4–1 GB RAM free, so I used the smoke tier (200 MB, 2 GB cap). A 1gb rc.99 run was stopped at 38.3% after 661 s (about 0.6 MB/s, 177 breaker trips, node RSS over its 3072 MB cap), and it was on course to hit the 15-min timeout.

rc.99 (v1.0.0-rc.99) — FAIL (expected)

check value budget result note
autoindex completes (no OOM/abort/EAGAIN/timeout) NO exit 0/3, node alive FAIL timed out after 425.0 s; exit -9
autoindex throughput (MB/s) 0.18 >= 1.5 FAIL 79 of 200 MB indexed in 425.0 s
node peak RSS (MB), cap 2048 2574 <= 2048 FAIL XERJ_MAX_PROCESS_MEMORY_MB=2048
client peak RSS (MB) 666 <= 768 pass peak threads 88
state dir / source 0.031 <= 1.2 pass 6 MB state
index + state on disk (MB) 92 <= 250 pass 0.46x source
indices per prefix 753 <= 40 FAIL 115883 docs
uncached search p95 (ms) 4244.4 <= 1000 FAIL cli 4856.7 / raw 1157.1 / mcp 3707.6
uncached search max (ms) 6257.3 <= 2000 FAIL n=60, errors=12
queries with hits (%) 80.0 >= 90 FAIL
search errors 12 0 FAIL
circuit-breaker trips 7 <= 0 FAIL
bulk retries / 429s 12 <= 20 pass
node restart (s) 4.41 <= 60 pass

A second rc.99 smoke run failed the same way, except the node died partway through (EAGAIN, best-effort helper thread was not started… memory). Every search then errored.

main (4a5de64c, 2 commits behind 8e61fc8c with no engine changes) — FAIL, partly confounded

check value budget result note
autoindex completes (no OOM/abort/EAGAIN/timeout) NO exit 0/3, node alive FAIL exit 1; node died; eagain x1; node OOM-killed by host kernel (box memory, not the cap)
autoindex throughput (MB/s) 0.24 >= 1.5 FAIL 72 of 200 MB indexed in 299.3 s
node peak RSS (MB), cap 2048 1842 <= 2048 pass XERJ_MAX_PROCESS_MEMORY_MB=2048
client peak RSS (MB) 644 <= 768 pass peak threads 159
state dir / source 0.027 <= 1.2 pass 5 MB state
index + state on disk (MB) 99 <= 250 pass 0.50x source
indices per prefix 753 (from node log; node dead at count) <= 40 FAIL same 753 as rc.99
uncached search p95 (ms) None <= 1000 FAIL
uncached search max (ms) None <= 2000 FAIL n=None, errors=None
queries with hits (%) None >= 90 FAIL
search errors None 0 FAIL
circuit-breaker trips 0 <= 0 pass
bulk retries / 429s 9 <= 20 pass
node restart (s) None <= 60 FAIL

Caveat: the main node was killed by the host's global OOM killer at 1.84 GB anon RSS, which is under its 2 GB cap, because the shared box was out of RAM. So the "completes" and search rows aren't a fair verdict on main. The rows that do hold up against rc.99:

A clean runner (CI) will give the real main verdict.

Notes

  • index_bytes for ES is defined after a force-merge: the refreshed size depends on the segment count (1.77x vs 1.42x source).
  • In CI, ES runs before xerj and is stopped first, never at the same time (ES uses about 5.5 GB RSS with a 4 GB heap). The last baseline is cached as a fallback.
  • Private repos get 2 vCPU / 8 GB runners: use the smoke tier with a 2 GB ES heap, or a larger runner.
  • The gate never sends xerj feedback (--disable-feedback + XERJ_DISABLE_FEEDBACK=true).

@xerj-org
Copy link
Copy Markdown
Owner Author

Xerj Merger made the fix: added an autoindex performance release gate under scripts/perf/. It generates a corpus, runs autoindex against a throwaway node with a fixed memory cap, and compares the results with the budgets in budgets.toml, optionally against a baseline. It's documented in docs/perf-release-gate.md. No workflow files were changed; wiring it into CI is a separate workflow change for the owner. This backs #2433. Merged for rc.100 at the owner's request.

@xerj-org
xerj-org merged commit 255519b into main Oct 26, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autoindex xerj autoindex: sniffing, inference, catalog cla-signed performance release Release process and release gating

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0