Skip to content

Let glutton actors consume CPU, driven from boomer dynconfig - #1875

Open
Max Smythe (maxsmythe) wants to merge 1 commit into
agent-substrate:mainfrom
maxsmythe:glutton-cpu-load
Open

Max Smythe (maxsmythe) wants to merge 1 commit into
agent-substrate:mainfrom
maxsmythe:glutton-cpu-load

Conversation

@maxsmythe

Copy link
Copy Markdown
Collaborator

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

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant