merlimat commented on issue #1321: Avoid contention on netty channel promise
URL: https://github.com/apache/bookkeeper/pull/1321#issuecomment-379320906
 
 
   > what is the impact of this change? like how much performance change we can 
get? do you have a microbenchmark for that?
   
   I cannot quantify directly the impact yet. I'm working to remove other 
contention points in Pulsar code. The results are only visible when most 
contention points are removed. 
   
   | Monitor Class                           |  Total Blocked Time |    Maximum 
Blocked Time  | Average Blocked Time    |       Std Dev Blocked Time |  
Distinct Threads        | Count | Distinct Addresses |
   | -------------                           | -------------      | 
-------------          | -------------           | -------------        | 
-------------     | ----- | -------------        |
   | io.netty.channel.DefaultChannelPromise     | 7.53794229E8 ns          | 
41358171 ns                  |1.6750982866666667E7 ns      |6124170.655041036 
ns  | 15                   | 45    | 45                   |
   
   
   Basically this means that this mutex has blocked IO threads for a total of 
753 millis (the profiling was done over 5minutes at 100K writes/s). That is all 
added to latency.
   
   
   ```
   void io.netty.util.concurrent.DefaultPromise.checkNotifyWaiters()    45
   boolean io.netty.util.concurrent.DefaultPromise.setValue0(Object)    45
   boolean io.netty.util.concurrent.DefaultPromise.setSuccess0(Object)  45
   boolean io.netty.util.concurrent.DefaultPromise.trySuccess(Object)   45
   void io.netty.util.internal.PromiseNotificationUtil.trySuccess(Promise, 
Object, InternalLogger)      45
   void io.netty.channel.ChannelOutboundBuffer.safeSuccess(ChannelPromise)      
45
   boolean io.netty.channel.ChannelOutboundBuffer.remove()      45
   void io.netty.channel.ChannelOutboundBuffer.removeBytes(long)        45
   int 
io.netty.channel.epoll.AbstractEpollStreamChannel.writeBytesMultiple(ChannelOutboundBuffer,
 IovArray)    45
   int 
io.netty.channel.epoll.AbstractEpollStreamChannel.doWriteMultiple(ChannelOutboundBuffer)
 45
   void 
io.netty.channel.epoll.AbstractEpollStreamChannel.doWrite(ChannelOutboundBuffer)
        45
   void io.netty.channel.AbstractChannel$AbstractUnsafe.flush0()        45
   void 
io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.flush0()        
45
   void io.netty.channel.AbstractChannel$AbstractUnsafe.flush() 45
   void 
io.netty.channel.DefaultChannelPipeline$HeadContext.flush(ChannelHandlerContext)
        45
   void io.netty.channel.AbstractChannelHandlerContext.invokeFlush0()   45
   void io.netty.channel.AbstractChannelHandlerContext.invokeFlush()    45
   ChannelHandlerContext io.netty.channel.AbstractChannelHandlerContext.flush() 
45
   void 
io.netty.channel.ChannelOutboundHandlerAdapter.flush(ChannelHandlerContext)     
45
   void io.netty.channel.AbstractChannelHandlerContext.invokeFlush0()   45
   void io.netty.channel.AbstractChannelHandlerContext.invokeFlush()    45
   ChannelHandlerContext io.netty.channel.AbstractChannelHandlerContext.flush() 
45
   void 
io.netty.channel.ChannelOutboundHandlerAdapter.flush(ChannelHandlerContext)     
45
   void io.netty.channel.AbstractChannelHandlerContext.invokeFlush0()   45
   void io.netty.channel.AbstractChannelHandlerContext.invokeFlush()    45
   ChannelHandlerContext io.netty.channel.AbstractChannelHandlerContext.flush() 
45
   void 
io.netty.channel.ChannelOutboundHandlerAdapter.flush(ChannelHandlerContext)     
45
   void io.netty.channel.AbstractChannelHandlerContext.invokeFlush0()   45
   void io.netty.channel.AbstractChannelHandlerContext.invokeFlush()    45
   ChannelHandlerContext io.netty.channel.AbstractChannelHandlerContext.flush() 
45
   void io.netty.channel.ChannelDuplexHandler.flush(ChannelHandlerContext)      
45
   void 
org.apache.bookkeeper.proto.AuthHandler$ClientSideHandler.write(ChannelHandlerContext,
 Object, ChannelPromise)  45
   void io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(Object, 
ChannelPromise)     45
   void io.netty.channel.AbstractChannelHandlerContext.invokeWrite(Object, 
ChannelPromise)      45
   void 
io.netty.channel.AbstractChannelHandlerContext.access$1900(AbstractChannelHandlerContext,
 Object, ChannelPromise)       45
   void 
io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.write(AbstractChannelHandlerContext,
 Object, ChannelPromise)   45
   void 
io.netty.channel.AbstractChannelHandlerContext$WriteAndFlushTask.write(AbstractChannelHandlerContext,
 Object, ChannelPromise)   45
   void io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.run()  
45
   void io.netty.util.concurrent.AbstractEventExecutor.safeExecute(Runnable)    
45
   boolean io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(long) 
45
   void io.netty.channel.epoll.EpollEventLoop.run()     45
   void io.netty.util.concurrent.SingleThreadEventExecutor$5.run()      45
   void io.netty.util.concurrent.FastThreadLocalRunnable.run()  45
   void java.lang.Thread.run()  45
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to