pace throughput mode offered rate with --rate - #162
Merged
Merged
Conversation
fabracht
force-pushed
the
bench-rate-pacing
branch
from
September 10, 2026 22:16
4810862 to
4da321e
Compare
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.
Adds an offered-rate control to
throughputmode. The flag already existed forlatencyandhol-blocking, but the throughput generator never read it, so throughput mode could only saturate.--rate 0(the default) is unchanged: publishers offer as fast as the in-flight window allows. A positive value paces them to that aggregate rate using an absolute-deadline schedule per worker — each worker sleeps until its next scheduled instant rather than sleeping a fixed interval, so a slow publish does not permanently shift the schedule, and the pacing does not drift.Why
Saturating a broker with QoS 1 does not measure delivery throughput: the excess is queued rather than shed, so the broker accumulates a backlog and the per-second delivered series is a ramp rather than a steady state. Averaging that ramp understates the sustained rate substantially. Pacing the offered rate below the delivery capacity produces a flat series that the existing trimmed-mean estimator summarises correctly.
Measured
Local run, 16 publisher connections to 8 subscriber connections, QoS 1, 256-byte payloads:
--rate 100000, 0, 0, 0, 0, 15222, 168638, …80000, 79092, 80388, 80101, 80099The paced series is flat from the first sample at 10,000 x 8 subscribers, and no backlog forms.