Skip to content

Collect results during rate-limited runs without a TUI - #911

Merged
hatoo merged 1 commit into
masterfrom
fix-910
Nov 12, 2026
Merged

hatoo merged 1 commit into
masterfrom
fix-910

Conversation

@hatoo

@hatoo hatoo commented Nov 12, 2026

Copy link
Copy Markdown
Owner

With -q and no TUI, results were collected only after the workers finished. Kanal's queue therefore grew throughout the run, and buffer growth under its internal lock stalled request processing near powers of two.

Collect results concurrently in one async task that also handles Ctrl+C. The task owns the accumulated results, avoiding an extra per-result mutex. Keep the pending receive future available on interruption so results already delivered directly by Kanal can be included before draining the queue.

Fixes #910.

Validation:

  • cargo test --all-targets: 84 tests passed, including new single-worker tests with/without latency correction and Ctrl+C while a response is pending.
  • Formatting and diff checks passed.
  • Compared release builds of master (43c7cf2) and this change, alternating three runs each against a local HTTP server: -z 20s -c 100 -q 27000 --latency-correction --no-tui --worker-threads 4.

Maximum completion gap within ±128 completions of each boundary (range across three runs):

Boundary master This change
65,536 4.85–5.41 ms 1.39–1.53 ms
131,072 10.64–12.93 ms 1.39–1.50 ms
262,144 18.98–21.28 ms 1.39–1.45 ms
524,288 38.55–47.64 ms 1.38–1.64 ms

Both builds sustained approximately 27,000 RPS. A separate startup pause caused by Linux FD-table expansion remains and is being addressed independently.

@hatoo
hatoo merged commit 520047d into master Nov 12, 2026
20 checks passed
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.

With -q and no TUI, result queue growth stalls request processing

1 participant