Documentation
¶
Overview ¶
Command example runs a self-contained simulation of agilelimiter against a toy downstream whose latency rises as the offered rate approaches its capacity, and whose capacity changes over time:
0s .. 3s healthy (capacity ~150 req/s) 3s .. 6s degraded (capacity drops to ~60 req/s) 6s .. end recovered (capacity back to ~150 req/s)
Watch the "rate" column: the controller discovers a safe rate, backs off when the downstream degrades, and ramps back up once it recovers. No real network is involved — the downstream is a formula — so this is deterministic enough to reason about and quick enough to run.
Run it with:
go run ./example
Directories
¶
| Path | Synopsis |
|---|---|
|
Command concurrency runs a self-contained simulation of the *inbound* ConcurrencyLimiter against a toy model of this very service, whose per-request handling time rises as more requests run at once, and whose capacity changes over time:
|
Command concurrency runs a self-contained simulation of the *inbound* ConcurrencyLimiter against a toy model of this very service, whose per-request handling time rises as more requests run at once, and whose capacity changes over time: |
|
Command httpserver runs a tiny net/http service whose /api/* routes are protected by an adaptive concurrency limiter, then hammers it with a burst of concurrent clients.
|
Command httpserver runs a tiny net/http service whose /api/* routes are protected by an adaptive concurrency limiter, then hammers it with a burst of concurrent clients. |