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

Make use of FlushConsolidationHandler to optimize the performance of classic transport. #645

Closed
He-Pin opened this issue Sep 13, 2023 · 0 comments

Comments

@He-Pin
Copy link
Member

He-Pin commented Sep 13, 2023

The migration from Netty 3 to Netty 4 will need to change the channel.write to channel.writeAndFlush ,but that can be optimized in a more performant way.

#643
asked: netty/netty#13608

Add FlushConsolidationHandler which consolidates flush operations as …
…these are expensive

Motivation:

Calling flush() and writeAndFlush(...) are expensive operations in the sense as both will produce a write(...) or writev(...) system call if there are any pending writes in the ChannelOutboundBuffer. Often we can consolidate multiple flush operations into one if currently a read loop is active for a Channel, as we can just flush when channelReadComplete is triggered. Consolidating flushes can give a huge performance win depending on how often is flush is called. The only "downside" may be a bit higher latency in the case of where only one flush is triggered by the user.

Modifications:

Add a FlushConsolidationHandler which will consolidate flushes and so improve the throughput.

Result:

Better performance (throughput). This is especially true for protocols that use some sort of PIPELINING.
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

No branches or pull requests

1 participant