Skip to content

fix: smooth txgen send dispatch#125

Open
mattsse wants to merge 1 commit into
mainfrom
mattsse/smooth-txgen-dispatch
Open

fix: smooth txgen send dispatch#125
mattsse wants to merge 1 commit into
mainfrom
mattsse/smooth-txgen-dispatch

Conversation

@mattsse

@mattsse mattsse commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

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.

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