Let glutton actors consume CPU, driven from boomer dynconfig - #1875
Open
Max Smythe (maxsmythe) wants to merge 1 commit into
Open
Max Smythe (maxsmythe) wants to merge 1 commit into
Max Smythe (maxsmythe) wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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>