Skip to content

pace throughput mode offered rate with --rate - #162

Merged
fabracht merged 1 commit into
mainfrom
bench-rate-pacing
Sep 10, 2026
Merged

fabracht merged 1 commit into
mainfrom
bench-rate-pacing

Conversation

@fabracht

Copy link
Copy Markdown
Contributor

Adds an offered-rate control to throughput mode. The flag already existed for latency and hol-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:

saturating --rate 10000
offered rate uncontrolled 10,002 (100.0% of target)
delivered per-second series 0, 0, 0, 0, 0, 15222, 168638, … 80000, 79092, 80388, 80101, 80099
broker RSS 933 MB 18 MB

The paced series is flat from the first sample at 10,000 x 8 subscribers, and no backlog forms.

@fabracht
fabracht merged commit 82e4d8f into main Sep 10, 2026
16 checks passed
@fabracht
fabracht deleted the bench-rate-pacing branch September 10, 2026 22:27
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