Channel#writeAndFlush method costly
See original GitHub issueExpected behavior
Since Netty is asynchronous and all I/O events are handled by EventLoop, there should be the minimal cost of calling Channel#writeAndFlush
.
Actual behavior
However, for 1.2M writes, Channel#writeAndFlush
is taking 26,925 ms.
Steps to reproduce
Just do lots of write and flush.
Minimal yet complete reproducer code (or URL to code)
N/A
Netty version
4.1.54.Final
JVM version (e.g. java -version
)
Java 11
OS version (e.g. uname -a
)
Linux DESKTOP-ANM4Q9I 4.19.128-microsoft-standard Windows 10 Pro x64
Attaching a screenshot of JProfiler.
Issue Analytics
- State:
- Created 3 years ago
- Comments:24 (24 by maintainers)
Top Results From Across the Web
Optimize writeAndFlush for lots of small messages (do smart ...
I.e. approach looks like this: setup thread local collection for channels that shall be flushed. on all channels setup outbound channel handler ...
Read more >io.netty.channel.Channel.writeAndFlush java code examples
Return the assigned ChannelPipeline. closeFuture. Returns the ChannelFuture which will be notified when this channel is closed. This method always ret. isActive.
Read more >Netty: when does writeAndFlush channel future listener ...
I am new to netty and trying to understand how the channel future for writeAndFlush works. Consider the following code running on a...
Read more >FlushConsolidationHandler (Netty API Reference (4.0.56.Final))
writeAndFlush(Object, ChannelPromise) ). Flush operations are generally speaking expensive as these may trigger a syscall on the transport level. Thus it is in ......
Read more >netty/netty - Gitter
writeAndFlush and immediately call Channel.close.await, however if the data ... Hello, is there any recommended way to define on native epoll transport that ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@hyperxpro if you have any perf numbers to share (before and later) in terms of thoughtput please let us know
IO_URING on Fire. Free 5x performance improvement over Epoll. 🔥🔥🔥🔥