fix: smooth txgen send dispatch#125
Open
mattsse wants to merge 1 commit into
Open
Conversation
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.
Summary
This changes the txgen sender so queued workload transactions keep refilling available RPC permits instead of stopping dispatch when all permits are temporarily occupied.
Why
High-rate runs could collapse into visible submission bursts because the sender stopped pumping at the concurrency ceiling and the rate limiter accumulated a bounded catch-up burst. At 50k TPS, the old 10ms burst budget could dispatch roughly 500 transactions at once, producing a sawtooth inflight graph.
The first smoothing attempt used one fixed timer interval per transaction, but at high TPS that required sub-millisecond wakes, e.g. 20us at 50k TPS. Runtime timer granularity makes that cap out around millisecond-scale dispatch instead of sustaining the target rate.
Impact
The sender now waits for a freed permit when ready transactions are queued, drains completions, reselects a ready transaction, and dispatches immediately. Rate limiting uses 1ms batches capped to one tick of credit, so 50k TPS releases about 50 sends per tick instead of either a 500-send burst or one 20us sleep per send.
Root Cause
The previous token-bucket limiter intentionally allowed a 10ms burst, and the pump loop returned when permits were exhausted instead of remaining active to refill newly freed permits.