You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/06/01 13:28:56 UTC

[GitHub] [pulsar] eolivelli commented on a diff in pull request #15678: [improve][proxy] Support zero-copy of NIC to NIC on Proxy

eolivelli commented on code in PR #15678:
URL: https://github.com/apache/pulsar/pull/15678#discussion_r886806085


##########
pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/DirectProxyHandler.java:
##########
@@ -346,6 +353,14 @@ public void channelRead(final ChannelHandlerContext ctx, Object msg) throws Exce
                 }
                 inboundChannel.writeAndFlush(msg)
                         .addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
+
+                if (service.zeroCopyModeEnabled && service.proxyLogLevel == 0) {
+                    if (!ProxyConnection.isTlsChannel(ctx.channel()) && !ProxyConnection.isTlsChannel(inboundChannel)) {

Review Comment:
   what about caching this condition ? the "channel" is constant.
   we can save some cycles



##########
conf/proxy.conf:
##########
@@ -60,6 +60,9 @@ advertisedAddress=
 # Enable or disable the HAProxy protocol.
 haProxyProtocolEnabled=false
 
+# Enable or disable the zero-copy of NIC to NIC.
+zeroCopyModeEnabled=true

Review Comment:
   I would name this like 'proxyZeroCopyModeEnabled'



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org