question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Channel#writeAndFlush method costly

See original GitHub issue

Expected 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. Screenshot (60)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:24 (24 by maintainers)

github_iconTop GitHub Comments

1reaction
normanmaurercommented, Dec 4, 2020

@hyperxpro if you have any perf numbers to share (before and later) in terms of thoughtput please let us know

1reaction
hyperxprocommented, Dec 4, 2020

IO_URING on Fire. Free 5x performance improvement over Epoll. 🔥🔥🔥🔥

Screenshot (62)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found