Repository navigation
tcp: RecvQueueEntries defaults to 64 again, 1.5 KiB a connection instead of 96 KiB; release 0.17.340 - #371
Merged
Conversation
…ead of 96 KiB #257 raised the default from 64 to 4096 in the same change that made an overflow an error. The error stays; this puts the default back. The queue is sized up front for every connection, pooled ones included, so 4096 is 96 KiB a connection against 1.5 KiB. In shared mode one connection whose handler is not reading can also hold the reactor's whole default ring (RecvSlots 4096) before it overflows. On a saturated small-request load (HttpArena's ioxide entry, 8 reactors, 4096 connections, ~2.45M req/s), 0.16.268 - the first release with 4096 - measured 1.9% under 0.7.211, and 0.2% under it with RecvQueueEntries = 64. On 0.17.339 the same override measured -1.4% -> -0.9%, inside the run's ~1% noise. 16,384 connections held 732 MiB, against 470 MiB at 64. A handler that lets its peer get more than 64 deliveries ahead sees the overflow as an IOException, not a clean end, and can raise the option. The samples and docs follow, and the index panes are regenerated by scripts/gen-docs-panes.py and scripts/gen-docs-proxy-panes.py.
Releases the RecvQueueEntries default above. All eleven published packages share one version; the bump is only their Version elements, and IoxideRuntime.Version is generated from ioxide.csproj. ioxide.redis.stackexchange is bumped too, though CI does not pack it.
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.
#257 raised
TcpOptions.RecvQueueEntriesfrom 64 to 4096, in the same change that made an overflow an error instead of a clean end. This keeps the error and puts the default back to 64.The queue is sized up front for every connection, pooled ones included, so 4096 costs 96 KiB a connection against 1.5 KiB. In shared mode it also lets one connection whose handler is not reading hold the reactor's whole default ring (
RecvSlots4096) before it overflows. At 64 that connection is closed long before, and since #257 its readers see the error.Measured
HttpArena's ioxide entry, every published version side by side. The setup was 8 reactors pinned to 8 P-cores of an i9-14900K, gcannon on the E-cores, 4096 connections and the baseline GET/POST mix. The server was saturated at ~2.45M req/s. Versions were measured round-robin; each figure is the median of 6 runs.
RecvQueueEntries = 64RecvQueueEntries = 64In the same runs, versions with no change on this path moved by up to ~1%. So the 0.16.268 gap is real, and the 0.17.339 gain is inside the noise. Memory moves for certain: at 16,384 connections the entry held 732 MiB, against 470 MiB at 64.
A handler that lets its peer get more than 64 deliveries ahead now gets #257's
IOException(TcpConnection.RecvOverflowed) sooner. It can raise the option.The samples and docs follow:
docs/learn/architecture.html;multiport.htmlandtls.html;scripts/gen-docs-panes.pyandscripts/gen-docs-proxy-panes.py. Both reported the page in sync onmainbefore the change.Release
The second commit bumps all twelve csproj
Versionelements to 0.17.340, as #339 did for 0.17.339, so merging publishes the new default.Tests
No new tests, since this only changes a default. Most fixtures already set
RecvQueueEntries = 64or less themselves, so the suites have been running at 64 all along.Run locally, with no failures: Unit 78 (1 pending), E2E 285 (6 pending), Http 83 (4 pending), Tls 174 (8 pending, kTLS cases included), File 5, Chaos 79 (1 pending). They ran on the first commit. The release commit only changes
Version, and the final head builds clean. I did not run Pg and Redis, since there are no sidecars here. Neither reaches this: only an accepted connection readsRecvQueueEntries(Reactor.Tcp.cs:240).Overlap
#362, #363 and #365 also edit
TcpOptions.cs, andgit merge-treeagainst each open PR is clean. #362 addsSendWaitAlldirectly above this comment, so the comment's first lines stay as they were to keep the two hunks apart. #307 already conflicts withmain, in a file this does not touch.🤖 Generated with Claude Code