Writing ·
Building a load generator that outgrows one machine
Why I wrote my own distributed load generator in Rust, how it coordinates a cluster with Raft, and how AI agents drive it over MCP. It is a private tool, not open source.
The problem
Load testing an API edge means producing more traffic than real users ever will, on purpose, and watching what breaks. The usual tools hit a wall before the systems I care about do.
One wall is the machine itself. A single IPv4 host can open roughly 65,000 connections to a target. Past that, adding CPU or memory doesn't help: the test needs more machines, and those machines have to act as one load generator rather than several tests that happen to run at the same time.
The design
I built my own distributed load generator in Rust.
Scale out only when the test needs it. A test that fits on one machine runs on one machine. When a test needs more connections than one IPv4 host can open, the nodes form a cluster.
Raft for coordination. The cluster uses Raft to agree on a leader. It runs at 1, 3, 5, 7 or 9 nodes, odd sizes because Raft needs a majority to make decisions.
Load follows the target, not a fixed split. You give the test a target request rate. The cluster shifts load across its nodes automatically until it reaches that rate, rather than splitting traffic evenly and hoping the sum comes out right.
Metrics built in. Live metrics come with the tool, so a run shows what is happening while it happens, without wiring up a separate stack first.
AI agents as operators. A full MCP endpoint lets my AI agents plan a test, run it and analyze the results end to end.
Results
I developed the platform myself, and it runs a number of tests for me every day. The generator has been tested to 300,000 requests per second, more than k6 reaches. Engineers who have used it say it outperforms anything else they've tried.
Tradeoffs
A cluster costs coordination. Running a consensus protocol is more moving parts than a single process. Keeping single-node tests on one machine means that cost is paid only when a test needs the scale.
Odd cluster sizes only. Restricting the cluster to 1, 3, 5, 7 or 9 nodes follows from Raft's majority rule: an even node count adds a machine without adding tolerance for failure.
Private on purpose. A tool that can produce this much traffic can also be used as an attack. That's why it isn't shared: no source, no binaries. This write-up covers what it does and how it is put together, not how to run it.
Questions about this? Email chris@thenomadops.com or find me on LinkedIn.