[Opening an old thread.....]
What is the best practice here? I am assuming that invoking writeAndFlush()
from a channelHandler is good (following example) :
public class MyStreamHandler extends ChannelInboundHandlerAdapter {
//Some code
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws
Exception {
//some code
final ChannelFuture future = this.channel.writeAndFlush(content);
future.addListener(new WriteCompleteListener(..);
//some other code
}
}
Or invoking writeAndFlush from outside the EventLoop is the best practice?
I am little confused.
Thanks,
Arnab
On Wed, May 25, 2016 at 1:15 AM, <[email protected]> wrote:
> Hi Norman,
>
> Thank you for getting back to me. Yes, in this scenario I am invoking
> writeAndFlush from outside the EventLoop.
>
> Michael
>
> On Tuesday, 24 May 2016 14:56:47 UTC-4, Norman Maurer wrote:
>>
>> Do you write from outside the EventLoop or not? Like calling
>> Channel.writeAndFlush(...) from outside a ChannelHandler implementation?
>>
>> Am 23.05.2016 um 21:10 schrieb [email protected]:
>>
>> Hi,
>>
>> I am wondering if anyone can share their insights into netty
>> writeAndFlush latency with me. I am running netty v4.1.0 CR7 with epoll
>> handling about 45,000 QPS of HTTP traffic. Hardware environment is 24 cores
>> with 64GB RAM. Through instrumentation, I am observing a 99th percentile
>> latency of about 10ms for writeAndFlush invocations. I am measuring this by
>> recording the time prior to invoking writeAndFlush and attaching a listener
>> for operationComplete. Does a 10ms 99th percentile latency for
>> writeAndFlush seem reasonable to others? It seems like a significant cost
>> for writing to a socket and I am looking to identify whether or not I can
>> improve my usage of netty.
>>
>> Thank you,
>> Michael
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Netty discussions" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/netty/b5a5d8c2-c3d0-43bf-8a6a-b168daaa57f3%40googlegroups.com
>> <https://groups.google.com/d/msgid/netty/b5a5d8c2-c3d0-43bf-8a6a-b168daaa57f3%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Netty discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/netty/52d983c4-0f7b-41f2-8f00-1034fc30c7b7%40googlegroups.com
> <https://groups.google.com/d/msgid/netty/52d983c4-0f7b-41f2-8f00-1034fc30c7b7%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/netty/CAOG5%2B9mXK4n3kAUZDRZmWYgLN7dYuVZh3MqLmduj0dUYSggaoA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.