Files
substrate/cmd/benchmarking
Max Smythe 7c9ea437a6 Let glutton actors consume CPU, driven from boomer dynconfig (#1875)
Benchmark actors that are idle processes understate what a real agent
costs a node: an agent keeps some CPU busy even between requests. This
adds a way to give glutton actors a steady, tunable CPU draw.

Glutton gains a UseCPU RPC (also served over HTTP at /usecpu) that
replaces its pool of CPU-burning goroutines. Each goroutine targets a
duty cycle of one core, and measures its work budget in thread CPU time
so time spent preempted is not counted as work. The pool size is capped
at GOMAXPROCS unless the caller opts out, is reported by the
glutton.cpu.workers gauge, and is stopped on Close.

The boomer GluttonUser drives it through two new dynconfig keys,
cpu_cores and cpu_duty_cycle, set from the locust --cpu-cores and
--cpu-duty-cycle flags. Like the RAM fill, the load is started once per
actor after its first resume: the goroutines live in the glutton
process, so they persist across suspend and resume. A failed request is
retried on the next iteration, and the call reports as its own
GluttonUseCPU stats row. Zero cores, the default, disables it.

Fixes #<issue_number_goes_here>

> It's a good idea to open an issue first for discussion.

- [ x ] Tests pass
- [ x ] Appropriate changes to documentation are included in the PR
2026-10-02 17:22:17 +00:00
..