Repository navigation
Akka.IO: wire akka.io.tcp.maximum-frame-size to the pipe segment size (#8657) - #8663
Merged
Aaronontheweb merged 3 commits intoSep 29, 2026
Merged
Aaronontheweb merged 3 commits into
Aaronontheweb merged 3 commits into
Conversation
…akkadotnet#8657) akkadotnet#8132 moved TCP onto System.IO.Pipelines, and maximum-frame-size stopped doing anything: the pipe's default 4 KB segment size decided the read chunk and bytes-per-send instead. Pass it as minimumSegmentSize on both pipes so raising the setting cuts socket sends for large writes again, restoring the v1.5 behavior. Also fixes the TcpSettings buffer-size exception messages, which said "at least 2x the maximum frame size" while the check is 1x.
…er-of-two note, single Theory)
…e comment changes
This was referenced Sep 29, 2026
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.
Closes #8657.
akka.io.tcp.maximum-frame-size(TcpSettings.MaxFrameSizeBytes) capped the read buffer and the bytes per socket send in v1.5. It has done nothing since #8132 moved Akka.IO TCP onto System.IO.Pipelines. The pipes' default 4 KB segments took its place, because the write pump sends one segment perWriteAsyncand each read fills one segment. The default behavior happened to match (4k), but raising the setting silently stopped working. No release includes #8132, so this is a v1.6 regression.Changes
minimumSegmentSize: settings.MaxFrameSizeBytes. WithInet.SO.PipeBufferSizeset, the output pipe's watermarks are 2x/1x as before; otherwise pause 64 KB, resume 32 KB, the same asPipeOptions.Default.maximum-frame-sizemust now be positive (0 would make every pipe write throw); the check was< 0.TcpSettingserror messages said "at least 2x" while the check is 1x. The messages now describe the 1x check, which is unchanged. Theakka.confadvice to size the buffers at 2x the frame size stays: at 2x the kernel can hold one send while the next is copied in.akka.confcomment says what the setting does: an upper bound on bytes per socket read and per socket send, rounded up to a power of two (the pipe's pool rounds segment sizes), and each connection holds at least one buffer of that size.The default is unchanged (4 KB), so nothing changes unless someone raised the setting. It restores v1.5 behavior, so there's no ledger row.
Tests
TcpMaximumFrameSizeSpec: a single 64 KiB write reaches the socket as 16 × 4 KiB sends at the default, and as one send withmaximum-frame-size = 64k. With the fix reverted, the 64k case fails (16 × 4096). TheAkka.Tests.IOand Streams TCP suites pass.