mcploadgen

command
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Command mcploadgen is the on-demand load harness for `melange mcp --transport http`. It drives an initialize + tools/list + tools/call mix against a running server and reports RPS, p50/p95/p99 latency, and error rate as JSON (stdout) plus a human table (stderr), evaluating p95 budgets and exiting nonzero when one is breached. It is NOT run in CI; see script/mcp-loadtest.sh and `make perf`.

With --stub-backend it instead runs a tiny stand-in for the Melange API (GET /v1/me answers any bearer) so the whole harness needs no network.

Requests are raw stateless-streamable POSTs rather than SDK client calls, for measurement fidelity: latency is taken from immediately before the request is written to after the response body is fully read, with no SDK session queueing in between. Each worker uses its own bearer (--token base + worker index) so the server's per-token rate budget (120/min, burst 40) maps one bucket per worker; the pre-auth per-IP budget (300/min = 5/s sustained from one host) is shared by all workers, which is why the default pacing (--rps 4) sits under it — an unpaced localhost soak would measure the 429 path, not the server. Throttled responses are counted and reported separately so a mis-paced run is visible, not silently folded into latency or error numbers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL