Add loadtest/ harness and query sets

Two ramped-concurrency exercisers for POST /search/contents plus a flat
290-query list (58 topics x 5 templates) for feeding external harnesses.
Endpoint/key come from LWSS_BASE/LWSS_KEY env vars; no secrets committed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
User 2026-07-07 17:53:18 -07:00
parent 0a80d0ef26
commit cb1f887a48
4 changed files with 484 additions and 0 deletions

35
loadtest/README.md Normal file
View file

@ -0,0 +1,35 @@
# LWSS load tests
Ramped-concurrency exercisers for the live MCP endpoint. They hit
`POST /search/contents` (the full search → render → extract path — the part
that actually saturates under load) at increasing concurrency and report
latency + per-page render yield.
## Setup
Both scripts read the endpoint and bearer key from the environment — no
secrets are committed:
```sh
export LWSS_BASE="https://websearch.neilbantoc.dev" # or your own endpoint
export LWSS_KEY="<your MCP bearer key>"
pip install httpx
```
## Scripts
- **`loadtest.py`** — 36 hand-written natural queries, ramps `1,3,6,10,16,20`.
Reuses queries across levels (some cache hits expected at higher N).
- **`loadtest2.py`** — 290 unique queries (58 topics × 5 templates) so nothing
hits cache; ramps `1,4,8,12,16,20`. Best for measuring the true render
ceiling. Edit `LEVELS` to push harder.
- **`queries.txt`** — the 290 unique queries, one per line. Feed this straight
into opencode / a local model / your own harness.
## Reference numbers (2026-07, single-node deploy)
Clean cliff between **8 and 12 concurrent content-searches**: ≤8 is ~2s with
100% page yield; at 12+ latency hits the 60s stage timeout and yield drops
(92% → 72%). Zero errors at every level — degrades gracefully, never breaks.
The bottleneck is the Playwright renderer (each content-search fans out to 5
page renders), tunable via the renderer's `cpus` / browser-context pool.