# Local load test

**Last updated:** 2026-10-30T16:16:18-03:00 (UTC-3)

A reproducible experiment on the development workspace, without a release, using the gateway and a synthetic provider over loopback. No real key, external API or cluster resource is used. The results verify the harness and its limits; **they are not production capacity, a comparison with competitors, an SLO or a certification that there are no leaks**.

## Reproduction and limits

```bash
go run ./cmd/loadprobe -requests 200 -concurrency 8 \
  -destination-concurrency 4 -stream-percent 50

go run ./cmd/loadprobe -requests 200 -concurrency 8 \
  -destination-concurrency 4 -stream-percent 50 -failure-every 20
```

Additional defaults: a 512-byte synthetic prompt, a provider delay of 2ms per phase, at most 64KiB of response and a global deadline of 30 seconds. The command accepts up to 10,000 requests, 32 workers, a 64KiB prompt and a delay of up to 1 second; it does not accept an external URL or a credential. The flags are validated before the local servers start.

The first scenario mixes 100 JSON responses and 100 SSE responses. The second injects an HTTP 503 every 20 calls to the fake provider. The destination slot covers the complete response, and the stream test keeps the body in flight to confirm that the slot is not released at the headers.

## Result of this run

Environment: darwin/arm64, 12 CPUs reported, go1.27.3. This local runtime differs from the Go 1.25 toolchain declared in the image; repeat in the target environment before comparing results. The JSON files include the parameters, version and UTC time of the run.

| Measure | Mixed | Simulated failures |
| --- | ---: | ---: |
| Requests completed | 200 | 200 |
| HTTP 200 | 200 | 190 |
| Intentional HTTP 503 | 0 | 10 |
| Transport/read errors | 0 | 0 |
| Sample duration | 200.607 ms | 193.177 ms |
| p50 of the complete response | 7.691 ms | 7.437 ms |
| p95 | 10.937 ms | 10.246 ms |
| p99 | 12.668 ms | 12.437 ms |
| Sampled heap peak | 2612112 bytes | 2700144 bytes |
| Bytes allocated in the sample | 19403208 | 19388656 |
| GC cycles in the sample | 25 | 26 |
| Cumulative GC pause | 6.078 ms | 2.309 ms |
| Goroutines before → after cleanup | 1 → 1 | 1 → 1 |
| Sampled goroutine peak | 59 | 59 |

The 503s in the second scenario are planned and complete earlier; they do not represent a performance improvement. `errors` measures transport/read failures, while HTTP codes have a separate distribution. Memory/goroutines are sampled every 10ms; the sampled peak is not an absolute maximum. A GC is forced only after the experiment to observe the remaining heap; that GC is not counted in the sample's cycles/pauses.

A short sample of 200 responses does not support statistical inference about real p99, hours of operation or slow leaks. It also does not include PostgreSQL, external TLS, OIDC, the Collector, a network between nodes, a real provider, heavy media or a Kubernetes rollout.

Data: [mixed](https://github.com/m7gtw/gateway/blob/main/docs/performance/local-load-20261023-mixed.json), [failures](https://github.com/m7gtw/gateway/blob/main/docs/performance/local-load-20261023-faults.json). Implementation: [harness](https://github.com/m7gtw/gateway/blob/main/internal/loadprobe/probe.go); tests validate mixed profiles, controlled failures, percentiles and invalid parameters. For operation and the remaining limits, see [Kubernetes](/docs/operate/kubernetes-availability/), [admission](/docs/features/routing-and-admission/) and quality. The gateway's per-request cost is in [Performance](/docs/performance/overview/).
