Skip to content

Conversation

@sukunrt
Copy link
Member

@sukunrt sukunrt commented Mar 26, 2025

In experiments with js we've found that increasing the message size
increases throughput. See: libp2p/specs#628 (comment)
for details.

This changes the protobuf reader for the stream to read 256kB messages.
This also forces a change to the connection SCTP read buffer to be
increased to about 2.5 MB, to support 1 message being buffered for 10
streams.

This isn't enough to support larger messages. We most likely need to
change the inferred SDP of the server to use 256kB maxMessageSize, and
need some backwards compatible mechanism in the handshake to opt in to
large messages. See: libp2p/specs#628 for
details

@sukunrt sukunrt force-pushed the push-ywkztqyrwztp branch 2 times, most recently from 6cb46d8 to 15ab910 Compare March 27, 2025 08:51
DefaultKeepaliveTimeout = 15 * time.Second

sctpReceiveBufferSize = 100_000
sctpReceiveBufferSize = 10 * maxReceiveMessageSize
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: document why 10x

@sukunrt sukunrt force-pushed the push-ywkztqyrwztp branch from 15ab910 to 0684d51 Compare April 1, 2025 10:46
In experiments with js we've found that increasing the message size
increases throughput. See: libp2p/specs#628 (comment)
for details. 

This changes the protobuf reader for the stream to read 256kB messages.
This also forces a change to the connection SCTP read buffer to be
increased to about 2.5 MB, to support 1 message being buffered for 10
streams.

This isn't enough to support larger messages. We most likely need to
change the inferred SDP of the server to use 256kB maxMessageSize, and
need some backwards compatible mechanism in the handshake to opt in to
large messages. See: libp2p/specs#628 for
details
@sukunrt sukunrt force-pushed the push-ywkztqyrwztp branch from 0684d51 to aad780e Compare April 1, 2025 10:47
@sukunrt sukunrt merged commit 803505d into master Apr 1, 2025
9 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.

3 participants