Add opt-in drainProducerRate to throttle producers during the backlog drain#151
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
70817bf to
95f0ac4
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.
buildAndDrainBacklog()only pauses/resumes consumers — producers keep publishingat
producerRatethrough the drain. That makes it impossible to measure maxconsume throughput on a cold backlog (e.g. one aged onto tiered storage) without
producers competing.
This adds an opt-in
Workload.drainProducerRate(int, default-1= unset).When ≥ 0,
buildAndDrainBacklog()calls the existingworker.adjustPublishRate()just before resuming consumers:
-1→ producers run through the drain (unchanged)N→ throttled to N msg/s;0→ ~1 msg/s via the existing<1floor (≈ stopped)It reuses the internal lever
findMaximumSustainableRatealready uses (fans out todistributed workers) — no new
Workermethod or endpoint. Default-1skips thecall, so existing workloads are byte-identical.
Tested:
WorkloadTestcovers the default + deserialization; a backlog run withdrainProducerRate: 0drops producers to ~1 msg/s at "Start draining backlog".Requires https://github.com/redpanda-data/vtools/pull/4353 to use in benchrunner