[#2196] Improve queue consumer starvation under low configuration#2197
Open
mattrpav wants to merge 2 commits into
Open
[#2196] Improve queue consumer starvation under low configuration#2197mattrpav wants to merge 2 commits into
mattrpav wants to merge 2 commits into
Conversation
b733033 to
607f112
Compare
…figuration Test demonstrates that stalled low-priority network consumers with saturated prefetch throttle a normal-priority app consumer's throughput by 5-20x. Root cause: Queue.doPageInForDispatch() uses dispatchPendingList.size() against maxPageSize, so messages stuck behind full network consumers block page-in for all consumers. The test assertion (slowdownFactor <= 3.0) is expected to FAIL against the current code, proving the bug exists. The subsequent fix commit will make it pass.
…l prefetch Queue.doPageInForDispatch() used pagedInPendingSize < maxPageSize as the sole gate for paging in messages from the store. When low-priority network consumers had saturated prefetch (not acking), their undispatched messages accumulated in dispatchPendingList, counting against maxPageSize and blocking page-in for all consumers — including higher-priority app consumers with available prefetch capacity. Two changes: 1. When pagedInPendingSize >= maxPageSize, cap toPageIn to what consumers can actually accept (getConsumerMessageCountBeforeFull) 2. Allow page-in when any consumer has available prefetch capacity, even if pagedInPendingSize >= maxPageSize
607f112 to
a5b8ef9
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.
Run the test before the fix and observe:
Test run after fix:
edit: Tests passed, except for assembly on an address-in-use bind error. Re-running tests to get a green checkmark