Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default value of MAX_MESSAGES_PER_READ for DatagramChannel imp… #13676

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

normanmaurer
Copy link
Member

…lementations

Motivation:

All our DatagramChannel implementations used a MAX_MESSAGES_PER_READ of 1 due the fact of how they used the ChannelMetaData constructor. This makes no sense and hurts performance a lot as it will basically result in have fireChannelRead(...) only called once and then direct fireChannelReadComplete(...).

For example in a QUIC benchmark I did observe receiving a 1 GB file did take 14 seconds. After chaning the default to 16 (which is also what other Channels use) this dropped to 6 seconds for the specific benchmark.

Modifications:

Use a default of 16 messages per read when using DatagramChannels

Result:

Better performance with default settings

…lementations

Motivation:

All our DatagramChannel implementations used a MAX_MESSAGES_PER_READ of 1 due the fact of how they used the ChannelMetaData constructor. This makes no sense and hurts performance a lot as it will basically result in have fireChannelRead(...) only called once and then direct fireChannelReadComplete(...).

For example in a QUIC benchmark I did observe receiving a 1 GB file did take 14 seconds. After chaning the default to 16 (which is also what other Channels use) this dropped to 6 seconds for the specific benchmark.

Modifications:

Use a default of 16 messages per read when using DatagramChannels

Result:

Better performance with default settings
@normanmaurer
Copy link
Member Author

This was discovered here netty/netty-incubator-codec-quic#598

@normanmaurer normanmaurer added this to the 4.1.101.Final milestone Nov 1, 2023
@normanmaurer normanmaurer merged commit 7800070 into 4.1 Nov 1, 2023
14 checks passed
@normanmaurer normanmaurer deleted the default_max_messages_per_read branch November 1, 2023 16:06
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.

None yet

3 participants